问题描述
假设我有一个带有textField和按钮的ViewController。
我想使用展开segue,这样我就可以将textField的信息传递给我的其他人单击按钮后的viewController。
我想使用PrepareForSegue方法,这样我就可以在imunwiding之前将textField中的文本保存到属性中。 / p>
如何手动为我的segue设置一个标识符?如果它是一个条形按钮项目我可以使用IB设置标识符(例如保存)和然后使用它。不是这种情况,只是常规按钮。
无法以编程方式创建segues。没有故事板就不能存在。
请参阅。
Lets say i have a ViewController with a textField and a button.
I want to use an unwind segue so i could get the information of the textField to my other viewController after i clicked the button.
I want to use the PrepareForSegue method so i could save the text from the textField in a property before i"m "unwiding".
How do i set an identifier to my segue manually? If it was a bar Button item i could use the IB to set the identifier ( to "Save" for example) and then use it. This is not the case, just a regular button.
It is not possible to create segues programmatically. They cannot exist without storyboards.
See this question.
这篇关于以编程方式设置segue标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!