简体   繁体   English

如果我使用 IOS 图形 Segue 而不是在视图控制器中执行会怎样?

[英]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.我已经用 swift 编码了 2 个月了。 Is there any problem if i use the method of giving segue through storyboard instead of doing that in the program ?如果我使用通过故事板提供 segue 的方法而不是在程序中这样做有什么问题吗?

Using segues versus constructing them manually has little difference semantically but I suppose it comes down to two choices:使用 segues 与手动构建它们在语义上几乎没有区别,但我认为它归结为两个选择:

  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.这非常适合使用 segue,因为它们直观地显示了应用程序将采用的路径。

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.话虽如此,如果我使用 XIB 或代码来创建 UI,那么使用 segue 几乎没有好处。

Segues are potentially very powerful allowing you to create custom, reusable transitions. Segues 可能非常强大,允许您创建自定义的、可重用的过渡。 I would recommend reading the section on segues on the Apple developer site ( https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomSegues/CreatingCustomSegues.html )我建议您阅读 Apple 开发者网站 ( https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomSegues/CreatingCustomSegues.html ) 上有关 segue 的部分

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在视图控制器segue(ios)中将此字符串传递给标签时,我做错了什么? - What am i doing wrong in passing this string to label in a view controller segue (ios)? iOS关闭视图控制器后执行segue - iOS Perform segue after dismissing view controller IOS如何将一个数组转移到另一个视图控制器 - IOS how to segue an array to another view controller iOS 7-在Storyboard Segue中维护视图控制器实例 - iOS 7 - Maintain view controller instance in Storyboard segue iOS-设置-模态选择到表视图控制器 - iOS - Settings - Modal Segue to Table view controller 从第二个视图控制器到第一个视图控制器ios8进行segue - segue from second view controller to first view controller ios8 在父级View Controller上注册Segue以在子级View Controller上使用 - Register a Segue on a Parent View Controller to use on Child View Controller 在iOS上使用Table View作为Segue按钮 - Use Table View as segue button on iOS ios5如何在按顺序推送的视图控制器中更改后退按钮标题 - how do i change the back button title in a view controller pushed with a segue as below in ios5 ios 如何从单视图转为拆分视图控制器 - ios How To Segue From Single View To Split View Controller
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM