iOS- Detect current size classes on viewDidLoad

前端 未结 5 1728
旧时难觅i
旧时难觅i 2020-12-13 02:02

I\'m working with adaptive Layout on iOS 8 and I want to get exactly what the size classes are on viewDidLoad. Any ideas about that?

5条回答
  •  一整个雨季
    2020-12-13 02:52

    So for Auto Layout you design your apps' UI per each different size class. The OS does all the work of figuring out the device being used and what size class should be used. However, if you there is a way to figure out what device is being used. I am not sure if you can decided what size class gets used as, again, this is handled dynamically by the OS.

    Code for getting device being used:

    NSString *device = [[UIDevice currentDevice]model ] ;
    NSLog(@"%@",device);
    

提交回复
热议问题