let alertController = UIAlertController(title: "Language".localized(), message: "To changing language you need to restart application, do you want to restart?".localized(), preferredStyle: .alert)
let okAction = UIAlertAction(title: "Yes".localized(), style: UIAlertActionStyle.default) {
UIAlertAction in
NSLog("OK Pressed")
exit(0)
}
let cancelAction = UIAlertAction(title: "Restart later".localized(), style: UIAlertActionStyle.cancel) {
UIAlertAction in
NSLog("Cancel Pressed")
}
alertController.addAction(okAction)
alertController.addAction(cancelAction)
self.present(alertController, animated: true, completion: nil)
После закрытия приложения пользователь вручную запустит приложение.
У меня есть проблемы. После изменения языка я хочу перезапустить свое приложение. Решение: < /p> [code]let alertController = UIAlertController(title: "Language".localized(), message: "To changing language you need to restart application, do you want to restart?".localized(), preferredStyle: .alert) let okAction = UIAlertAction(title: "Yes".localized(), style: UIAlertActionStyle.default) { UIAlertAction in NSLog("OK Pressed") exit(0) }
let cancelAction = UIAlertAction(title: "Restart later".localized(), style: UIAlertActionStyle.cancel) { UIAlertAction in NSLog("Cancel Pressed") }