× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

ios get storyboard name in viewDidLoad

Antonio Bello
Mar 01, 2015
<p>In the identity inspector of IB there's a <code>Restoration ID</code> field you can fill with a string of your choice. Once set, you can retrieve it using:</p> <pre><code>self.restorationIdentifier </code></pre> <p>Just choose 2 different strings for the 2 VC and you're done, you can check the actual value at runtime.</p> <p><strong>Addendum</strong>: This method also works if the 2 view controllers are in the same storyboard.</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/24760542/ios%20get%20storyboard%20name%20in%20viewDidLoad/24760891">Stack Overflow</a>.</p>
comments powered by Disqus