changeset 2599:32728f6f7ccd

iOS: Add UINavigationBar and DWView to the rootViewController's view. Instead of adding them directly to the DWWindow, so we don't need to hide the UITransitionView, so remove that code as well.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 10 Jul 2021 23:57:25 +0000
parents 4a5364fe65b7
children 0bb974e70435
files ios/dw.m
diffstat 1 files changed, 9 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ios/dw.m	Mon May 31 21:59:09 2021 +0000
+++ b/ios/dw.m	Sat Jul 10 23:57:25 2021 +0000
@@ -1362,7 +1362,7 @@
 -(void)viewWillLayoutSubviews
 {
     DWWindow *window = (DWWindow *)[[self view] window];
-    NSArray *array = [window subviews];
+    NSArray *array = [[self view] subviews];
     CGRect frame = [window frame];
     DWView *view = nil;
     UINavigationBar *nav = nil;
@@ -1374,12 +1374,6 @@
             view = obj;
         else if([obj isMemberOfClass:[UINavigationBar class]])
             nav = obj;
-        /* Hide the UITransitionView which is blocking the screen...
-         * This is probably not the correct solution, but it solves the
-         * problem for the moment.  Figure out what to do with this view.
-         */
-        else
-            [obj setHidden:YES];
     }
     /* Adjust the frame to account for the status bar and navigation bar if it exists */
     if(nav)
@@ -3791,7 +3785,7 @@
     if([object isKindOfClass:[UIWindow class]])
     {
         UIWindow *window = box;
-        NSArray *subviews = [window subviews];
+        NSArray *subviews = [[[window rootViewController] view] subviews];
         view = [subviews firstObject];
     }
     else if([object isMemberOfClass:[DWScrollBox class]])
@@ -7967,10 +7961,13 @@
     DWView *view = [[DWView alloc] init];
     UIUserInterfaceStyle style = [[DWObj hiddenWindow] overrideUserInterfaceStyle];
 
+    /* Copy the overrideUserInterfaceStyle property from the hiddenWindow */
+    if(style != UIUserInterfaceStyleUnspecified)
+        [window setOverrideUserInterfaceStyle:style];
     [window setWindowLevel:UIWindowLevelNormal];
     [window setRootViewController:[[DWViewController alloc] init]];
-    [window addSubview:view];
     [window setBackgroundColor:[UIColor systemBackgroundColor]];
+    [[[window rootViewController] view] addSubview:view];
 
     /* Handle style flags... There is no visible frame...
      * On iOS 13 and higher if a titlebar is requested create a navigation bar.
@@ -7985,12 +7982,9 @@
             UINavigationItem* navItem = [[UINavigationItem alloc] initWithTitle:nstitle];
 
             [navbar setItems:@[navItem]];
-            [window addSubview:navbar];
-        }
-    }
-    /* Copy the overrideUserInterfaceStyle property from the hiddenWindow */
-    if(style != UIUserInterfaceStyleUnspecified)
-        [window setOverrideUserInterfaceStyle:style];
+            [[[window rootViewController] view] addSubview:navbar];
+        }
+    }
     DW_FUNCTION_RETURN_THIS(window);
 }