Based on Xcode 7.2,Swift 2.
- Create a SampleVC.swift in project. (Class SampleVC : UIViewController)
- Create a View Controller in Storyboard.(Identity:"newView") In Interface Builder, within Identity Inspector, choose label class with SampleVC. Now I can modify "newView" within Class SampleVC.
- Refer "newView" with
UIStoryBoard.instantiateViewControllerWithIdentifier()
in code.ThenpresentViewController()
show "newView".
I put step 3 in a button function, "newView" shows, everything is ok, but how can I pass some values to SampleVC? Am I forced to use segue here? Because I think there must be a simple solution here.