Post

Replies

Boosts

Views

Activity

Reply to How to use protocols to support managing SwiftUI views from different modules ?
appreciate your response @BabyJ , unfortunately I cannot do that since here is how I setup my app: struct LaunchApp: App { @State private var appModel = AppModel() var body: some Scene { WindowGroup { appModel.viewProvider.layoutUI() } } } and in my AppModel, the view provider is a property that can be changed based on what module user is currently on. If I make the ViewProvider generic as you suggested, then I have to specify those requirements in my app model layer which is not possible afaik. @Observable @MainActor final class AppModel { var viewProvider: ViewProvider init() { let defaultProvider = SplashScreenProvider() self.viewProvider = ViewProvider(provider: defaultProvider, completion: {}) setupFlowCoordinator() } func setupFlowCoordinator() { flowCoordinator = FlowCoordinator(registry: appCoordinator.registry, configuration: config) { provider in self.viewProvider = provider } } during the app session, the setupFlowCoordinator method will be updating the view provider depending on what we want to show to the user, it could be onboarding/ new feature flows etc.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’25
Reply to Unable to use swift package module in safari extension target in Xcode.
It seems my extension target CONFIG_BUILD_DIR is set to build, and when I change it to $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME), I'm able to build successfully.
Replies
Boosts
Views
Activity
Mar ’23
Reply to Does CLMonitor work in simulator?
I noticed the same issue on both simulator and device.
Replies
Boosts
Views
Activity
Jan ’24
Reply to How to use protocols to support managing SwiftUI views from different modules ?
appreciate your response @BabyJ , unfortunately I cannot do that since here is how I setup my app: struct LaunchApp: App { @State private var appModel = AppModel() var body: some Scene { WindowGroup { appModel.viewProvider.layoutUI() } } } and in my AppModel, the view provider is a property that can be changed based on what module user is currently on. If I make the ViewProvider generic as you suggested, then I have to specify those requirements in my app model layer which is not possible afaik. @Observable @MainActor final class AppModel { var viewProvider: ViewProvider init() { let defaultProvider = SplashScreenProvider() self.viewProvider = ViewProvider(provider: defaultProvider, completion: {}) setupFlowCoordinator() } func setupFlowCoordinator() { flowCoordinator = FlowCoordinator(registry: appCoordinator.registry, configuration: config) { provider in self.viewProvider = provider } } during the app session, the setupFlowCoordinator method will be updating the view provider depending on what we want to show to the user, it could be onboarding/ new feature flows etc.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’25