Answer the question
In order to leave comments, you need to log in
How to change UIViewController inside modal window?
Good afternoon. I'm making an application with a login page using Swift 4 and Xcode 10. On the main page of the application, I have 2 buttons: login and register. On clicking any of them, I present the modal with
navigationController?.present(LoginScreen(), animated: false)
. On the LoginScreen() page, I have a login form and a button. If the login is successful, then I donavigationController?.pushViewController(MainScreen(), animated: false)
but already from the modal window. pushViewController
for some reason it does not work from a modal window , although if you call it from a page with buttons, then everything works fine. The login page just stays there.
Answer the question
In order to leave comments, you need to log in
Because normally it should look like this:
Button1
---> present [LogInVC]
------> present [NavigationController]
---------> push [UserFeedVC]
Button2
---> present [SignInVC]
------>present [NavigationController]
--------->push [UserFeedVC]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question