import UIKit func openAppSettings() { if let appSettingsUrl = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(appSettingsUrl) { UIApplication.shared.open(appSettingsUrl, completionHandler: nil) } }