SLPagingViewSwift icon indicating copy to clipboard operation
SLPagingViewSwift copied to clipboard

Storyboard support?

Open muuuh opened this issue 10 years ago • 7 comments

Hello, are you planning to add storyboard support?

Best regards,

muuuh avatar Feb 06 '15 16:02 muuuh

Isn't it already possible using: let storyboard = UIStoryboard(name: "MyStoryBoardName", bundle: nil) var ctr1 = storyboard.instantiateViewControllerWithIdentifier("MyViewController") as UIViewController instead of: var ctr1 = UIViewController()

mxmlnbln avatar Feb 07 '15 17:02 mxmlnbln

But this would mean, that the initial view needs to be written code based (set UIWindow, etc.).

https://github.com/StefanLage/SLPagingViewSwift/blob/master/Demos/TinderLike/TinderLike/AppDelegate.swift

self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
...
self.nav = UINavigationController(rootViewController: self.controller!)
self.window?.rootViewController = self.nav
self.window?.backgroundColor = UIColor.whiteColor()
self.window?.makeKeyAndVisible()

I think the default storyboard-use would be different, like in https://github.com/StefanLage/SLPagingView#storyboard-support

Perhaps this is easier.

muuuh avatar Feb 08 '15 19:02 muuuh

Actually I tried to implement the same way you talk about @muuuh but the fact if there are no Try-Catch closures in Swift so we need to implement them in Objective-C and then make a Bridging Header to use it in Swift. But Bridging Header is linked to a Project thus the user will need to make it on each project using this library, that's not a good solution. I'll figure out a better way.

StefanLage avatar Feb 10 '15 09:02 StefanLage

Any news @StefanLage on the Storyboard solution?

I've tried using the Objective C solution but the Swift Storyboard just won't recognize the SLPagingViewController as a custom class :(

CaioJahara avatar Apr 13 '15 17:04 CaioJahara

Try-Catch now available on swift 2.0

acegreen avatar Jul 23 '15 01:07 acegreen

hi Stefan, Have you had any luck with the Swift storyboard implementation? Thanks again, great project.

ghost avatar Sep 08 '15 16:09 ghost

Any news for storyboard support

jaddoescad avatar Aug 30 '16 19:08 jaddoescad