StoryboardViewController 0.1.4

StoryboardViewController 0.1.4

Maintained by StoryboardViewController.



  • By
  • Yoon

StoryboardViewController

CI Status Version License Platform

Example

Simply make view controllers conform Storyboardable, then you will have 2 things to be done in the protocol.

class ProfileViewController: UIViewController, Storyboardable {
    static let storyboardName = "Example"
    typealias InitialParameterType = (userName: String, userID: Int)
...

Then you can create the view controllers with parameters like below.

    ...
    let profileViewController = ProfileViewController.create(initialParameter: (userName: "John", userID: 1001)) 
    ...

You can load the view controllers from storyboards by setting the storyboardName static variable in the code and setting them initial view controllers in the storyboards, or setting the storyboard IDs same as the class names.

Installation

StoryboardViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'StoryboardViewController'

Author

Yoon, [email protected]

License

StoryboardViewController is available under the MIT license. See the LICENSE file for more info.