StefanLage / SLPagingViewSwift

Navigation bar system allowing to do a Tinder like or Twitter like. SLPagingViewSwift is a Swift port of the Objective-C of SLPagingView
MIT License
216 stars 35 forks source link

Storyboard support? #1

Open muuuh opened 9 years ago

muuuh commented 9 years ago

Hello, are you planning to add storyboard support?

Best regards,

mxmlnbln commented 9 years ago

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()

muuuh commented 9 years ago

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.

StefanLage commented 9 years ago

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.

CaioJahara commented 9 years ago

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 :(

acegreen commented 9 years ago

Try-Catch now available on swift 2.0

ghost commented 9 years ago

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

jaddoescad commented 8 years ago

Any news for storyboard support