FWIW it would be more usual to use a login view controller, and then you can use UIViewController.present(_:animated:completion:). This also has the advantage of adapting better to use on iPad - what was a fullscreen modal on phone can automatically become a form modal on iPad.

//