I have one UIView which is not using Auto-Layout and some components are displayed based on their percent of X and Y co-ordinates from the main view.
Previously I wo
Although not asked for here Objective C version:
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator {
[coordinator animateAlongsideTransition:^(id _Nonnull context) {
// change any properties on your views
} completion:^(id _Nonnull context) {
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
if( UIDeviceOrientationIsPortrait(orientation) ) {
NSLog(@"portrait");
} else {
NSLog(@"landscape");
}
}];
}