Prechádzať zdrojové kódy

Fix deprecation warnings

Replace:
 - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
 - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation

With:
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
Bharat Mediratta 8 rokov pred
rodič
commit
df79ae7971

+ 24 - 24
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -171,32 +171,32 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return shouldAutorotate;
 }
 
-- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
-{
-    for (UIView *outlineView in [self.outlineViewsForVisibleViews allValues]) {
-        outlineView.hidden = YES;
-    }
-    self.selectedViewOverlay.hidden = YES;
-}
-
-- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
-{
-    for (UIView *view in self.viewsAtTapPoint) {
-        NSValue *key = [NSValue valueWithNonretainedObject:view];
-        UIView *outlineView = self.outlineViewsForVisibleViews[key];
-        outlineView.frame = [self frameInLocalCoordinatesForView:view];
-        if (self.currentMode == FLEXExplorerModeSelect) {
-            outlineView.hidden = NO;
-        }
-    }
-    
-    if (self.selectedView) {
-        self.selectedViewOverlay.frame = [self frameInLocalCoordinatesForView:self.selectedView];
-        self.selectedViewOverlay.hidden = NO;
-    }
+- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
+{
+    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context)
+     {
+         for (UIView *outlineView in [self.outlineViewsForVisibleViews allValues]) {
+             outlineView.hidden = YES;
+         }
+         self.selectedViewOverlay.hidden = YES;
+     } completion:^(id<UIViewControllerTransitionCoordinatorContext> context)
+     {
+         for (UIView *view in self.viewsAtTapPoint) {
+             NSValue *key = [NSValue valueWithNonretainedObject:view];
+             UIView *outlineView = self.outlineViewsForVisibleViews[key];
+             outlineView.frame = [self frameInLocalCoordinatesForView:view];
+             if (self.currentMode == FLEXExplorerModeSelect) {
+                 outlineView.hidden = NO;
+             }
+         }
+
+         if (self.selectedView) {
+             self.selectedViewOverlay.frame = [self frameInLocalCoordinatesForView:self.selectedView];
+             self.selectedViewOverlay.hidden = NO;
+         }
+     }];
 }
 
-
 #pragma mark - Setter Overrides
 
 - (void)setSelectedView:(UIView *)selectedView