2016-11-21 3 views
0

Я пытаюсь реализовать метод didRotateFromInterfaceOrientation для уведомления о смене ориентации, но в iOS 10 и Xcode 8.1 он демонстрирует как метод депрессивности.IsRotateFromInterfaceOrientation устарел?

enter image description here

осуждается ли это? Если да, то какие замены?

ответ

1

Я думаю, что это устарело, и вместо этого этот метод существует.

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator 
{ 
    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) 
    { 
     UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; 
     // do whatever 
    } completion:^(id<UIViewControllerTransitionCoordinatorContext> context) 
    { 

    }]; 

    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; 
} 

 Смежные вопросы

  • Нет связанных вопросов^_^