diff --git a/Examples/AdvancedEffects/ios/AdvancedEffects/Info.plist b/Examples/AdvancedEffects/ios/AdvancedEffects/Info.plist index cddf0766c98062f1dd64392a23039b111ccaaf59..ceb55dcb24d6c3fe5e458066551cd660039ad013 100644 --- a/Examples/AdvancedEffects/ios/AdvancedEffects/Info.plist +++ b/Examples/AdvancedEffects/ios/AdvancedEffects/Info.plist @@ -22,6 +22,13 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + NSLocationWhenInUseUsageDescription + UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities @@ -31,18 +38,8 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance - NSLocationWhenInUseUsageDescription - - NSAppTransportSecurity - - - NSAllowsArbitraryLoads - - diff --git a/ios/GLCanvas.m b/ios/GLCanvas.m index f3446bd77a37063fa1fed27317f57252a0341afe..a082c393c8326127e47a00ac45499126153da17d 100644 --- a/ios/GLCanvas.m +++ b/ios/GLCanvas.m @@ -284,6 +284,7 @@ RCT_NOT_IMPLEMENTED(-init) - (void)syncContentData { + RCT_PROFILE_BEGIN_EVENT(0, @"GLCanvas syncContentData", nil); NSMutableArray *contentData = [[NSMutableArray alloc] init]; int nb = [_nbContentTextures intValue]; for (int i = 0; i < nb; i++) { @@ -300,6 +301,9 @@ RCT_NOT_IMPLEMENTED(-init) contentData[i] = imgData; } _contentData = contentData; + _deferredRendering = true; + [self setNeedsDisplay]; + RCT_PROFILE_END_EVENT(0, @"gl", nil); } @@ -346,12 +350,7 @@ RCT_NOT_IMPLEMENTED(-init) BOOL needsDeferredRendering = _nbContentTextures > 0 && !_autoRedraw; if (needsDeferredRendering && !_deferredRendering) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (!weakSelf) return; - _deferredRendering = true; - [self syncContentData]; - [weakSelf setNeedsDisplay]; - }); + [self performSelectorOnMainThread:@selector(syncContentData) withObject:nil waitUntilDone:NO]; } else { RCT_PROFILE_BEGIN_EVENT(0, @"GLCanvas render", nil);