iOS10开发和Xcode 8新特性及常见问题解析

2020-01-18 14:21:46王旭

9.第三方键盘的改进

非常非常重要,第三方键盘一直都不能很方便的拥有长按地球键的功能,现在有了。通过 handleInputModeListFromView:withEvent: 可以弹出系统键盘列表。同时使用 documentInputMode 可以检测输入上下文中的语言,你可以对输入方式进行一些类似于对齐方式的调整。

10.iOS10 对隐私权限的管理

比如访问的摄像头、麦克风等硬件,都需要提前请求应用权限、允许后才可以使用,或者现在要提前声明,虽然以往要求不严格。在iOS10中比如遇到崩溃。

崩溃日志:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data. 你需要在info.plist文件 添加一个NSContactsUsageDescription的Key,Value添加一个描述。 ssss.png 视频播放 需要在info.Plist中配置 >官方解释:This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSAppleMusicUsageDescription key with a string value explaining to the user how the app uses this data.

访问用户的隐私数据,并且没有向用户说明,必须在plist(info.plist)中配置这个key NSAppleMusicUsageDescription 并且向用户说明.fff.png

11.Xcode7 和Xcode 8项目中的xib兼容问题

在Xcode8上打开项目要小心,尤其是对于xib过程,在变动后可不要随意点保存,否则当你回头用Xcode7打开时时发现报错了,Xcode保存的xib在xcode7上是识别不了的!

12.ApplePay(苹果支付)

ApplePay更新内容:

可用于 SFSafariViewController

可用于没有UI的extensions中

在 iMessage 应用中也支持 ApplePay

13.CoreData提升了并发访问性能

14.刷新控件(UIRefresh Control)

iOS系统自带的刷新控件支持所有的 UIScrollView 以及其子类,比如说 UICollectionView,UITableView。

核心代码:


#import <Foundation/Foundation.h>
@class UIRefreshControl;NS_CLASS_AVAILABLE_IOS(10_0)
@protocol UIRefreshControlHosting <NSObject>
@property (nonatomic, strong, nullable) UIRefreshControl *refreshControl __TVOS_PROHIBITED;
@end

Xcode 8 新特性(正在整理..)

xcode8 常见问题:

1.更新Xcode 8 卡在“正在安装...”:

笔者连续重装了三次都无限卡在“还有5分钟...”,最终采用最粗暴直接的方式,Finder --> 应用程序,卸载Xcode 7.3 并在AppStore中直接安装Xcode 8 。

2.控制台打印多余打印

貌似是xcode自带的项目追踪信息,每次项目运行以后都会在控制台打印以下信息

xcode8,ios10新特性