Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would I reference the main storyboard in my app programmatically in swift?

How would I reference the main storyboard in my app programmatically in swift? I looked into the app delegate for a reference but so far I haven't found one.

like image 885
Daniel K. Avatar asked Sep 27 '14 23:09

Daniel K.


People also ask

How do you reference a storyboard in Swift?

Inside there create a view controller however you need, and give it a storyboard identifier. In Main. storyboard, drag out a storyboard reference object. In the attributes inspector select your new storyboard from the Storyboard dropdown, then enter your target storyboard identifier in the Referenced ID box.

How do I use storyboard reference in Xcode?

storyboard and choose Refactor to Storyboard ... from Xcode's Editor menu. Xcode prompts you to name the storyboard which the Note View Controller scene is moved to. Name the storyboard NoteViewController. storyboard and click Save.

What is main storyboard in Swift?

The storyboard is first introduced in iOS 5 to save time building user interfaces for the iOS applications. It is a visual representation of the user interface of an iOS app. It can be defined as the sequence of screens, each of which represents the ViewController and the Views.


1 Answers

Oh whoops I found the answer...

In another view controller of the that is connected to a storyboard you can simply use:

self.storyboard?
like image 144
Daniel K. Avatar answered Sep 21 '22 02:09

Daniel K.