I have a login view controller called from a Storyboard segue. When the user logs in correctly, I need to close the current ViewController, return to the caller ViewController and hide the login button.
How can I refer to the sender ViewController, to hide the button? Do I have to pass an instance of the root ViewController to the login or is there another way?
Use delegation.
For your DetaliViewControler create a protocol, like
add a delegate declaration to DetailViewController’s interface like
Make the MasterViewController conform to the protocol.
Now just before the MasterViewController displays the DetailViewController, doe something like
In the DetailViewController once the credential where entered and verified call
and dismiss the DetailViewController