UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController(UIAlertView 对于基于 UIScene 的应用程序已弃用且不可用,请使用 UIAlertController)
问题描述
I'm new to Swift and I'm getting this Error.
I don't get it because I don't use any type of alert in my code.
Here is my ViewController:
import UIKit
import WebKit
class ViewController: UIViewController{
@IBOutlet weak var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: "https://www.google.com/maps")!
webView.load(URLRequest(url: url))
}
}
I only want to use WKWebView in my app and use the location.
I already added NSLocationAlwaysAndWhenInUseUsageDescription
to the info.plist
You can reproduce this error if you using iOS 13, Xcode and this example and any website which uses the location like google maps.
I was also going through the same issue, i'm able to solve it getting help from a developer, scene base application that is new yet not support ui alert view so it crashes the app, we can remove the scene base application we can use window base app, follow these steps to resolve the issue:
First remove the SceneDelegate file check this image for first step Second remove UISceneSession Lifecycle two methods from AppDelegate file check this image for second step Third go to your info plist and remove Application Scene Manifest Entry from it check this image for third step Go ahead and build the project, run it now, make sure you have window property in AppDelegate
这篇关于UIAlertView 对于基于 UIScene 的应用程序已弃用且不可用,请使用 UIAlertController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:UIAlertView 对于基于 UIScene 的应用程序已弃用且不可用,请使用 UIAlertController


- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01