I get a Type 'Service_ValetApp' does not conform to protocol 'App' and I get a fix from the compiler: Do you want to add protocol stubs? Even though I have an init() already in the file. This looks like a bug to me. If anyone has seen this before I would appreciate any and all insights.
import SwiftUI
@main
struct Service_ValetApp: App {
@Binding var isInitializing: Bool
init(isInitializing: Binding<Bool>) {
self._isInitializing = isInitializing
}
var body: some Scene {
WindowGroup {
MotherView(isInitializing: self.$isInitializing).environmentObject(ViewRouter())
}
}
}
Type type
Appneeds to have an initializer that takes zero arguments:You have a argument in your initializer:
The system is calling
initand wouldn't know what to pass forisInitializing.Secondly, you have a
@Bindingin yourApp--@Bindingis used with child views, but this is the top-most parent app component.Perhaps you meant to use
@Statewith a default value instead: