轉(zhuǎn)載請(qǐng)標(biāo)注出處:www.reibang.com/p/1167d2ecd0ac:,以及版權(quán)歸屬黑馬程序員:http://www.itheima.com
2017年6月6日凌晨一點(diǎn)(北京時(shí)間),蘋果在2017WWDC大會(huì)上發(fā)布了全新的iOS11系統(tǒng)〈参矗可能大家印象比較深刻的就是iOS11新增了增強(qiáng)現(xiàn)實(shí)的框架ARKit和安卓玩了幾十年都玩爛了的文件管理系統(tǒng),那么除此之外iOS11又新增了哪些功能呢炕柔?這正是文本要介紹的。
本文翻譯自蘋果官方iOS11發(fā)行說明文檔:http://adcdownload.apple.com/Documentation/Beta_Release_Notes_Jun_5_2017/iOS_11_beta_Release_Notes.pdf购撼,由于很難做到逐條測(cè)試跪削,如果翻譯有誤還請(qǐng)多多指教.
凡是沒有原文標(biāo)示的均是筆者的翻譯,小括號(hào)內(nèi)的文字是筆者的見解迂求,凡是帶原文標(biāo)示的英文均是蘋果文檔的原文碾盐,英文后面的小括號(hào)是蘋果官網(wǎng)文檔說明編號(hào),類似于identifier
有一些不是特別重要揩局,基本上對(duì)于我們開發(fā)沒有什么用處的毫玖,我就忽略了,所以本文中所有的內(nèi)容都是與我們iOS開發(fā)人員相關(guān)的功能大全
(1)開發(fā)者從iOS11之后再也不用學(xué)習(xí)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會(huì)留下一個(gè)占位符APP(言外之意就是在iOS11后如果通過iTunes同步一個(gè)32位的APP到你的iOS社會(huì)只會(huì)留下一個(gè)空白的APP凌盯,無法運(yùn)行)
原文:Syncing 32-bit apps via iTunes leaves a placeholder for the app. (32356790)
(3)?如果在Xcode的target中勾選系統(tǒng)版本為iOS10或者之前的系統(tǒng)付枫,將會(huì)繼續(xù)兼容32位APP(再次強(qiáng)調(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正式退出歷史舞臺(tái)
(1)?對(duì)于能識(shí)別到是電話號(hào)碼阐滩,地址等能夠響應(yīng)系統(tǒng)事件的文本對(duì)象(比如點(diǎn)擊號(hào)碼自動(dòng)撥號(hào)),3D Touch不生效
原文:Using 3D Touch with data detectors (phone numbers, addresses, etc.) does not work. (30504832)
3. 第三方應(yīng)用 (3rd Party Apps)
這里比較多县忌,對(duì)開發(fā)而言意義不大掂榔,我就撿幾條重點(diǎn)的說了
(1)使用?Facebook Messenger之前必須要安裝Facebook應(yīng)用(國(guó)內(nèi)撲街)
原文:Facebook Messenger doesn't launch without the Facebook app installed
(2)最重要:?第三方鍵盤如果沒有選擇允許完全訪問有可能會(huì)出現(xiàn)崩潰問題(iOS10之后蘋果支持第三方鍵盤继效,具體設(shè)置在通用——鍵盤選項(xiàng)中)
原文:Third-party keyboards may crash if not allowed full access.
(3)?如果是Skyce通過可能會(huì)讓音頻播放掉線(靜音)
原文:The audio may drop during Skype calls. (32434672)
ARKit是iOS11的最大亮點(diǎn),筆者將會(huì)在后續(xù)同步刷新ARKit框架開發(fā)教程
(1)兩件事装获,一是在調(diào)試ARSession的時(shí)候如果打斷點(diǎn)的時(shí)候就會(huì)導(dǎo)致出現(xiàn)VIO 斷點(diǎn)的情況(就是訪問硬件內(nèi)存泄露的一種崩潰斷點(diǎn)瑞信,不打的話程序就不會(huì)有問題) 二是在AR增強(qiáng)現(xiàn)實(shí)中的錨點(diǎn)是不可見的(理解比較困難,筆者將會(huì)在后續(xù)更新ARKit框架學(xué)習(xí)和開發(fā)博客供讀者學(xué)習(xí)交流)
原文: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(該類主要負(fù)責(zé)跟蹤AR設(shè)備方向的一些高級(jí)配置)類只有在A9芯片設(shè)備(iPhone6s)及iOS11系統(tǒng)之后才會(huì)生效
原文: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(該類負(fù)責(zé):配置跟蹤設(shè)備的方向和位置,以及檢測(cè)設(shè)備攝像頭看到的現(xiàn)實(shí)世界的表面)也是要A9芯片及以后穴豫,同上
原文:ARWorldTrackingSessionConfiguration is only supported on iOS devices with an A9 or later processor.
AVFoundation更新比較多喧伞,但是設(shè)計(jì)的內(nèi)容比較少,主要是在自定義相機(jī)環(huán)節(jié)開始全面支持雙攝像頭物理變焦的攝像頭捕捉到的高清圖像(為即將要發(fā)布的iPhone8做準(zhǔn)備绩郎,其實(shí)這個(gè)對(duì)象在iOS10已經(jīng)出來潘鲫,當(dāng)時(shí)只有7plus才有雙攝像頭所以開發(fā)中用的極少)
這里筆者就不一一翻譯了,就是自定義相機(jī)中幾個(gè)iOS10新增的API以前返回的nil現(xiàn)在做了優(yōu)化
? TheCGImageRepresentationandpreviewCGImageRepresentationmethodsof AVCapturePhoto alwaysreturnnil. Inafuture beta, they willreturnnon-nil values. For more detail, seethedocumentation. (31392054)? AVCapturePhoto returns nil when accessingthefileDataRepresentation propertyofanuncompressed buffer (420f/420v/BGRA), insteadofaTIFFfileformatrepresentation. (31902960)? ThecameraCalibrationDatapropertyofAVCapturePhotoreturnsnilwhen cameraCalibrationDataDeliveryEnabled issettotrue, unless you alsosetdepthDataDeliveryEnabledtotrue. Inafuture beta, you’ll be abletorequest dual photo captureandcamera calibration data captureandreceive wideandtelephoto buffers plusthecamera calibration dataforboth (withoutbeing zoomedto2xanddelivering depth datatothephoto). (32209427)? ThevaluesofthelensDistortionLookupTableand inverseLensDistortionLookupTable propertiesofAVCameraCalibrationData are erroneously centered around1.0. This means thatapoint alongtheradiuswithno elongationorshrinkage is reportedas1.0. Inafuture beta,thevaluesinthis lookup table will change:0will mean no elongationorshrinkage. (32339695)Copyright ?2017Apple Inc. All Rights Reserved. Page5of16? Still capture requests failandthevideo stream stops producingabuffer whenusingthe720p30 videoformatwiththedepthDataDeliveryEnabled propertyofAVCapturePhotoSettingssettotrue. (32060882)? Depthvaluesinthenon-default160x120and160x90depthdataformatsarehalfofthe expected valuesanddisparity values are twicetheexpectedvalue. (32363942)
大概意思就是測(cè)試版的系統(tǒng)(正式版要到17年9月份發(fā)布)藍(lán)牙不穩(wěn)定肋杖,iAP協(xié)議是蘋果官方的藍(lán)牙4.0協(xié)議
? Bluetooth accessoriesusingWireless iAP protocol may see connection issuesincertain cases. (31439542)? This betacontainsheadersfortheLE L2CAP channel feature. Full functionality will be availableinthealater beta. (32493297)
(1)將數(shù)據(jù)存儲(chǔ)到一個(gè)非默認(rèn)的響應(yīng)事件可能會(huì)失敗
Storing data to a non default event store in EventKit may not work. (31335830)
主要更新在網(wǎng)絡(luò)請(qǐng)求URLSessionTask這一部分
第三點(diǎn)相當(dāng)牛逼溉仑,網(wǎng)絡(luò)請(qǐng)求能夠等待安全網(wǎng)絡(luò)才請(qǐng)求,這對(duì)于開發(fā)而言意義重大状植。筆者將會(huì)在后期上代碼測(cè)試
(1)比較長(zhǎng)浊竟,大概的意思就是加了一些API,支持應(yīng)用程序退后后臺(tái)時(shí)仍然能與你的Watch(蘋果手表)通訊津畸。(蘋果手表網(wǎng)絡(luò)請(qǐng)求依賴于手機(jī)連接的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ò)下載進(jìn)度建議使用新屬性
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)添加了一個(gè)更加靈活的網(wǎng)絡(luò)請(qǐng)求API振定,它能夠等待直到你的手機(jī)連接上了安全的網(wǎng)絡(luò),如果是不安全的網(wǎng)絡(luò)則該網(wǎng)絡(luò)請(qǐng)求不會(huì)調(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í)的一些數(shù)據(jù)編碼支持肉拓。(對(duì)開發(fā)意義不大后频,后面一大堆是舉例說明,br指的是web前端的換行標(biāo)簽)
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)
最后一個(gè)環(huán)節(jié)是iOS開發(fā)中一半以上代碼都出自這個(gè)框架暖途,大家猜到了么卑惜? 不錯(cuò)!就是UIKit框架
UIKit框架在iOS11中解決了一個(gè)UITableView問題驻售,新增了一堆代碼(主要與新功能文件管理有關(guān))
本次iOS11系統(tǒng)更新UIKit較多露久,主要是因?yàn)閕OS11新增的文件管理功能并沒有提供單獨(dú)的框架,而是被直接繼承在UIKit框架中欺栗,測(cè)試版問題比較多毫痕,實(shí)際還是以正式版為準(zhǔn)
關(guān)于iOS11文件管理功能的開發(fā),筆者將會(huì)后續(xù)提供教程學(xué)習(xí)交流
此次iOS11關(guān)于UITableView的優(yōu)化也比較多迟几,筆者將會(huì)在后續(xù)深入研究探索供大家學(xué)習(xí)交流
設(shè)置UITableView的delaysContentTouches延遲響應(yīng)屬性為NO消请,再也不會(huì)立即觸發(fā)cell的響應(yīng)事件(delaysContentTouches是UIScrollerView的屬性,叫做延遲響應(yīng)處理瘤旨。默認(rèn)為YES延遲處理梯啤,作用就是當(dāng)點(diǎn)擊scrollerview中的按鈕時(shí)不會(huì)被系統(tǒng)判定為ScrollerView的滾動(dòng)手勢(shì),對(duì)這個(gè)屬性不了解的小白們可以百度哈存哲,這里筆者不再詳細(xì)累述)
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(顯示沙盒文件瀏覽器)不會(huì)顯示UIDocumentPickerExtensionViewController列表中的應(yīng)用程序擴(kuò)展來源因宇。雖然這些會(huì)在將在的測(cè)試版中重新啟用,請(qǐng)考慮使用一個(gè)NSFileProviderExtension相反,因?yàn)樗鼈兪羌稍赨IDocumentBrowserViewController而不是在一個(gè)單獨(dú)的表
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)當(dāng)拖動(dòng)文件超過5項(xiàng),文件移動(dòng)/取消動(dòng)畫使用一個(gè)默認(rèn)的動(dòng)畫七婴。前五個(gè)文件夾系統(tǒng)調(diào)用移動(dòng)/取消預(yù)覽視圖,即使它們沒有使用。在后面的測(cè)試,系統(tǒng)不會(huì)讓這些調(diào)用,而不是為動(dòng)畫提供了一個(gè)額外的API與項(xiàng)目的自定義動(dòng)畫不能應(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打厘,因?yàn)樵谙乱粋€(gè)版本中這個(gè)API將會(huì)被移除(移除并不意味著消失,有可能在測(cè)試版中開發(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將會(huì)更加的區(qū)分明顯(實(shí)際上就是storyboard的顯示細(xì)節(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有了一個(gè)新的系統(tǒng)手勢(shì)可以快速選擇行:兩根手指快速的輕擊cell,可以同時(shí)選中兩個(gè)cell進(jìn)入編輯狀態(tài)饲化。如果兩個(gè)手指存在不同步問題莽鸭,則會(huì)默認(rèn)識(shí)別其中的一個(gè)手指表示單選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新增了一個(gè)屬性separatorInsetReference,作用是可以自定義一個(gè)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或者表頭表尾默認(rèn)采用自適應(yīng)高度的方案吃靠,當(dāng)然如果之前的tableview不想使用這個(gè)功能可以直接禁掉硫眨,或者在自適應(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)當(dāng)UITableViewCell的內(nèi)容(主要是文本)高度過高時(shí),可以通過設(shè)置UITableViewCell的numberOfLines屬性來實(shí)現(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)
以上就是筆者挑選了大部分與開發(fā)有一定關(guān)系的更新翻譯巢块,其他的一些比如iCloundKit礁阁,Apple Music等國(guó)內(nèi)使用率較少的更新筆者就沒有翻譯了,后期筆者將會(huì)用代碼進(jìn)一步深入研究iOS11的新功能帶來的美妙體驗(yàn)族奢,敬請(qǐng)期待姥闭!