美文网首页iOS开发
Xcode8和iOS10问题小结

Xcode8和iOS10问题小结

作者: 诺之林 | 来源:发表于2016-09-26 15:15 被阅读596次

目录

回顾

iOS8 SDK新特性

  • Extension

  • Touch ID

  • Size Classes

  • Cloud Kit

更多参考开发者所需要知道的iOS 8 SDK新特性

iOS9 SDK新特性

  • Multitasking

  • Bitcode

  • HomeKit,CloudKit,HealthKit

  • Swift 2

更多参考开发者所需要知道的iOS 9 SDK新特性

iOS10 SDK新特性

  • More Extensions

  • iMessage Apps

  • User Notifications

  • SiriKit

  • Swift 3

更多参考开发者所需要知道的iOS 10 SDK新特性

Xcode8新字体

相比Xcode7, Xcode8的最直观变化就是

  • 新字体SF Mono

  • 新字体的字符宽度更宽

Xcode8插件失效

保证你的Xcode8是从官方渠道下载的, 从App Store下载或者该地址离线下载

权限管理

我们需要打开info.plist文件添加相应权限的说明, 否则程序在iOS10上会出现崩溃

ios10-xcode8-issues_01.png

以下是常用权限列表

  • 麦克风权限 - Privacy - Microphone Usage Description

  • 相机权限 - Privacy - Camera Usage Description

  • 相册权限 - Privacy - Photo Library Usage Description

  • 通讯录权限 - Privacy - Contacts Usage Description

  • 蓝牙权限 - Privacy - Bluetooth Peripheral Usage Description

  • 语音转文字权限 - Privacy - Speech Recognition Usage Description

  • 日历权限 - Privacy - Calendars Usage Description

  • 定位权限 - Privacy - Location When In Use Usage Description

  • 定位权限 - Privacy - Location Always Usage Description

证书管理

ios10-xcode8-issues_02.png

屏蔽系统log

Edit Scheme-> Run -> Arguments, 在Environment Variables里边添加

OS_ACTIVITY_MODE = Disable

ios10-xcode8-issues_03.png

awakeFromNib警告

以前的写法会有警告

- (void)awakeFromNib {
     // [super awakeFromNib];
}

在Xcode8中需要改成

- (void)awakeFromNib {
     [super awakeFromNib];
}

ATS(App Transport Security)

iOS 9中默认非HTTPS的网络是被禁止的, 当然我们也可以把NSAllowsArbitraryLoads设置为YES禁用ATS

但是iOS 10从2017年1月1日起苹果不允许我们通过这个方法跳过ATS!

所以不管是为了通过审核, 还是为了安全考虑, 都应该立刻, 马上, 现在就使用HTTPS!

关于更多ATS, 可以参考关于iOS 10中ATS的问题

User Notification

iOS 10对User Notification也做了大幅重构

  • 优化功能和接口

  • 优化权限申请流程

关于更多Notification, 可以参考活久见的重构 - iOS 10 UserNotifications 框架解析

一些API更新

新增APIs

  • UIColor新增了接口
- (UIColor *)initWithDisplayP3Red:(CGFloat)displayP3Red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;

在iOS 10苹果官方建议我们使用sRGB, 因为它性能更好, 色彩更丰富

废弃APIs

- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated;

新增属性

  • UITextView和UITextField新增了属性
// Indicates the semantic meaning expected by a text-entry area.
@property(nonatomic, copy) UITextContentType textContentType;
  • UIScrollView新增了属性
@property(nonatomic, strong) UIRefreshControl *refreshControl;

更多文章, 请支持我的个人博客

相关文章

网友评论

    本文标题:Xcode8和iOS10问题小结

    本文链接:https://www.haomeiwen.com/subject/gbsqyttx.html