Considerations for IOS 11 & iPhone x adaptation & xcode9 packaging

Time:2021-4-18

1. Fit uitableview


if#available(iOS11.0, *) {
self.contentInsetAdjustmentBehavior= .never
self.estimatedRowHeight=0
self.estimatedSectionHeaderHeight=0
self.estimatedSectionFooterHeight=0
}else{
}

2. Adapt to uiscrollview


if#available(iOS11.0, *) {
scrollView?.contentInsetAdjustmentBehavior= .never
}else{
}

3. The display of section header or footer in uitableview is abnormal

In addition, it is found that the height of section header and section footer of some interface tableview is inconsistent with the setting. If – tableview: viewforheaderinsect: and – tableview: viewforfooterinsect: are not implemented in IOS 11, then – tableview: highforheaderinsect: and – tableview: viewforfooterinsect: are not implemented Highforfooterinsection: will not be called, so they all become the default height. This is because tableview uses self sizing by default in IOS 11. The three height estimation properties of tableview, estimatedrowheight, estimatedsectionheaderheight and estimatedsectionfooterheight, have changed from the default 0 to uitableview automatic dimension. The solution is simple and crude, that is, to implement the The method or property should be set to 0.

4. The adaptation web page is not fully loaded, and there is a white edge below


if#available(iOS11.0, *) {
webView.scrollView.contentInsetAdjustmentBehavior= .never
}else{
}

5. The problem that the iPhone x can’t be fully displayed

<1> Add a 1125 * 2436 image to brand assets

open Assets.xcassets Folder, find brand assets

Right click Show in finder

Add a 1125 * 2436 image

<2> Modification Contents.json File, add the following


{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "2436h",
"filename" : "1125_2436.png”,
"minimum-system-version" : "11.0",
"orientation" : "portrait",
"scale" : "3x"
}

6, suitable for iPhone x

//Adapt to iPhone x
letLL_iPhoneX = (kScreenW == Double(375.0) && kScreenH == Double(812.0) ?true:false)
letkNavibarH = LL_iPhoneX ? Double(88.0) : Double(64.0)
letkTabbarH = LL_iPhoneX ? Double(49.0+34.0) : Double(49.0)
letkStatusbarH = LL_iPhoneX ? Double(44.0) : Double(20.0)

7, xcode9 packaging considerations

The packaged version of xcode9 can only be 8.2 and below, or 9.0 and above

Xcode9 does not support versions 8.3 and 8.4

The new package of xcode9 needs to add 1024 * 1024 appsore icon when building the version

summary

The above is the packing notes of ios11 & iPhone x Adapter & xcode9 introduced by Xiaobian. I hope it can help you. If you have any questions, please leave me a message and Xiaobian will reply you in time. Thank you very much for your support to developer!