Tôi đã nhận được lỗi này, khi tôi tạo dự án mới trong XCode 11. Tôi chưa sử dụng SwiftUI. Đây là các bước, tôi đã xem xét để khắc phục điều này.
- Đã xóa
Application Scene Manifestmục nhập khỏiInfo.plist
- xóa
SceneDelegate.swifttập tin
- Đã xóa tất cả các phương thức liên quan đến cảnh trong
AppDelegate.swiftlớp
- thêm
var window: UIWindow?tài sản trong AppDelegate.swiftlớp
Sau các bước này, tôi có thể chạy ứng dụng trên phiên bản trước iOS 13.
[EDIT]
Cuối cùng, AppDelegate.swifttệp của bạn sẽ trông giống như sau.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
}