【发布时间】:2021-11-26 16:04:36
【问题描述】:
我无法在 Xcode 12 上以编程方式为较旧的 iOS 版本创建应用程序。 AppDelegate.swift 中有我的代码
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Set the window bounds
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
window?.rootViewController = UINavigationController(rootViewController: ViewController())
return true
}
}
这是我的 ViewController:
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
view.backgroundColor = .white
}
}
我在互联网上寻找解决方案,但找不到。 我删除了 Main.storyboard 和 SceneDelegate.swift 文件。我删除 info.plist 文件中的键/值 main 。我将 Main.storyboard 删除到主界面中
【问题讨论】:
-
什么问题?