I am declaring AppDelegate instance for calling method reside in AppDelegate but it is giving me error as 'AppDelegate' is only available on iOS 10.0 or newer , but I want to use AppDelegate instance in iOS 9 also. If I will change my deployment target as iOS 10 then the code is working fine for me but I can not able to run project with deployment target 9.0. I am using Xcode 10.1 and Swift 4.2 in my Xcode project.
Please check my below code and let me know if I am doing something wrong .
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.ShowErrorPopUpWithErrorCode(strError:"This is test error message")
Appreciated your help.
Thanks.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.