Post

Replies

Boosts

Views

Activity

Reply to UIScene Storyboard - Main and Main_iphone
So, I've made progress on this [Xcode 16.3]. In my SceneDelegate I use: - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions API_AVAILABLE(ios(13.0)){ NSLog(@"SceneDelegate received willConnectToSession\n"); if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { NSLog(@"Main_iphone Storyboard"); UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main_iphone" bundle:nil]; UISceneConfiguration *configuration = [session configuration]; [configuration setStoryboard:storyboard]; } else { NSLog(@"Main Storyboard"); } } And I have two configurations in the plist: I also put this in the appDelegate, though it doesn't seem to get called: - (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options API_AVAILABLE(ios(13.0)){ NSLog(@"AppDelegate received configurationForConnectingSceneSession\n"); // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { NSLog(@"Main_iphone Storyboard"); return [[UISceneConfiguration alloc] initWithName:@"iPhone Configuration" sessionRole:connectingSceneSession.role]; } else { NSLog(@"Main Storyboard"); return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; } } Everything works fine, except when running the simulator for iPhone 16 Pro Max 18.2 where I get these errors: AX Safe category class 'SLHighlightDisambiguationPillViewAccessibility' was not found! Class CKBrowserSwitcherViewController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API. And no scene appears.
Jun ’25
Reply to TN3187: Migrating to the UIKit scene-based life cycle
So, the problem really came down to the fact that my projects were created a LOOOOONG time ago (2010), so they didn't have the needed plist items above. For anyone interested in supporting UIKIT scene-based life cycle, my recommendation is to generate at new project that is an "app" from the templates and copy over the SceneDelegate files into your project, copy the contents of the AppDelegate into your existing app delegate, and add the Application Scene Manifest plist item (+ sign) and edit them to match what the sample project has.
Jun ’25
Reply to Tab Bar Controller Not Using Safe Area
The attached image shows the safe area highlighted with the view "Playview". However, when I run the code in debugger, I can see that both CGRect frame1 = self.view.frame; CGRect frame = self.view.safeAreaLayoutGuide.layoutFrame; give the same frame. This is not the case with a different tab view that has subviews added programmatically as opposed to this one that has them in IB.
Topic: UI Frameworks SubTopic: UIKit
Apr ’25