(1) Use size Classes in storyboard.
We have used AutoLayout before, and now we have a size Classes, which can be seen as AutoLayout settings under different size Classes.
Detailed tutorials, http://www.cocoachina.com/ios/20141020/9978.html
--Seemingly, storyboard's functions are becoming more powerful. The adaptation of different sizes and screens is enough to make it a pain to hit the code.
--Find a lot of blog posts, found that almost all talk about how to use size classes in storyboard, almost no code to achieve size classes.
Reference from Joywii ' s Blog:ios8 Size classes Understanding and use
-(void) Willtransitiontotraitcollection: (uitraitcollection *) newcollection withtransitioncoordinator: (ID < uiviewcontrollertransitioncoordinator>) coordinator{ [Super Willtransitiontotraitcollection:newcollection Withtransitioncoordinator:coordinator]; [Coordinator animatealongsidetransition:^ (ID <UIViewControllerTransitionCoordinatorContext> context) { if (Newcollection.verticalsizeclass = = uiuserinterfacesizeclasscompact) { //to do:modify something for Compact vertical Size } else { //to do:modify something for other vertical size } [Self.view setneedslay Out]; } Completion:nil];}
in two to do, we want the handwritten code to be adjusted for different states.
iOS Dev-120 How to use size Classes in storyboard is actually setting up multiple sets of AutoLayout