Skip to content

Latest commit

 

History

History

AutoLayout_Adaptivity

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

AutoLayout Adaptivity

Device Size Classes 및 Orientation 에 따른 AutoLayout Adaptivity 테스트 샘플

  • Size classes (compact, regular)에 따른 AutoLayout Adaptivity : Swift Sample
  • Orientation (Portrait, Landscape)에 따른 AutoLayout Adaptivity : Objective-C Sample

Preview

  • Swift Sample

    • Interface Builder based
  • Objective-C Sample

    • Programmatically based
Swift Objective-C

Documentation

  • Objective-C Sample : Programmatically
- (void)viewDidLoad {
    [super viewDidLoad];
    [self configureTableView];
    [self configureDataSource];
    [self updateUI];
    __weak __typeof(self) weakSelf = self;
    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
    self.observer = [notificationCenter addObserverForName:UIDeviceOrientationDidChangeNotification
                                                    object:nil
                                                     queue:[NSOperationQueue mainQueue]
                                                usingBlock:^(NSNotification *note) {
        if (weakSelf.presentedViewController == nil &&
            UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) == YES) {
            ViewControllerX *vc = [ViewControllerX new];
            vc.modalPresentationStyle = UIModalPresentationFullScreen;
            vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
            [weakSelf presentViewController:vc animated:YES completion:^{}];
        }
    }];
}

Bug

System Bug

  • iOS 16 이상의 Simulator부터는 WKWebView 이용 시 다음과 경고 로그가 발생한다.
[Security] This method should not be called on the main thread as it may lead to UI unresponsiveness.

Author

sonkoni(손관현), isomorphic111@gmail.com

License

This project is released under the MIT License. See LICENSE for more information.