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

Add GUI shortcut for initializeWebKitLegacy

We call initializeWebKitLegacy automatically before you search all bundles just to be safe (since touching some classes before WebKit is initialized will initialize it on a thread other than the main thread), but sometimes you can encounter this crash without searching through all bundles, of course.

In this case, you can now long press on the navigation bar to call initializeWebKitLegacy
Tanner Bennett лет назад: 5
Родитель
Сommit
ee6677ee08

+ 15 - 0
Classes/GlobalStateExplorers/RuntimeBrowser/FLEXObjcRuntimeViewController.m

@@ -13,6 +13,7 @@
 #import "FLEXTableView.h"
 #import "FLEXObjectExplorerFactory.h"
 #import "FLEXAlert.h"
+#import "FLEXRuntimeClient.h"
 
 @interface FLEXObjcRuntimeViewController () <FLEXKeyPathSearchControllerDelegate>
 
@@ -28,6 +29,20 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
+    // Long press on navigation bar to initialize webkit legacy
+    //
+    // We call initializeWebKitLegacy automatically before you search
+    // all bundles just to be safe (since touching some classes before
+    // WebKit is initialized will initialize it on a thread other than
+    // the main thread), but sometimes you can encounter this crash
+    // without searching through all bundles, of course.
+    [self.navigationController.navigationBar addGestureRecognizer:[
+        [UILongPressGestureRecognizer alloc]
+            initWithTarget:[FLEXRuntimeClient class]
+            action:@selector(initializeWebKitLegacy)
+        ]
+    ];
+    
     // Search bar stuff, must be first because this creates self.searchController
     self.showsSearchBar = YES;
     self.showSearchBarInitially = YES;