1. There are black areas on iPhone X

Solution:

Use the LaunchScreen as the entry page or modify the LaunchImage in Assets and add the Launch image 1125*2436 for iPhoneX (portrait). Note that the image must have the required pixels

2. NavigationBar adaptation

The height of the NavigationBar in iOS11 is 64, and the height of the statusBar is 20, while the height of the statusBar in iPhoneX is 44. If the NavigationBar is customized, this part needs to be adapted accordingly.

The current idea is to write an Util class that provides methods to get the height of the navigation bar

eg:

@implementation TestUtil + (CGFloat)navigationBarHeight {if (IS_iPhoneX) {return 88.0f; 64.0 f} return; } @end #define IS_iPhoneX ([UIScreen mainScreen].bounds.size.width == 375 && [UIScreen mainScreen].bounds.size.height == 812).Copy the code

3. The tabBar adaptation

The virtual Homeq area is added at the bottom of iPhoneX. Due to the security area, the height of the default tabBar is increased by 34 from 49 to 83, so the customized tabBar at the bottom also needs to change its adaptation scheme.

4.iOS11 API

SafeArea, contentInsetAdjustmentBehavior, adjustedContentInset

For the understanding of such concepts, please refer to the following in-depth good article

Mp.weixin.qq.com/s/W1_0VrchC…

// Determine the system version, system API (this is Xcode alarm detected by fix??) If (@available(iOS 11.0, *)) {} else {// Fallback on earlier versions}Copy the code

5. Add a framework

Two big new frameworks added to the SDK are Core ML, which simplifies and integrates machine learning, and ARKit, which creates augmented reality (AR) applications.

PrefersLargeTitles (BOOL)

The effect is as follows:

7. New features in Xcode 9

A. Debugging can be done without USB connection

B. The simulator can be opened more often