iOS Classic Tutorials for iOS 11-Continuous updates ...

Source: Internet
Author: User

Author: Lin Nuo Lin

Reprint please indicate the source: http://blog.csdn.net/loving_ios/article/details/78573630

1, access to album permissions Nsphotolibraryaddusagedescription

Some articles mention that iOS 11 changed the Nsphotolibraryusagedescription access to albums to Nsphotolibraryaddusagedescription. Not really. The official API explains that iOS 10 new Access album permissions are infoplist files need to be added nsphotolibraryusagedescription, but in iOS 11 the system default access to album permissions is open, It's fine not to add nsphotolibraryaddusagedescription, but if you store the picture, it's crash, so iOS The 11 new nsphotolibraryaddusagedescription is only added when you store photos.

2, Access location permissions Nslocationalwaysandwheninuseusagedescription

The following version of iOS 11 access location permissions need to be added nslocationalwaysusagedescription (always allowed), nslocationwheninuseusagedescription (when used) but in iOS 11 will find inaccessible location, in fact, iOS 11 new nslocationalwaysandwheninuseusagedescription, And before the nslocationalwaysusagedescription down to nslocationwheninuseusagedescription, so adapt to iOS 11 need to add new key Nslocationalwaysandwheninuseusagedescription, but do not delete before, in order to fit the iOS 11 version below.

3. XCODE9 Console Print Thread warning

Xcode9,ios 11 Run Program console print a bunch of similar to main thread Checker:ui API called on a background thread:-[uiapplication statusbarorientation Thread warning because the code that was supposed to be executing on the main thread was placed in a child thread.

WORKAROUND: Turn off main thread monitoring in scheme (not advocated)


The best way to print a problem is to put the offending code inside the main thread, for example, I found that the SHARESDK inside the project has a status bar set on the child thread. See that the latest SDK is adapted to iOS 11, so the upgrade sharesdk has resolved the problem, and the other code is modified according to the warning.

4, initialization Uibarbuttonitem and iOS11 the following version of the difference

With Initwithcustomview: Initializing Barbuttonitem in iOS 11 can be initialized directly with a control that does not specify a frame, the display is OK, and in the following version you need to specify a frame such as Uilabel can use SizeToFit, When adding titleview, the same principle that IOS 11 can be displayed without specifying the size. And in less than iOS 11 system is not displayed (of course, the size of the iOS 11 is not a problem, so the adaptation version is best code perfect, suitable for various situations). This is related to the iOS 11 modified Navigationbar layer.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.