【发布时间】:2019-12-27 03:52:13
【问题描述】:
我收到错误消息:“在预期返回 'UIViewController' 的闭包中缺少返回”,在粗体线上。我怎样才能解决这个问题?谢谢!!
Var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
let hasSession = UserDefaults.standard.value(forKey: "UserHasSubmittedPassword") as? Bool
let vc: UIViewController = {
if let hasSession = hasSession, hasSession == true {
// next vc you want to show
} else {
// enter password vc
}
**}()**
let navigationController = UINavigationController(rootViewController: vc)
window?.rootViewController = navigationController
window?.makeKeyAndVisible()
return true
}
【问题讨论】:
标签: swift xcode ios13 swift5 swift5.1