31st article, IOS 9 version adaptation

Source: Internet
Author: User

1. Network adaptation (forced fallback HTTP)

  To enforce enhanced data access security, IOS9 will change all HTTP requests from Nsurlconnection, Cfurl, nsurlsession to HTTPS requests by default: Ios9.x-sdk compile, by default, all the N HTTP requests made by Surlconnection, Cfurl, nsurlsession are unified with the TLS 1.2 protocol. Because Afnetworking now has a nsurlconnection version, many apps will be affected (IOS8.X-SDK based apps won't be affected). The server therefore needs to be updated to parse the relevant data. If not updated, you can reverse the unsecured network request by declaring it in Info.plist. The official document, called ATS, is all called App Transport Security and is a new feature of IOS9.

2. Background positioning

 //1. Instantiating the location Manager_locationmanager =[[Cllocationmanager alloc] init];//2. Setting up the agent_locationmanager.Delegate=Self ;//3. Positioning accuracy[_locationmanager setdesiredaccuracy:kcllocationaccuracybest];//4. Request User rights: Divided into: ① only in the foreground to open the positioning ② in the background can also be located,//Note: It is recommended to request only one of the ① and ②, if two permissions are required, just request?//①② This order, will cause a bug: After the first start of the program, the system will only request ① permissions, ② permission system will not request, only the next time the application is requested?if([[[[Uidevice Currentdevice] systemversion] Floatvalue] >=8) {    //[_locationmanager requestwheninuseauthorization];//? Only open the location at the front desk[_locationmanager requestalwaysauthorization];//? can also be located in the background}//5.ios9 New Features: This scenario will be allowed: multiple location managers in the same app: some can only be located in the foreground, others can be located in the background (and can be disabled at any time in the background location). if([[[[Uidevice Currentdevice] systemversion] Floatvalue] >=9) {_locationmanager.allowsbackgroundlocationupdates=YES;}//6. Update the user location[_locationmanager startupdatinglocation];

3. Enterprise-level distribution (if the certificate is not trusted, the app is not available, note: The bundle ID on the server is set to the same as in the project, otherwise it cannot be downloaded)

4. Add a white list of trusts (no trust is available for third party sharing)

5. Font gap becomes larger UI exception (displayed completely in iOS8, when one to iOS9 is not fully displayed)

Cgsize size = [title sizewithattributes:@{nsfontattributename: [Uifont systemfontofsize:14.0f= Cgsizemake (Ceilf (size.width), Ceilf (Size.Height));

31st article, IOS 9 version adaptation

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.