IOS9 application adaptation, technical get

Source: Internet
Author: User

IOS9 just released soon, the app will appear in the new system of the situation, the app iOS9 adaptation made some changes, so that the user experience is better. I hereby summarize and share. Mainly from the following points to do the matching.

    • 1.IOS9 Network adaptation ats-http VS HTTPS
    • 2.Bitcode
    • 3.ios9 URL Scheme Adaptation _ Whitelist concept introduced
    • 4. The font gap becomes larger and causes the UI to display abnormally
    • 5. Location
    • 6. Status bar
    • 7. Contact Frame--contacts VS addressbook

IOS9 Network adaptation-http VS HTTPS

    • Ats--app Transport Security
    • To enforce enhanced data access security, iOS9 defaults to all HTTP requests from Nsurlconnection, Cfurl, nsurlsession to HTTPS requests in order to enforce enhanced data access security, the iOS9 defaults to All HTTP requests from Nsurlconnection, Cfurl, nsurlsession and all HTTP requests are changed to HTTPS requests
    • Solution 1: Immediately let the company's server upgrade use TLS 1.2 to resolve the relevant data
    • Solution 2: Although Apple does not recommend it, it can still allow the app to access the specified HTTP, or even arbitrary HTTP, by declaring in Info.plist that the Web request back to unsecured

Bitcode

    • The future Watch app must contain bitcode,ios not mandatory, but Xcode7 will turn on Bitcode by default.
    • Bitcode is an intermediate form of code that is compiled by a program. Programs that contain Bitcode configuration will be compiled and linked on the App store. Bitcode allows Apple to re-optimize the binary files of the program at a later stage without having to resubmit a new version to the App Store. When the program is submitted to the App Store, Xcode compiles the program into an intermediate representation (Bitcode). The App Store then compiles the bitcode into an executable 64-bit or 32-bit program.

IOS9 URL Scheme Adaptation _ Whitelist concept introduced

           

A larger font gap causes a UI display exception

    • IOS8, the font is Helvetica, the Chinese font is a bit similar to "Chinese fine black". It's just that the iphone comes with its own rendering, so it may look more beautiful than ordinary Chinese. In IOS9, the Chinese system font has become a Chinese-designed "apple" is a bit like a word font "young circle". The font has a slight bold effect, and the most important thing is that the font gap gets bigger!
    • Solution: Use SizeToFit or iOS to take the whole CEILF () or Calculate in advance
    • Cgsize size = [title sizewithattributes:@{nsfontattributename: [Uifont systemfontofsize:14.0f]}];
    • Cgsize adjustedsize = Cgsizemake (Ceilf (size.width), Ceilf (Size.Height));

Location

    • For iOS9, 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 turned on or off at any time in the background of a particular location manager.
    • _locationmanager = [[Cllocationmanager alloc] init];
    • _locationmanager.allowsbackgroundlocationupdates = YES;

Status bar

    • Xcode upgrade, the old status bar style settings will cause warning settings, the app's status bar style, using the old way, in the Info.plist View controller-based status bar appearance default will be YES , even if not set is YES, but generally iOS6 in order to set the status bar style, it needs to be set to no,ios7,8 is also compatible, but the iOS9 will report a warning.
    • [[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent];
    • Solution: Replace the original OLDAPI with the following methods in Rootviewcontroller and classes in the custom base class Navi Gationcontroller. For special interface to do separate processing;
    • -(Uistatusbarstyle) Preferredstatusbarstyle
    • {return uistatusbarstylelightcontent;}

Contact Frame--contacts VS addressbook

In IOS 9, Apple introduced the new Contacts framework. Allows users to interact with the Objective-c API and the device's address book, as well as for the Swift language. This is a huge improvement over the previous reading of contact information through the AddressBook framework.

Advantages: Faster data acquisition, higher efficiency, and convenient invocation;

IOS9 application adaptation, technical get

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.