简体   繁体   中英

What if I use IOS graphical Segue instead of doing it in the view controller?

I have been coding in swift for 2 months now. Is there any problem if i use the method of giving segue through storyboard instead of doing that in the program ?

Using segues versus constructing them manually has little difference semantically but I suppose it comes down to two choices:

  1. Personal preference
  2. The existing infrastructure

My personal preference is to utilise storyboards in the creation of my app. This lends itself very well to utilising segues as they show visually the path in which the app will take.

That been said, if I was using XIBs or code to create the UI then there would be little to no benefit in using segues.

Segues are potentially very powerful allowing you to create custom, reusable transitions. I would recommend reading the section on segues on the Apple developer site ( https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomSegues/CreatingCustomSegues.html )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM