0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

UIStoryboard

Posted at

■UIStoryboard

プロパティメソッド

//どのUIstoryboardなのか?
init(name: String, bundle storyboardBundleOrNil: Bundle?)

//例 Mainって言うUIStoryboardやで
let storyboard = UIStoryboard(name: "Main", bundle: nil)
//どのUIviewContorollerなのか?
open func instantiateViewController(withIdentifier identifier: String)

//例: Main.storyboardのStoryboardID:CodeってつけたUIViewControllerやで
let CodeView = storyboard.instantiateViewController(withIdentifier: "Code")
//どのUIviewContorollerなのか?
   open func instantiateInitialViewController() -> UIViewController?

//例: MainStoryboardのFirstViewControllerやで
   let CodeView = storyboard.instantiateViewController() as! FirstViewController

■縮めてまとめて書く

 UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController() as! FirstViewController
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?