CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

ViewControllerDescribable 1.0.2

ViewControllerDescribable 1.0.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jun 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Andrew Kochulab.



ViewControllerDescribable

License

A simple way to switch between controllers.

Just install the pod and it is ready to use!

Requirements

  • Swift >= 3.0
  • iOS >= 8.0

Installation

CocoaPods

pod 'ViewControllerDescribable'

And after in terminal run command

pod install

In your project create an enumeration like this:

extension UIStoryboard {
   enum Name: String, StoryboardNameDescribable {
       case main = "Main",
       profile = "Profile"
   }
}

Usage

Describe your view controller like this:

import ViewControllerDescribable

extension SecondViewController: ViewControllerDescribable {
   static var storyboardName: StoryboardNameDescribable {
       return UIStoryboard.Name.profile
   }
}

And after push or present from view controller you have:

navigationController?.push(SecondViewController.self, configuration: { vc in
   vc.firstName = "Hello"
})

present(ThirdViewController.self)

Example

ViewControllerDescribableTest

Credits

  • by Andrew Kochulab
  • VK