오리엔테이션 변경을 알리기 위해 didRotateFromInterfaceOrientation 메소드를 구현하려하지만, iOS 10 및 Xcode 8.1에서는 deprecate 메소드와 같이 표시됩니다. didRotateFromInterfaceOrientation은 더 이상 사용되지 않습니까?
은 더 이상 사용되지 않습니다? 그렇다면 대체 무엇입니까?
0
A
답변
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];
}
1
예, iOS 8부터 사용되지 않습니다. 대신 viewWillTransitionToSize:withTransitionCoordinator:
을 사용해야합니다.