前言
2017年6月6日凌晨一點(北京時間),蘋果在2017WWDC大會上發(fā)布了全新的iOS11系統(tǒng)穷当】秆浚可能大家印象比較深刻的就是iOS11
新增了增強現(xiàn)實的框架ARKit
和安卓玩了幾十年都玩爛了的文件管理系統(tǒng)
,那么除此之外iOS11
又新增了哪些功能呢尉辑?這正是文本要介紹的。
本文翻譯自蘋果官方iOS11發(fā)行說明文檔
:http://adcdownload.apple.com/Documentation/Beta_Release_Notes_Jun_5_2017/iOS_11_beta_Release_Notes.pdf鸭蛙,由于很難做到逐條測試摹恨,如果翻譯有誤還請多多指教.
凡是沒有原文
標示的均是筆者的翻譯,小括號內(nèi)的文字是筆者的見解娶视,凡是帶原文
標示的英文均是蘋果文檔的原文晒哄,英文后面的小括號是蘋果官網(wǎng)文檔說明編號,類似于identifier
有一些不是特別重要歇万,基本上對于我們開發(fā)沒有什么用處的揩晴,我就忽略了勋陪,所以本文中所有的內(nèi)容都是與我們iOS開發(fā)人員相關(guān)的功能大全
1.徹底廢棄32位APP(32-bit Apps)
(1)開發(fā)者從iOS11之后再也不用學習32位的APP開發(fā)了
原文:Selecting Learn More from the prompt after tapping on a already installed 32-bit app does nothing. (32340711)
(2)如果從iTunes同步32位的APP會留下一個占位符APP(言外之意就是在iOS11后如果通過iTunes同步一個32位的APP到你的iOS社會只會留下一個空白的APP贪磺,無法運行)
原文:Syncing 32-bit apps via iTunes leaves a placeholder for the app. (32356790)
(3)?如果在Xcode的target中勾選系統(tǒng)版本為iOS10或者之前的系統(tǒng),將會繼續(xù)兼容32位APP(再次強調(diào)只是iOS11不支持32位而已诅愚,iOS10及以下還是繼續(xù)兼容)
原文:iOS apps may target iOS 10 or earlier to continue including a 32-bit slice. (31597913)
從iOS11開始寒锚,32位的APP正式退出歷史舞臺
2.3D Touch
(1)?對于能識別到是電話號碼,地址等能夠響應(yīng)系統(tǒng)事件的文本對象(比如點擊號碼自動撥號)违孝,3D Touch不生效原文:Using 3D Touch with data detectors (phone numbers, addresses, etc.) does not work. (30504832)
3. 第三方應(yīng)用 (3rd Party Apps)
這里比較多刹前,對開發(fā)而言意義不大,我就撿幾條重點的說了
(1)使用?Facebook Messenger之前必須要安裝Facebook應(yīng)用(國內(nèi)撲街)
原文:Facebook Messenger doesn't launch without the Facebook app installed
(2)最重要:?第三方鍵盤如果沒有選擇允許完全訪問
有可能會出現(xiàn)崩潰問題(iOS10之后蘋果支持第三方鍵盤雌桑,具體設(shè)置在通用——鍵盤選項中)
原文:Third-party keyboards may crash if not allowed full access.
(3)?如果是Skyce通過可能會讓音頻播放掉線(靜音)
原文:The audio may drop during Skype calls. (32434672)
4.ARKit框架
ARKit是iOS11的最大亮點喇喉,筆者將會在后續(xù)同步刷新ARKit框架開發(fā)教程
(1)兩件事,一是在調(diào)試ARSession
的時候如果打短信的時候就會導致出現(xiàn)VIO 斷點的情況(就是訪問硬件內(nèi)存泄露的一種崩潰斷點校坑,不打的話程序就不會有問題) 二是在AR增強現(xiàn)實中的錨點是不可見的(理解比較困難拣技,筆者將會在后續(xù)更新ARKit框架學習和開發(fā)博客供讀者學習交流)
原文:Continuing from a breakpoint while debugging an ARSession may result in VIO breaking. Any visual objects placed in the world/anchor are not visible. (31561202)
(2)ARSessionConfiguration
(該類主要負責跟蹤AR設(shè)備方向的一些高級配置)類只有在A9芯片設(shè)備(iPhone6s)及iOS11系統(tǒng)之后才會生效
原文:ARSessionConfiguration is only supported on iOS devices with an A9 or later processor and will be enabled for all iOS 11 devices in a future beta.
(3)?ARWorldTrackingSessionConfiguration
(該類負責:配置跟蹤設(shè)備的方向和位置,以及檢測設(shè)備攝像頭看到的現(xiàn)實世界的表面)也是要A9芯片及以后,同上
原文:ARWorldTrackingSessionConfiguration is only supported on iOS devices with an A9 or later processor.
5.AVFoundation
AVFoundation更新比較多耍目,但是設(shè)計的內(nèi)容比較少膏斤,主要是在自定義相機環(huán)節(jié)開始全面支持雙攝像頭物理變焦的攝像頭捕捉到的高清圖像(為即將要發(fā)布的iPhone8做準備,其實這個對象在iOS10已經(jīng)出來邪驮,當時只有7plus才有雙攝像頭所以開發(fā)中用的極少) 這里筆者就不一一翻譯了莫辨,就是自定義相機中幾個iOS10新增的API以前返回的nil現(xiàn)在做了優(yōu)化
? TheCGImageRepresentationandpreviewCGImageRepresentationmethodsof AVCapturePhoto always return nil. In a future beta, they will return non-nil values. For more detail, see the documentation. (31392054)? AVCapturePhoto returns nil when accessing the fileDataRepresentation property of an uncompressed buffer (420f/420v/BGRA), instead of a TIFF file format representation. (31902960)? ThecameraCalibrationDatapropertyofAVCapturePhotoreturnsnilwhen cameraCalibrationDataDeliveryEnabled is set to true, unless you also set depthDataDeliveryEnabled to true. In a future beta, you’ll be able to request dual photo capture and camera calibration data capture and receive wide and telephoto buffers plus the camera calibration data for both (without being zoomed to 2x and delivering depth data to the photo). (32209427)? ThevaluesofthelensDistortionLookupTableand inverseLensDistortionLookupTable properties of AVCameraCalibrationData are erroneously centered around 1.0. This means that a point along the radius with no elongation or shrinkage is reported as 1.0. In a future beta, the values in this lookup table will change: 0 will mean no elongation or shrinkage. (32339695)Copyright ? 2017 Apple Inc. All Rights Reserved. Page 5 of 16? Still capture requests fail and the video stream stops producing a buffer when using the 720p30 video format with the depthDataDeliveryEnabled property of AVCapturePhotoSettings set to true. (32060882)? Depthvaluesinthenon-default160x120and160x90depthdataformatsarehalfofthe expected values and disparity values are twice the expected value. (32363942)
6.藍牙框架(Bluetooth)
大概意思就是測試版的系統(tǒng)(正式版要到17年9月份發(fā)布)藍牙不穩(wěn)定,iAP協(xié)議是蘋果官方的藍牙4.0協(xié)議
? Bluetooth accessories using Wireless iAP protocol may see connection issues in certain cases. (31439542)? This beta contains headers for the LE L2CAP channel feature. Full functionality will be available in the a later beta. (32493297)
7.日歷框架(EventKit)
(1)將數(shù)據(jù)存儲到一個非默認的響應(yīng)事件可能會失敗Storing data to a non default event store in EventKit may not work. (31335830)
8.Foundation框架
主要更新在網(wǎng)絡(luò)請求URLSessionTask
這一部分
第三點相當牛逼毅访,網(wǎng)絡(luò)請求能夠等待安全網(wǎng)絡(luò)才請求沮榜,這對于開發(fā)而言意義重大。筆者將會在后期上代碼測試
(1)比較長喻粹,大概的意思就是加了一些API蟆融,支持應(yīng)用程序退后后臺時仍然能與你的Watch(蘋果手表)通訊。(蘋果手表網(wǎng)絡(luò)請求依賴于手機連接的wifi)
Added a scheduling API to URLSessionTaskthat allows background URLSession clients to schedule tasks in the future, enabling easy background app refresh semantics for apps, watchOS complications, and more. The API also allows developers to update requests before transmission to address cases where the request has become stale when scheduled in the future. Additions include the earliestBeginDate, countOfBytesClientExpectsToSend, and countOfBytesClientExpectsToReceive properties of URSessionTask, and the URLSession:task:willBeginDelayedRequest:completionHandler method of URLSessionTaskDelegate protocol. (27866330)
(2)獲取網(wǎng)絡(luò)下載進度建議使用新屬性
URLSessionTask adopts the ProgressReporting protocol providing a consistent mechanism for URLSession clients to track the progress of URLSessionTask using the new progress property. (30834550)
(3)添加了一個更加靈活的網(wǎng)絡(luò)請求API磷斧,它能夠等待直到你的手機連接上了安全的網(wǎng)絡(luò)振愿,如果是不安全的網(wǎng)絡(luò)則該網(wǎng)絡(luò)請求不會調(diào)用
Added an Adaptable Connectivity API to URLSession that enables tasks to automatically monitor and wait for satisfactory network connectivity, instead of immediately failing with an error when connectivity is unsatisfactory. Additions include the waitsForConnectivity property of URLSessionConfiguration and the URLSession:taskIsWaitingForConnectivity: method of the URLSessionTaskDelegate protocol
(4)添加了APP應(yīng)用程序加載網(wǎng)絡(luò)時的一些數(shù)據(jù)編碼支持捷犹。(對開發(fā)意義不大,后面一大堆是舉例說明冕末,br指的是web前端的換行標簽)
Added support for HTTP brotli content encoding to URLSession. By default, HTTP requests contain a br value (in addition to gzip and deflate) for the Accept-Encoding HTTP header, informing the web server that the user agent supports brotli encoding. The web server can send an HTTP body with Content-Encoding: br in the HTTP header to indicate that the content is brotli-encoded. URLSession automatically decompresses the HTTP body data and passes the decoded data back to the client in the same way it does for Content-Encoding: gzip. For binary compatibility reasons, URLSession brotli support is enabled only for apps built using the iOS 11 SDK. (27724985)
最后一個環(huán)節(jié)是iOS開發(fā)中一半以上代碼都出自這個框架萍歉,大家猜到了么? 不錯档桃!就是UIKit框架
UIKit框架在iOS11中解決了一個UITableView
問題枪孩,新增了一堆代碼(主要與新功能文件管理有關(guān))
9.UIKit框架
本次iOS11系統(tǒng)更新UIKit較多,主要是因為iOS11新增的文件管理功能并沒有提供單獨的框架藻肄,而是被直接繼承在UIKit框架中蔑舞,測試版問題比較多,實際還是以正式版為準 關(guān)于iOS11文件管理功能的開發(fā)嘹屯,筆者將會后續(xù)提供教程學習交流
此次iOS11關(guān)于UITableView的優(yōu)化也比較多攻询,筆者將會在后續(xù)深入研究探索供大家學習交流
問題修復
設(shè)置UITableView
的delaysContentTouches
延遲響應(yīng)屬性為NO,再也不會立即觸發(fā)cell的響應(yīng)事件(delaysContentTouches是UIScrollerView的屬性州弟,叫做延遲響應(yīng)處理钧栖。默認為YES延遲處理,作用就是當點擊scrollerview中的按鈕時不會被系統(tǒng)判定為ScrollerView的滾動手勢婆翔,對這個屬性不了解的小白們可以百度哈拯杠,這里筆者不再詳細累述)Setting the delaysContentTouches property of UITableView to false now works correctly and results in cells highlighting immediately on a touch down event. (27102830)
新的變化
(1)UIDocumentBrowserViewController(顯示沙盒文件瀏覽器)不會顯示UIDocumentPickerExtensionViewController列表中的應(yīng)用程序擴展來源。雖然這些會在將在的測試版中重新啟用,請考慮使用一個NSFileProviderExtension相反,因為它們是集成在UIDocumentBrowserViewController而不是在一個單獨的表
UIDocumentBrowserViewController does not show UIDocumentPickerExtensionViewController app extensions in the list of sources. While these will be re-enabled in a future beta, please consider using an NSFileProviderExtension instead, as they are integrated in UIDocumentBrowserViewController instead of being presented in a separate sheet. (31975976)
(2)當拖動文件超過5項,文件移動/取消動畫使用一個默認的動畫啃奴。前五個文件夾系統(tǒng)調(diào)用移動/取消預覽視圖,即使它們沒有使用潭陪。在后面的測試,系統(tǒng)不會讓這些調(diào)用,而不是為動畫提供了一個額外的API與項目的自定義動畫不能應(yīng)用。
When dragging more than 5 items, the drop/cancel animation uses a default animation. The system calls the dropping/cancelling preview calls for the first 5 of these items, even though they are not used. In a later beta, the system will not make these calls, and instead provides an additional API for animating alongside items for which a custom animation cannot be applied. (32299785)
(3)使用UITargetedDragPreview和UIDragPreview而不是UIURLDragPreviewView最蕾,因為在下一個版本中這個API將會被移除(移除并不意味著消失依溯,有可能在測試版中開發(fā),正式版中成了私有API)
Do not use the class UIURLDragPreviewView as it will be removed in a later beta.To make drag previews of URLs, use UIDragPreview and UITargetedDragPreview. (32306613)
(4)在storyboard或者xib中揖膜,Xcode9之后的tableview顯示cell和header和footer將會更加的區(qū)分明顯(實際上就是storyboard的顯示細節(jié)小優(yōu)化)
Table views in Interface Builder documents compiled with Xcode 9.0 may have fixed heights for rows, section headers, and section footers, and may not self-size by default. (32188814)
(5)在iOS11中UITableView有了一個新的系統(tǒng)手勢可以快速選擇行:兩根手指快速的輕擊cell誓沸,可以同時選中兩個cell進入編輯狀態(tài)。如果兩個手指存在不同步問題壹粟,則會默認識別其中的一個手指表示單選cell
UITableView has a new system gesture for quickly selecting rows. A two-finger tap on table views that support multiple selection sets the table view to editing, if it is not already, and select the tapped row. Unlike a single-finger tap, which toggles selection, the two- finger tap always selects the tapped row and has no effect if the row is already selected. This new gesture is enabled only in apps built for iOS 11. (29127664)
(6)UITableView新增了一個屬性separatorInsetReference
,作用是可以自定義一個cell分割線的邊距
UITableView has a new property, separatorInsetReference, that changes how a custom value set in the separatorInset property is interpreted. By default, the value is .fromCellEdges, which means that custom separatorInset values are always interpreted as an inset from the edges of the cell, even in cases where table view would normally use larger automatic insets for the separator, such as a very wide table view when the cellLayoutMarginsFollowReadableWidth property is true
Set the separatorInsetReference to .fromAutomaticInsets to use the separatorInset as a fixed distance from the automatic inset that a table view would normally use
Note that you can always use UITableViewAutomaticDimension for any edge of the separatorInset that you set, to receive the automatic inset on that edge. (31000402)
(7)iOS11中拜隧,UITableView的cell或者表頭表尾默認采用自適應(yīng)高度的方案,當然如果之前的tableview不想使用這個功能可以直接禁掉趁仙,或者在自適應(yīng)高度代理中返回0即可
Table views now use estimated heights by default, which also means that cells and section header/footer views now self-size by default. The default value of the estimatedRowHeight, estimatedSectionHeaderHeight, and estimatedSectionFooterHeight properties is now UITableViewAutomaticDimension, which means the table view selects an estimated height to use. You should still provide a more accurate estimate for each property if possible, which is your best guess of the average value of the actual heights. If you have existing table view code that behaves differently when you build your app with the iOS 11 SDK, and you don’t want to adopt self-sizing, you can restore the previous behavior by disabling estimated heights by setting a value of zero for each estimated height property. (30197915)
(8)當UITableViewCell的內(nèi)容(主要是文本)高度過高時洪添,可以通過設(shè)置UITableViewCell的numberOfLines屬性來實現(xiàn)類似于UILabel一樣的高度自適應(yīng)變化
When the user selects one of the Accessibility Larger Text content sizes as their preferred content size, UITableViewCell uses a new default layout that is optimized for the larger sizes. The numberOfLines property of UITableViewCell labels (both textLabel and detailTextLabel) changes to 0 (unlimited) by default when the Accessibility content sizes are in use. You may override this by explicitly setting the numberOfLines property. The standard image view and accessory views are aligned with the first line of text in the cell, and cell text wraps around the image in order to maximize the amount of text displayed per line. For the Value1, Value2, and Subtitle styles, the detailTextLabel is arranged underneath the standard textLabel. For UISwitch accessory views, the switch is located below the labels and aligned with the leading edge of the text. Because of these changes, which increase the height of the cell content at Accessibility content sizes, it’s important to use self-sizing cells to ensure the row height increases as necessary, and to avoid using a fixed row height for all content sizes. (28102750)