Beginner Swift, code load xib Storyboard
-. Load Xib
Override Init (Nibname nibnameornil:string?, bundle Nibbundleornil:nsbundle?) { Super.init (Nibname:nibnameornil, Bundle:nibbundleornil)} convenience init () { var nibnameornil = String? ("Viewcontroller") Self.init (Nibname:nibnameornil, Bundle:nil)} required init (coder Adecoder:nscoder) { fatalerror ("Init ( Coder:) have not been implemented ")}
Two. Load Storyboard jump to Storyboard
var Jumpviewcontroller:viewcontroller = Uistoryboard (name: "Main", Bundle:nil). Instantiateviewcontrollerwithidentifier ("Storyboard ID") as! Viewcontroller Self.navigationcontroller? Pushviewcontroller (Jumpviewcontroller, Animated:true)
Storyboard ID is the ID of the Storyboard binding
Viewcontroller is the binding class
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Swift Code load xib Storyboard