Post

Replies

Boosts

Views

Activity

SwiftUI views do not respond in UIKit UIViewController
I have a Storyboard lifecycle application which has a UIViewController as window root view controller. When I am trying to add the UIHostingController(SwiftUI view wrapped inside) to this root view controller as child view controller, the buttons and text fields in swiftUI view do not respond. But when I am adding this UIHostingController as window root view controller or Navigation view controller's top view controller, then the swiftUI views respond in this case. Please help me if I am missing anything Below is the code that is used for adding the UIHostingController as child view controller which doesn't work [self addChildViewController:hostingController]; [self.view addSubview:hostingController.view]; [hostingController didMoveToParentViewController:self]; This is the code that works (in delegate) [window setRootViewController:hostingController]; OR this code UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:hostingController]; [window setRootViewController:navController];
2
0
4.8k
Dec ’20
WidgetKit doesnt show placeholder view anymore
My app is an authenticated application. So I only show widget views only when user logs in. In earlier beta versions of Xcode, prior to Xcode 12 GA, on passing nil timeline entires with reload policy of never, the system used to show placeholder view. But now I don’t see that. When we are passing nil entires in timeline method the widget view is completely black. Need help to show placeholder view until the app is authenticated. Any answer from anyone would be very helpful. Currently using Xcode 12.1
0
0
545
Nov ’20
WidgetKit development issue with Xcode 12 beta 4 using Intents
I am having issues developing and validating for WidgetKit. I am trying to validate for IntentConfiguration and when I try to create a new custom Intent in the already Xcode generated intentdefinition's file, the class generation is failing behind the scenes I guess. CustomIntent.swift file, when I am using this dependency, Xcode build is not able to find this class. MyCustomIntent.swift class file is not getting generated and I am not able to create my own intents, leading to modifying the existing ConfigurationIntent.swift by creating a new project and thereby using generated intentdefinitions file for development. Also when developing for Dynamic Intents, we cannot proceed further as, even though I am able to modify the Xcode generated new project Intentdefinition file, but when I make this Intent type to use dynamic types, there is another issue with code generation. Dynamic types Intent variables protocol methods code is not getting generated in the DynamicIntent swift class file, due to which there is zero scope to proceed in this direction. Overall, Static configuration can help developers for a mere UI check majorly. Most of the work all depends on background fetch using dynamic type. Please help on at least the code generation part for dynamic type protocol methods : provide<Type>CollectionForDynamicConfiguration in the intent handlers protocols.
2
0
2.1k
Aug ’20