Split About Storyboard storyboard, Segue use, storyboard of

1. related presentations.

For ios development, in fact storyboard it is actually quite useful. It allows you to see a jump all relations applications. Storyboard when iOS5 introduced, it can save you time to create the UI. storyboard with conventional nib (nib files later changed his name to xib file, small partners do not tangle it is valid) compared to the file, there are a lot of advantages

1.storyboard may describe a transition between the various scenarios, this transition is referred to as "segue", you can get by simply ctrl-dragging, it reduces code

2.storyboard support table view of the prototype cell, which means you can edit the cell in the storyboard, the reduction of the amount of code

Of course, everything has its advantages exist.

It is in our common xib and storyboard separated. It is more convenient to your package, that is, when you create a long time point, but a good package when multiplexed back on faster than in storyboard of. I also had cell editing in storyboard, drag edited by xcode cell is very fast, and then if you can also use your storyboard layout cell replication in viewcontroller to be created.

My hands through storyboard development, will save a lot of development time, I understand ios development in most developers are using oc development. Many people simply understand storyboard, and will not fully use. There is fear that it is unstable, a problem is difficult to themselves. Indeed there is little pits with a storyboard, but when you familiar with it can be a good temper you use it. The key is to try to learn the students, those problems are likely to make him give up learning to use storyboard, because some problems. I think the problem is unfriendly compiler. For developers, those problems are not caused by them. They actually is no problem. Or have tips they do not know how to operate. There is a wrong positioning them well. The following is not nonsense, and began to introduce the use.

2. Everyone should know ui layout settings, the priority is lower than the code. After you edit the settings of the code in storyboard do see is the result of the code setting operation.

xcode is now 10.2.1 version. Before adding the controls at the bottom right-hand column, now changed to the top of the upper right. You can search using the controls you need.

When the application is shown in the beginning of. The default application is launched viewcontorller. We generally have multiple view contorller tab switchable. When you add in viewcontroller you want is navigationcontroller. Do not know can Baidu next. Click to select your newly added controller, as shown in operation.

 How tabviewcontroller and navigationcontroller associate. Hold control tabviewcontroller drag from the small button can navigationcontroller in FIG.

After dragging will pop pop can choose viewcontrollers.

Jump relationship behind this election are not the same, see below link specific knowledge

Segue several types

With this sugue just saw a jump relational interface, and can not jump, of course, if you are dragged from the button, you can click the button to jump over, do not write the code is not very simple. This all? No

1. Do you sometimes have to pass by value,

2. To determine sometimes jump. Or you have more than one interface sugue, you have control over the code.

3. Here, you have not thought about all your interfaces relations, have drawn a big problem in a storyboard, xcode to load out the storyboard a very time-consuming. Would you like to wait? Even if you are willing to wait, if you are more than one person to co-develop a problem, you have to make changes in a storyboard, the merger shortly conflict yet?

4. And you first set up your map interface. If you let your demand dynamics have changed a few nevigationcontroller

We still continue to use sugue speak of. How to write the code to control it?

 Click your sugue see right side of Fig place to see I added identifier, you use this code to which it points you segue.

addTarget(self, action: #selector(completeBtnClicked(sender:)), for: .touchUpInside)

@objc func completeBtnClicked(sender: UIButton?){

        

        if  UserInfoManager.getUserInfo()?.identity == 2{

            performSegue(withIdentifier: "ToMatchmakerBaseInfoViewControllerSegueID", sender: nil)

        }else{

            performSegue(withIdentifier: "ToCompleteChildInfoViewControllerSegueID", sender: nil)

        }

    }

关于Storyboard故事板, Segue 的使用,storyboard的拆分(二)

Guess you like

Origin blog.csdn.net/chengzuidongfeng/article/details/92376101