我在 SwiftUI/Combine 应用程序中使用 Firebase,并且注意到一些警告,我想对其进行故障排除。他们没有破坏事情,但我想解决它们。我使用带有最新 Swift 包依赖项的 Xcode 12.4 时收到这些警告:GoogleUtilities 7.2.2 和 Firebase 7.7.0。
这是控制台中出现的第一个警告:
[GoogleUtilities/AppDelegateSwizzler][I-SWZ001014] App Delegate does not conform to UIApplicationDelegate protocol.
Run Code Online (Sandbox Code Playgroud)
作为参考,这是我配置 Firebase 的方式:
import SwiftUI
import Firebase
@main
struct MyApp: App {
@StateObject var authState = AuthState()
init() {
FirebaseApp.configure()
}
var body: some Scene {
WindowGroup {
RootView()
.environmentObject(authState)
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是第二个警告,在我使用修饰符设置导航栏标题后出现.navigationBarTitle。
[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't …Run Code Online (Sandbox Code Playgroud)