If a user installs up an application in a device lower than iPhone 8 and iOS version lower than iOS 11, a UI Alert pop" the minimum requirements to use the app is iOS 11 and iPhone 8 or above", and there is an ok button. I want to tell the user that is their device is not supported. Here is what I have in the code.
Note: I did set the deployment target to iOS11 but how can I set it for device iPhone8
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let alertController = UIAlertController(title: "Foo", message: "Bar", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
// check
if #available(iOS 11.0,*)
{
}
else
{
present(alertController, animated: true, completion: nil)
}
}
}