Swift Access AppDelegate do ViewController
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let aVariable = appDelegate.someVariable
Clumsy Cod
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let aVariable = appDelegate.someVariable
func appDelegate() -> AppDelegate {
return UIApplication.shared.delegate as! AppDelegate
}