iOS 新特性总结(since iOS6)

iOS 6

1、废除viewDidUnLoad

-(void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];//即使没有显示在window上。也不会自己主动的将self.view释放。 // Add code to clean up any of your own resources that are no longer necessary. // 此处做兼容处理须要加上ios6.0的宏开关,保证是在6.0下使用的,6.0曾经屏蔽以下代码,否则会在以下使用self.view时自己主动载入viewDidLoad
if ([self.view window] == nil)//是否是正在使用的视图
{
// Add code to preserve data stored in the views that might be
// needed later. // Add code to clean up other strong references to the view in
// the view hierarchy.
self.view = nil;//目的是再次进入时能够又一次载入调用viewDidLoad函数。 }
}

2、废除shouldAutorotateToInterfaceOrientation

iOS 6以后的旋转处理方式,用以下两个方法替代

- (BOOL)shouldAutorotate;
- (NSUInteger)supportedInterfaceOrientations; 还须要在info.plist进行配置

3、UISwitch能够设置开关颜色和背景图

@property (nonatomic,  retain) UIColor *tintColor;
@property (nonatomic, retain) UIColor *thumbTintColor;
@property (nonatomic, retain) UIImage *onImage;
@property (nonatomic, retain) UIImage *offImage;

4、UINavigationBar新增了,设置阴影图片属性

@property (nonatomic, retain) UIImage *shadowImage;

5、UIImage能够在设置图片能够进行缩放

+ (UIImage *)imageWithData:(NSData *)data scale:(CGFloat)scale;
- (id)initWithData:(NSData *)data scale:(CGFloat)scale;

6、新增UIRefreshControl

与UITableView配合实现下拉刷新

7、新增UICollectionView

能够实现瀑布流

8、新增Autolayout布局方式

学习第三方开源框架Masonry

9、语法相关

新增字面量方法

NSNumber* iNumber = @3;
NSNumber* fNumber = @3.5;
NSArray* titles = @[@"a",@"b"];
NSDictionary* dict = @{@"a":@"b"}; 【注意】:要确保字典和数组里面的内容不能为nil。否则会引发崩溃。

iOS 7

1、取消了udid和mac地址的訪问

UUID:
UUID是Universally Unique Identifier的缩写,中文意思是通用唯一识别码。 它是让分布式系统中的全部元素。都能有唯一的辨识资讯,而不
须要透过中央控制端来做辨识资讯的指定。这样。每一个人都能够建立不与其它人冲突的 UUID。在此情况下。就不需考虑数据库建立时的名称反复问
题。苹果公司建议使用UUID为应用生成唯一标识字符串。 开发人员能够在应用第一次启动时调用一次,然后将该串存储起来,替代UDID来使用。 可是,假设用户删除该应用再次安装时,又会生成新的字符串,所
以不能保证唯一识别该设备。使用UUID,就要考虑应用被删除后再又一次安装时的处理。 一个解决的办法是:UUID一般仅仅生成一次,保存在iOS系统里
面,假设应用删除了,重装应用之后它的UUID还是一样的。除非系统重置。可是不能保证在以后的系统升级后还能用(假设系统保存了该信息就能
用)。
IDFA:
广告标示符是iOS 6中另外一个新的方法。提供了一个方法advertisingIdentifier。通过调用该方法会返回一个NSUUID实例,最
后能够获得一个UUID。由系统存储着的。只是即使这是由系统存储的。可是有几种情况下,会又一次生成广告标示符。假设用户全然重置系统((设置程
序 -> 通用 -> 还原 -> 还原位置与隐私),这个广告标示符会又一次生成。 另外假设用户明白的还原广告(设置程序->通用 -> 关于本机 ->广告
->还原广告标示符),那么广告标示符也会又一次生成。关于广告标示符的还原。有一点须要注意:假设程序在后台执行,此时用户“还原广告标示符”,
然后再回到程序中,此时获取广告标示符并不会马上获得还原后的标示符。必须要终止程序。然后再又一次启动程序,才干获得还原后的广告标示符。 在同一个设备上的全部App都会取到同样的值。是苹果专门给各广告提供商用来追踪用户而设的。用户能够在 设置|隐私|广告追踪 里重置此id的
值,或限制此id的使用,故此id有可能会取不到值。但好在Apple默认是同意追踪的,并且一般用户都不知道有这么个设置,所以基本上用来监測推广
效果,是戳戳有余了。 【注意】:由于idfa会出现取不到的情况,故绝不能够作为业务分析的主
id,来识别用户
#import <AdSupport/AdSupport.h>
NSString *adId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
IDFV:
Vendor标示符是给Vendor标识用户用的,每一个设备在所属同一个Vender的应用里,都有同样的值。当中的Vender是指应用提供商,但准确点说,
是通过BundleID的DNS反转的前两部分进行匹配,假设同样就是同一个Vender,比如对于
com.somecompany.appone,com.somecompany.apptwo这两个BundleID来说,就属于同一个Vender,共享同一个idfv的值。和
idfa不同的是。idfv的值是一定能取到的,所以非常适合于作为内部用户行为分析的主id,来标识用户。替代OpenUDID。 【注意】:假设用户将属于此Vender的全部App卸载。则idfv的值会被重置,即再重装此Vender的App,idfv的值和之前不同。
NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
OpenUDID:
每台iOS设备的OpenUDID是通过第一个带有OpenUDID SDK包的App生成,假设你全然删除全部带有OpenUDID SDK包的App(比方恢复系统
等)。那么OpenUDID会又一次生成,并且和之前的值会不同,相当于新设备; 长处是没实用到MAC地址;不同设备能够获取各自唯一的识别码,保证了唯一性,能够用于以往UDID的相关用途;从代码分析OpenUDID的获取。识别
码获取方便并且保存慎重。缺点是当将设备上全部使用了OpenUDID方案的应用程序删除,且设备关机重新启动,xcode彻底清除并重新启动,重装应用程序去
获取OpenUDID。此时OpenUDID变化,与之前不一样了,全部OpenUDID应用卸载后。由UIPasteboard保存的数据即被清除,重装故会又一次获取新的
OpenUDID。那么当由于用户干预或者恶意程序,致使UIPasteboard数据清除。从而导致OpenUDID被删除。重装也会获取新的OpenUDID。
unsigned char result[16];
const charchar *cStr = [[[NSProcessInfo processInfo] globallyUniqueString] UTF8String];
CC_MD5( cStr, strlen(cStr), result );
_openUDID = [NSString stringWithFormat: @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%08x", result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7], result[8], result[9], result[10], result[11],result[12], result[13], result[14], result[15], arc4random() % 4294967295];

2、UIPasteboard由共享变沙盒化

3、语法添加instancetype

4、设置UIImage的渲染模式:UIImage.renderingMode

UIImageRenderingModeAutomatic // 依据图片的使用环境和所处的画图上下文自己主动调整渲染模式。
UIImageRenderingModeAlwaysOriginal // 始终绘制图片原始状态,不使用Tint Color。
UIImageRenderingModeAlwaysTemplate // 始终依据Tint Color绘制图片,忽略图片的颜色信息。
UIImage *img = [UIImage imageNamed:@"myimage"];
img = [img imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];

5、tinColor vs barTinColor


UINavigationBar *bar = self.navigationController.navigationBar;
UIColor *color = [UIColor greenColor];
if ([bar respondsToSelector:@selector(setBarTintColor:)]) { // iOS 7+
bar.barTintColor = color;
} else {
bar.tintColor = color;
}

6、UIButtonTypeRoundRect被UIButtonTypeSystem替代

7、新增检查无线路由是否可用

@property (nonatomic, readonly) BOOL wirelessRoutesAvailable; //  是否有设备能够连接的无线线路?
@property (nonatomic, readonly) BOOL wirelessRouteActive; // 设备如今是否连接上了网络
NSString *const MPVolumeViewWirelessRoutesAvailableDidChangeNotification;
NSString *const MPVolumeViewWirelessRouteActiveDidChangeNotification;

8、更具体蜂窝网络信息

@interface AppDelegate ()
@property (nonatomic, strong) CTTelephonyNetworkInfo *networkInfo; @end @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.networkInfo = [[CTTelephonyNetworkInfo alloc] init];
NSLog(@"Initial cell connection: %@", self.networkInfo.currentRadioAccessTechnology);
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(radioAccessChanged) name:
CTRadioAccessTechnologyDidChangeNotification object:nil];
}
- (void)radioAccessChanged {
NSLog(@"Now you're connected via %@", self.networkInfo.currentRadioAccessTechnology);
}
@end

9、通过iCloud同步用户设备的密码

- (BOOL)saveCredentials:(NSError **)error {
SSKeychainQuery *query = [[SSKeychainQuery alloc] init];
query.password = @"MySecretPassword";
query.service = @"MyAwesomeService";
query.account = @"John Doe";
query.synchronizable = YES;
return [query save:&error];
} - (NSString *)savedPassword:(NSError **)error {
SSKeychainQuery *query = [[SSKeychainQuery alloc] init];
query.service = @"MyAwesomeService";
query.account = @"John Doe";
query.synchronizable = YES;
query.password = nil;
if ([query fetch:&error]) {
return query.password;
}
return nil;
}

10、使用NSAttributedString显示HTML

//htmlStr -> NSAttriubtedString
NSString *html = @"<bold>Wow!</bold> Now <em>iOS</em> can create <h3>NSAttributedString</h3> from HTMLs!";
NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType}; NSAttributedString *attrString = [[NSAttributedString alloc] initWithData:[html dataUsingEncoding:NSUTF8StringEncoding]
options:options documentAttributes:nil error:nil]; //NSAttriubtedString -> htmlStr
NSAttributedString *attrString; // from previous code
NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType};
NSData *htmlData = [attrString dataFromRange:NSMakeRange(0, [attrString length]) documentAttributes:options error:nil];
NSString *htmlString = [[NSString alloc] initWithData:htmlData encoding:NSUTF8StringEncoding];

11、系统提供base64编码

NSData* sampleData = [@"Some sample data" dataUsingEncoding:NSUTF8StringEncoding];
NSString * base64String = [sampleData base64EncodedStringWithOptions:0];
NSData* dataFromString = [[NSData alloc] initWithBase64EncodedString:base64String options:0];

12、获取截图事件的通知(UIApplicationUserDidTakeScreenshotNotification

13、语音播报功能(AVSpeechSynthesizer)

【小技巧】:

AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init];
AVSpeechUtterance *utterance =
[AVSpeechUtterance speechUtteranceWithString:@"Wow, I have such a nice voice!"];
utterance.rate = AVSpeechUtteranceMaximumSpeechRate / 4.0f;
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"]; // defaults to your system language
[synthesizer speakUtterance:utterance];

14、UIScreenEdgePanGestureRecognizer

UIScreenEdgePanGestureRecognizer
继承自UIPanGestureRecognizer
,它能够让你从屏幕边界就可以检測手势。

【小技巧】:

UIScreenEdgePanGestureRecognizer *recognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:
@selector(handleScreenEdgeRecognizer:)];
recognizer.edges = UIRectEdgeLeft;
[self.view addGestureRecognizer:recognizer];

15、UIScrollViewKeyboardDismissMode

滚动的时候能够让键盘消失是一种非常好的体验。苹果给UIScrollView加入了一个非常好用的属性keyboardDismissMode。如今仅仅仅仅须要在Storyboard中改变一个简单的属性。或者添加一行代码,你的app能够和办到和Messages
app一样的事情了。

UIScrollViewKeyboardDismissModeNone
UIScrollViewKeyboardDismissModeOnDrag
UIScrollViewKeyboardDismissModeInteractive

16、使用Core Image来检測眨眼以及微笑

iOS给Core Image添加了两种人脸检測功能:CIDetectorEyeBlink以及CIDetectorSmile。这也就是说你如今能够在照片中检測微笑以及眨眼。

【小技巧】:

UIImage *image = [UIImage imageNamed:@"myImage"];
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace
context:nil
options:@{CIDetectorAccuracy: CIDetectorAccuracyHigh}];
NSDictionary *options = @{ CIDetectorSmile: @YES, CIDetectorEyeBlink: @YES };
NSArray *features = [detector featuresInImage:image.CIImage options:options];
for (CIFaceFeature *feature in features) {
NSLog(@"Bounds: %@", NSStringFromCGRect(feature.bounds));
if (feature.hasSmile) {
NSLog(@"Nice smile!");
} else {
NSLog(@"Why so serious?");
}
if (feature.leftEyeClosed || feature.rightEyeClosed) {
NSLog(@"Open your eyes!");
}
}

17、给textView的文字上加点击事件

【小技巧】:

NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"This is an example by @marcelofabri_"];
[attributedString addAttribute:NSLinkAttributeName
value:@"username://marcelofabri_"
range:[[attributedString string] rangeOfString:@"@marcelofabri_"]];
NSDictionary *linkAttributes = @{NSForegroundColorAttributeName: [UIColor greenColor],
NSUnderlineColorAttributeName: [UIColor lightGrayColor],
NSUnderlineStyleAttributeName: @(NSUnderlinePatternSolid)};
textView.linkTextAttributes = linkAttributes;
textView.attributedText = attributedString;
textView.delegate = self; //你也能够控制当链接被点击的时候会发生什么,实现这个能够使用UITextViewDelegate协议的新的shouldInteractWithURL方法,就像这样:
- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange {
if ([[URL scheme] isEqualToString:@"username"]) {
NSString *username = [URL host];
// do something with this username
// ...
return NO;
}
return YES; // let the system open this URL
}

18、UI变化

取消了拟物化,变成了扁平化设计

UITabbar,UIbarButtonItem,navigationBar。都以特殊形式渲染,图片没有内部颜色,通过tinColor渲染图片(开发人员能够通过渲染模式使用原图颜色)。navigationBar及导航栏也作为self.view的内容。所以self.view的原点从导航栏以下变成了。状态栏的顶端。

(能够通过self.navigationController.navigationBar.translucent以及self.edgesForExtendedLayout来决定是否以ios7或ios6样式显示)

19、sprite kit

能够用系统自带框架做小游戏

20、多任务

http://blog.csdn.net/tskyfree/article/details/45696597

http://blog.csdn.net/wwwang89123/article/details/46944665

21、AirDrop

苹果将该功能集成到了UIActivityViewController。假设做了分享功能,则并不要加入特别的代码,具体实现參考UIActivityViewController。

22、MapKit

(1)MKMapCamera。能够将一个MKMapCamera对象加入到地图上。在指明位置,角度和方向后将呈现3D的样子…大概能够想象成一个数字版的Google街景..

(2)MKDirections获取Apple提供的基于方向的路径,然后能够用来将路径绘制在自己的应用中。这可能对一些小的地图服务提供商产生冲击,可是还是那句话。地图是一个数据的世界,在拥有完备数据之前。Apple不是Google的对手。这个状况至少会持续好几年(也有可能是永远)。

(3MKGeodesicPolyline创建一个随地球曲率的线,并附加到地图上。完毕一些视觉效果。

(4)MKMapSnapshotter使用其拍摄基于地图的照片,或许各类签到类应用会用到。

5.改变了overlay物件的渲染方式。

23、动态uikit

新增了UIDynamicItem托付。用来为UIView制定动态行为。当然其它不论什么对象都能通过实现这组接口来定义动态行为,仅仅只是在UIKit中可能应用最多。

所谓动态行为。是指将现实世界的行为或者特性引入到UI中。比方重力等。

通过实现UIDynamicItem,UIKit如今支持例如以下行为:
* UIAttachmentBehavior 连接两个实现了UIDynamicItem的物体(以下简称动态物体),一个物体移动时。另一个尾随移动 * UICollisionBehavior指定边界。使两个动态物体能够进行碰撞
* UIGravityBehavior顾名思义,为动态物体添加重力模拟 * UIPushBehavior为动态物体施加持续的力 * UISnapBehavior为动态物体指定一个附着点,想象一下相似挂一幅画在图钉上的感觉。

假设有开发游戏的童鞋可能会认为这些非常多都是做游戏时候的需求,一种box2d之类的2D物理引擎的既视感跃然而出。没错的亲。动态UI,加上之后要介绍的Sprite
Kit,极大的扩展了使用UIKit进行游戏开发的可能性。

另外要注意UIDynamicItem不仅适用于UIKit。不论什么对象都能够实现接口来获得动态物体的一些特性,所以说用来做一些3D的事情也不是没有可能。假设认为Cocos2D+box2d这种组合使用起来不方便的话,如今动态UIKit+SpriteKit给出了新的选择。

24、Inter-App Audio应用间的音频

AudioUnit框架中加入了在同一台设备不同应用之间发送MIDI指令和传送音频的能力。

比方在一个应用中使用AudioUnit录音,然后在另一个应用中打开以处理等。在音源应用中声明一个AURemoteIO实例来标为Inter-App可用,在目标应用中使用新的发现接口来发现并获取音频。想法非常好,也算是在应用内共享迈出了一步,只是我对如今使用AudioUnit这种低层级框架的应用数量表示不乐观。

或许今后会有一些为更高层级设计的共享API提供给开发人员使用。毕竟要从AudioUnit開始处理音频对于大多数开发人员来说并非一件非常easy的事情。

25、点对点连接 Peer-to-Peer Connectivity

能够看成是AirDrop不能直接使用的补偿,代价是须要自己实现。MultipeerConnectivity框架能够用来发现和连接附近的设备,并数据传输。而这一切并不须要有网络连接。能够看到Apple逐渐在文件共享方面一步步放开限制,可是当然全部这些都还是被限制在sandbox里的。

26、Store Kit Framework

Store Kit在内购方面採用了新的订单系统,这将能够实现对订单的本机验证。这是一次相应内购破解和有可能验证失败导致内购失败的更新,苹果希望藉此降低内购的实现流程,降低出错,同一时候遏制内购破解泛滥。

前者可能没有问题,可是后者的话。由于objc的动态特性,决定了仅仅要有越狱存在,内购破解也是早晚的事情。只是这一点确实方便了没有能力架设验证服务器的小开发人员,这方面来说还是非常好的。

27、iBeacon

一种全新的基于蓝牙的传输协议,能够实现非常精确的定位

http://blog.csdn.net/boxertan/article/details/39783963

iOS 8

1、UIAlertController

UIAlertController整合了actionsheet和alertview

【小技巧】:

UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleDefault handler:nil];
[alertController addAction:cancelAction];
[alertController addAction:okAction];
[self presentViewController:alertController animated:YES completion:nil];

2、SizeClasses

能够依据不同尺寸,横屏竖屏在StoryBoard上或者Xib上对app进行适配

3、Health Kit

健康方面 

4Home Kit

智能家居方面

5SceneKit

游戏方面

6、Handoff

假设你的程序有mac版本号,那么它能够和ios版本号进行自由的交互

( 比如系统的电话,短信,facetime功能)

7、CLFloor室内定位

CLLocation的floor能够告诉你当前的楼层

8、TouchID

指纹识别方面

9、PhotoKit

一个新的相冊框架。替代了原来的AL

10、UIPopoverPresentationController

其相当于ipad中的UIPopoverController,在某个空间周边显示一个气泡菜单

【小技巧】:

 MyViewController*   contentVC = [[MyViewController alloc]init];
contentVC.preferredContentSize = CGSizeMake(110, 160);
contentVC.modalPresentationStyle = UIModalPresentationPopover;
self.popover = contentVC.popoverPresentationController;
self.popover.delegate = self;
self.popover.backgroundColor = [UIColor greenColor];
self.popover.sourceView =button;
self.popover.sourceRect = button.bounds;
self.popover.permittedArrowDirections = UIPopoverArrowDirectionUp;
[self presentViewController:contentVC animated:YES completion:nil];//推出popover

11、Cloud Kit

其相似于BaaS。与之不同的是,Cloud Kit倾向于对数据的集成。你能够不更改应用现有的数据模型和结构,而仅仅是使用
Cloud Kit 来从云端获取数据或者向云端存储数据。可是其最大限制在于仅仅能用于苹果端。

12、全新的通知机制

http://blog.csdn.net/songhongri/article/details/39482067

13、定位权限的变化

【小技巧】:

// 当使用iOS8定位的时候须要请求用户授权,且在info.plist里加入字段NSLocationAlwaysUsageDescription请求用户授权的描写叙述
// iOS7仅仅须要在info.plist里加入字段Privacy - Location Usage Description请求用户授权的描写叙述
if (IOS8) {
[self.maneger requestAlwaysAuthorization];//请求用户授权
}

14、各种小插件

Today Widget Extension

http://blog.csdn.net/kuloveyouwei/article/details/44019815

第三方输入法 Extension

Document Picker Extension

Photo Editing Extension

Shared Extension

Action Extension

Watch Extension

15、Metal Kit

一套图形接口与OpenGL和Direct3D相似主要制作3D相关

16、Apple Pay

苹果支付相关sdk

17、tableviewcell自己主动适应高度

假设cell用autolayout布局,仅仅须要两行代码就能够实现自己主动计算高度

self.tableView.estimatedRowHeight = 44.0f;
self.tableView.rowHeight = UITableViewAutomaticDimension;

18、WebKit

WKWebView能够替代UIWebView

19、Swift语言

 

iOS 9

1、https网络

默认https,假设不支持https,须要到info.plist做配置

2、后台定位

【小技巧】:

_locationManager.allowsBackgroundLocationUpdates = YES;

3、Bitcode

4、inHouse须要进入系统设置权限(弹窗同意)才干安装

5、URL scheme

在iOS9中,假设使用URL scheme必须在"info.plist"中将你要在外部调用的URL
scheme列为白名单。否则无法跳回来。

在info.plist中设置 LSApplicationQueriesSchemes类型为数组。以下加入全部你用到的scheme

6、苹方字体

7、iPad适配Slide Over和 Split View

能够进行多窗体开发

8、tableview局部reload

[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];

9、Watch Connectivity

由于watchOS 2的架构变化。须要这么一个东西来对iPhone和Watch进行双向通信

10、Spotlight 

能够让自己的app在系统搜索栏搜到内容

11、App Thinning

能够针对设备对app优化,让安装包变小

12、Safari Services Framework(SFSafariViewController)

但你的app须要展示一个WebView又不须要太多定制的时候,用它来替换掉你如今在用的UIWebView或者WKWebView。他能够让Safari以一个Controller的形式载入你的网页,和系统的Safari全然共享Cookie和Autofill等特性,最重要的,Safari的JavaScript引擎

13、3D touch

http://www.jianshu.com/p/b552bedbc3ef

14、UI Test

能够用Xcode进行项目的自己主动化測试了

15、GameplayKit,ReplayKit,Model I/O

对游戏的支持

16、语法相关

(1)泛型  如:

NSArray<NSString*>* datas;

(2)可空标记  

如:

@property (nonatomic, strong) NSArray *__nonull names;
@property (nonatomic, strong, nonnull) NSarray *names;

(3)kindof

能够让返回值用kindof

17UIStackView

相似于安卓的线性布局

18、preferredStatusBarStyle

控制器管理状态栏

iOS 10

1、User Notifications

https://onevcat.com/2016/08/notification/

2、iMessage Apps 表情包App

3、新的插件

iMessage Extension

Notification Content Extension

Notification Service Extension

Audio Unit Extension

Broadcast UI Extension

Broadcast Upload Extension

Call Directory Extension

Content Blocker Extension

Intents Extension

Intents UI Extension

Shared Links Extension

Sticker Pack Extension

4、SiriKit(使用siri服务)

在 iOS 10中,我们仅仅能用 SiriKit来做六类事情。各自是:

  • 语音和视频通话
  • 发送消息
  • 发送或接收付款
  • 搜索照片
  • 约车
  • 管理健身

5、SpeechFramework语音识别

https://my.oschina.net/u/2340880/blog/751442

6、Proactive Suggestions

siri建议

7、CallKit

8、隐私权限

全部的功能都须要加隐私权限说明(弹窗),否则会闪退

9、tabbar未选中颜色

tabBar.unselectedItemTintColor =[UIColor redColor];

10、跟着系统字体变化

self.labels.font =[UIFont preferredFontForTextStyle:UIFontTextStyleBody];
self.labels.adjustsFontForContentSizeCategory = YES;

11、UIViewPropertyAnimator属性动画器

那么在iOS 10之前,我们使用UIView做动画效果或者自己定义一些layer的动画,假设開始了,一般无法进行停止操作更不能暂停操作,并且一些非常复杂的动画处理也比較麻烦。可是在iOS10。苹果退出了一个全新的API  UIViewPropertyAnimator,可供我们处理动画操作UIViewPropertyAnimator是
iOS 10中新增的一个执行 View动画的类,具有以下特点:

可中断性

可擦除

可反转性

丰富的动画时间控制功能

12、UIColor新方法

iOS 10苹果官方建议我们使用sRGB,由于它性能更好,色彩更丰富。

+ (UIColor*)colorWithDisplayP3Red:(CGFloat)displayP3Red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha   NS_AVAILABLE_IOS  (10_0);

13、ipv6适配

14、UITextContentType

在iOS 10 UITextField加入了textContentType枚举,指示文本输入区域所期望的语义意义。

使用此属性能够给键盘和系统信息,关于用户输入的内容的预期的语义意义。比如,您能够指定一个文本字段。用户填写收到一封电子邮件确认uitextcontenttypeemailaddress。当您提供有关您期望用户在文本输入区域中输入的内容的信息时,系统能够在某些情况下自己主动选择适当的键盘,并提高键盘修正和主动与其它文本输入机会的整合。

15、UIScrollView新增refreshControl

16、判断系统版本号

//值为 1
[[[[UIDevice currentDevice] systemVersion] substringToIndex:1]
integerValue]

//值为10.000000[[UIDevice currentDevice] systemVersion].floatValue,

//值为10.0
[[UIDevice currentDevice] systemVersion]

17、Xcode8不能用插件

http://vongloo.me/2016/09/10/Make-Your-Xcode8-Great-Again/?utm_source=tuicool&utm_medium=referral

18、[[UIApplication sharedApplication] openURL被废弃

【小技巧】:

用 [[UIApplication sharedApplication]
openURL:nil options:nil completionHandler:nil]取代。

19、字体变化

ios10字体变大,有可能字体显示不全,所以lable大小不要写死

20、UICollectionView性能优化

iOS 10
对UICollectionView进一步的优化。

  • UICollectionView cell pre-fetching预载入机制
  • UICollectionView and UITableView prefetchDataSource新增的API
  • 针对self-sizing cells的改进
  • Interactive reordering

21、https适配

iOS 9中默认非HTTS的网络是被禁止的,当然我们也能够把NSAllowsArbitraryLoads设置为YES禁用ATS。只是iOS
10从2017年1月1日起苹果不同意我们通过这种方法跳过ATS,也就是说强制我们用HTTPS。假设不这种话提交App可能会被拒绝。可是我们能够通过NSExceptionDomains来针对特定的域名开放HTTP能够easy通过审核。

05-08 08:27