最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【整理】Cocoa中的Segue

Cocoa crifan 2500浏览 0评论
Segue
scenes are connected by segue objects, which represent a transition between two view controllers.
A Segue Manages the Transition Between Two Scenes
You can set the type of transition (for example, modal or push) on a segue. Additionally, you can subclass a segue object to implement a custom transition.
You can pass data between scenes with the method prepareForSegue:sender:, which is invoked on the view controller when a segue is triggered. This method allows you to customize the setup of the next view controller before it appears on the screen. Transitions usually occur as the result of some event, such as a button being tapped, but you can programmatically force a transition by calling performSegueWithIdentifier:sender: on the view controller.

[总结]

Segue,英文本意:继续
此处感觉是:
如果你希望从页面视图A,继续,切换,转换,显示到,下一个页面视图B的时候,则就是用:Segue
去实现:
两个不同的页面之间的切换,转换
在两个页面切换期间需要传递数据的话,用:prepareForSegue
页面转换一般都是某个时间触发的,比如按了按钮
你也可以通过代码方式强制转换页面:performSegueWithIdentifier

转载请注明:在路上 » 【整理】Cocoa中的Segue

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
85 queries in 0.177 seconds, using 22.01MB memory