Hi
View Controller in Stoyroard has a First Responder & Exit sort of buttons or controls at the top, whats there used for ? and is there any examples for this usage or scenarios ?
--
Kindest Regards
Hi
View Controller in Stoyroard has a First Responder & Exit sort of buttons or controls at the top, whats there used for ? and is there any examples for this usage or scenarios ?
--
Kindest Regards
Exit button is notably used when you exit with an unwind segue:
- you segued from A -> B
- in A, you implement an unwindSegue func:
@IBAction func unwindToStartViewController(_ sender: UIStoryboardSegue) {
// Code when you return or just nothing
}
Then, for the button that must return from B -> A: just ctrl-drag from button to exit icon and select the appropriate unwind func (here unwindToStartViewController).
For FirstResponder, it is rarely used.
Look here for details (old but has not changed since)
Thanks allot so the function should start with Unwind word ? and the First Responder we can also drag for it I think ?
function should start with Unwind word
No, the func may be any name
@IBAction func myFunc(_ sender: UIStoryboardSegue) {
// Code when you return or just nothing
}
I just find it convenient to name it with unwind.
and the First Responder we can also drag for it I think ?
Yes and select a func as well.
A better link to tutorial is this one (there are many wron statements in SO refernce I sent before):
h ttps://www.raywenderlich.com/2624-storyboards-tutorial-in-ios-7-part-1