No matter if modals are presented or the user performs any type of segue.
Is there a way to keep the button \"always on top\" (not the top of the screen) throughout
Present it on this:
public static var topMostVC: UIViewController? {
var presentedVC = UIApplication.sharedApplication().keyWindow?.rootViewController
while let pVC = presentedVC?.presentedViewController {
presentedVC = pVC
}
if presentedVC == nil {
print("EZSwiftExtensions Error: You don't have any views set. You may be calling them in viewDidLoad. Try viewDidAppear instead.")
}
return presentedVC
}
topMostVC?.presentViewController(myAlertController, animated: true, completion: nil)
//or
let myView = UIView()
topMostVC?.view?.addSubview(myView)
These are included as a standard function in a project of mine: https://github.com/goktugyil/EZSwiftExtensions