Multiple storyboard of iOS development are interrelated

Source: Internet
Author: User
<span id="Label3"></p>1.Storyboard Link Storyboard<p><p>The advent of storyboard has made development seem like storytelling, and the flow of relationships between the UI is Straightforward. It is actually an upgraded version of xib, which manages multiple xib in a Unified. Everything has a double-sided nature, storyboard also has its shortcomings. The author said that his experience, version management, many people modify very easily Song Conflict. There are too many uiviewcontroller in storyboard, and it is difficult to find the desired (especially in mba). These shortcomings will be met in the development of Trooped. If we use the Xib file, so that the UI is minimized, we will use code to connect these small units together, you can solve this problem. If you only use Xib to show storyboard storyline Ability.</p></p><p><p>This method is the same as the principle of the above method, using the load storyboard, instantiate the corresponding custom Uiviewcontroller class, and then manually addsubview to the link view to reach the linked Directory. Speech is a bit abstract, or the code to express it, easy to Understand.</p></p><p><p>Here's a link code written by a person on github: Rbstoryboardlink. Its usage is also clearly stated in the Readme.</p></p><p><p>We will download the source code, there is a sample:linkedtabs. Because the original author used the cocoapods, so need to go to the source linkedtabs directory, run a command line:</p></p><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs sql"><span class="hljs-operator"><span class="hljs-keyword">update</span></span></code></pre></pre><p><p>Let me just briefly describe the structure of sample.<br>There are three storyboard, mainstoryboard,firsttabstoryboard, secondtabstoryboard, It is now necessary to connect the two Uiviewcontroller in Mainstoryboard with Firsttabstoryboard,secondtabstoryboard respectively to achieve the program These three storyboard seem to be together for a purpose.</p></p><p><p>Open mainstoryboard, Navigate to Tab1 's Uiviewcontroller<br></p></p><p><p>Note the two arrows in the picture, the above one must fill in the custom Class rbstoryboardlink, is a class to complete the task of the Connection.<br>At the bottom of the arrow is the passed property and the corresponding value, which is handed to the instantiated object when the Rbstoryboardlink is Instantiated. Storyboardname This property indicates where to link to, here we want to link to firsttabstoryboard, so the value is Firsttabstoryboard. There is also an optional attribute, sceneidentifier, that represents which uiviewcontroller to link to Storyboard. If this attribute is not passed, link to the initial View Controller in Firsttabstoryboard.</p></p><p><p>If we want to link to the second uiviewcontroller in firsttabstoryboard, it's simple:<br><br>For example, We first find this Linke view controller, and then enter the identity of the view controller in the storyboard id, as entered Here: navcontroller.</p></p><p><p>Then add the sceneidentifier:navcontroller where you need to link, see the Arrows.<br></p></p><p><p>So the link is Successful.</p></p><p><p>Method 3 and Method 4 are only the combination of methods, nor is there more. Here's An Introduction to Xib link Xib</p></p>End<p><p>Xib Link Xib address:<br>http://blog.csdn.net/BaiHuaXiu123/article/details/51344886</p></p> <p><p>Multiple storyboard of iOS development are interrelated</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.