1. 获取Appdelegate
let myAppdelegate = UIApplication.shared.delegate as! AppDelegate
2. 获取Appdelegate的属性
if myAppdelegate.xx != nil
{
xx = myAppdelegate.xx
}
let myAppdelegate = UIApplication.shared.delegate as! AppDelegate
if myAppdelegate.xx != nil
{
xx = myAppdelegate.xx
}