iOS development adaptation iOS10 and Xcode8-b

Source: Internet
Author: User

Now on Apple's official website, we can already download to Xcode8 's GM version, plus 9.14 early morning, Apple will formally launch IOS10 system push, on this occasion, iOS10 adaptation is imminent, do not know Xcode8 beat version, Children's shoes have wood to download come and try it? As far as my use is concerned, the overall impression is that Apple is still in the pit, but it has been improving. Let me just say that the iOS10 and the Xcode8 use some points of attention.

First, certificate management

After opening the project with Xcode8, it is obvious that this is a new feature of Apple that can help us manage certificates automatically. We recommend that you check this automatically manage signing(Ps.) but in the BEAT2 version I use, completely can not, GM version unexpectedly fantastic and good. )


qq20160913-8.png-96.9kb

Let me tell you about the problems that may arise:

1.Xcode without a developer account set


qq20160913-0.png-38.5kb


The solution is: everyone in the Xcode preferences, add an Apple account, you can.

2. The device machine is not added to the developer's device.


qq20160913-2.png-33.7kb


The solution is: everyone in the official website to add the device into the development machine, accompany the description file to re-next description file.

3. Normal situation: Xcode Configure the image after login to the developer account, wait patiently.


qq20160913-1.png-25.1kb


Diagram after waiting for completion


QQ20160913-3.PNG-27KB Ii. notes on xib documents

After you use Xcode8 to open the Xib file, a prompt appears.


qq20160913-9.png-41.7kb


You can choose Choose Device.
Then everyone will find the layout ah, frame chaos, only need to update frame. Such as


qq20160913-11.png-113.2kb
    • Note: If you follow the above steps and open xib with Xcode7, the error will be reported.

qq20160913-12.png-32.3kb
    • Workaround: Need to delete xib inside
      <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
      This, as well as changing the version in < document > ToolsVersion and < plugIn > to the value in your normal xib file
      , but it is not recommended to do so, after Xcode8 out, I hope we all quickly get started, full update. This is the same as XCODE5 to Xcode6, there are changes, but still want to learn as soon as possible, adapt Yo!
Third, code and API note

After using Xcode8, some of the code may not be compiled, specifically I would like to talk about the problems I encountered.
Proxy method for 1.UIWebView:
* * Note to delete Nserror in front of the nullable, otherwise error.

- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error{    [self hideHud];}
Iv. Workarounds for code annotations not available

This is because Apple solves Xcode ghost and blocks the plugin.
Workaround
Open terminal, command run: sudo/usr/libexec/xpccachectl
Then you have to restart the computer to take effect

Note: The Xcode8 has a built-in annotation feature, where


Qq20160914-3.png

The shortcut keys are set here


Qq20160914-2.png

Seemingly Xcode8 canceled the function of the three-party plug-in, specific can refer to the next Xcode8 Source Editor

V. Permissions and Related Settings

Note that when added, there is no space at the end
We need to open the Info.plist file to add a description of the appropriate permissions, or the program will crash on IOS10.
Specific example:


Qq20160914-0.png

Microphone Permissions: Privacy-microphone usage Description Do you want to allow this app to use your microphone?
Camera permissions: Privacy-camera usage Description Do you want to allow this app to use your camera?
Album Permissions: Privacy-photo library Usage Description Do you want to allow this app to access your media library? Address Book permissions: privacy-contacts Usage Description Do you want to allow this app to access your contacts?
Bluetooth permissions: Privacy-bluetooth Peripheral usage Description Do you Xu Yun this app to use Bluetooth?

Voice to text permissions: Privacy-speech recognition usage Description allow this app to use speech recognition?
Calendar permissions: Privacy-calendars usage Description Do you want to allow this app to use the calendar?

Location permissions: Privacy-location when on use Usage Description we need to get relevant data about you from your location
Location rights: Privacy-location always Usage Description We need to get data about you from your location
The positioning needs to be written so as to prevent the shelves from being rejected.

Six, the font becomes larger, the original frame needs to fit

After some friends remind, found that the original 2 words in the program width is 24, now 2 words need 27 width to show.
Hope to have a solution to the friend, comments sue me yes, thank you

Seven, push to send

such as the section, do not forget to open. All the push platform, whether it is the aurora or what, to receive the push, this must be opened yo??


Qq20160914-4.png

After that, you should be able to receive the push. In addition, the Aurora Push also launched a new version, you can also update.

PS. Apple has made a lot of changes to the push, I hope that we have more access to review, processing the agent method of push has changed.

// 推送的代理[<UNUserNotificationCenterDelegate>]

IOS10 received notification is no longer in
[application: didReceiveRemoteNotification:]method to deal with, IOS10 launches new proxy method, receives and processes various notifications (local or remote)

-(void)  usernotificationcenter: (Unusernotificationcenter *) Center Willpresentnotification: (unnotification *) notification Withcompletionhandler: (void (^) ( unnotificationpresentationoptions)) Completionhandler {//app receives notification in foreground nslog (@ "========%@", notification);} -(void)  Usernotificationcenter: (Unusernotificationcenter *) Center Didreceivenotificationresponse: (unnotificationresponse *) response Withcompletionhandler: (void (^) ()) Completionhandler {//Click notification to enter app nslog (@ "response:%@", Response)}                

I will update the article later and give a detailed explanation of the push.

8. Screen for messy bugs

After updating the Xcode8, the newly created project will print a bunch of logs that are inexplicable to read.
such as these

0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1,

The shielding method is as follows:
Xcode8 inside Edit scheme-> Run--Arguments, in the environment variables inside add
Os_activity_mode = Disable


Qq20160914-8.png

If you have written or printed log, please check the checkmark again, you can solve the



Text/Xu Different (Jane book author)
Original link: http://www.jianshu.com/p/9756992a35ca
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

iOS development adaptation iOS10 and Xcode8-b

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.