Просмотр исходного кода

Fix #359

Custom UIMenu callouts were not not appearing because the UITextEffectsWindow has a lower level than the FLEX window by default. Until a text field is activated, it would sit below the FLEX window, and custom callouts (copy, copy address) would not appear.
Tanner Bennett лет назад: 6
Родитель
Сommit
228de102e7
1 измененных файлов с 10 добавлено и 3 удалено
  1. 10 3
      Classes/ExplorerInterface/FLEXExplorerViewController.m

+ 10 - 3
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -785,11 +785,18 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 - (void)makeKeyAndPresentViewController:(UIViewController *)viewController animated:(BOOL)animated completion:(void (^)(void))completion
 - (void)makeKeyAndPresentViewController:(UIViewController *)viewController animated:(BOOL)animated completion:(void (^)(void))completion
 {
 {
     // Save the current key window so we can restore it following dismissal.
     // Save the current key window so we can restore it following dismissal.
-    self.previousKeyWindow = [UIApplication.sharedApplication keyWindow];
-    
+    self.previousKeyWindow = UIApplication.sharedApplication.keyWindow;
+
     // Make our window key to correctly handle input.
     // Make our window key to correctly handle input.
     [self.view.window makeKeyWindow];
     [self.view.window makeKeyWindow];
-    
+
+    // Fix for iOS 13, regarding custom UIMenu callouts not appearing because
+    // the UITextEffectsWindow has a lower level than the FLEX window by default
+    // until a text field is activated, bringing it above the FLEX window.
+    if (@available(iOS 13, *)) {
+        UIApplication.sharedApplication.windows[1].windowLevel = self.view.window.windowLevel + 1;
+    }
+
     // Move the status bar on top of FLEX so we can get scroll to top behavior for taps.
     // Move the status bar on top of FLEX so we can get scroll to top behavior for taps.
     [[self statusWindow] setWindowLevel:self.view.window.windowLevel + 1.0];
     [[self statusWindow] setWindowLevel:self.view.window.windowLevel + 1.0];