swift 3.0 版本即將於年底上市...大家挫咧等??

swift 3.0 版本即將於年底上市...大家挫咧等??

ilyi1116 2016-05-25 14:31

The design of commonly-used libraries has a large impact on the overall feel of a programming language. Great libraries feel like an extension of the language itself, and consistency across libraries elevates the overall development experience. To aid in the construction of great Swift libraries, one of the major goals for Swift 3 is to define a set of API design guidelines and to apply those design guidelines consistently.

The effort to define the Swift API Design Guidelines involves several major pieces that, together, are intended to provide a more cohesive feel to Swift development. Those major pieces are:

  • Swift API Design Guidelines: The actual API design guidelines are under active development. The latest draft of Swift API Design Guidelines is available.

  • Swift Standard Library: The entire Swift standard library is being reviewed and updated to follow the Swift API design guidelines. The actual work is being performed on the swift-3-api-guidelines branch of the Swift repository.

  • Imported Objective-C APIs: The translation of Objective-C APIs into Swift is being updated to make Objective-C APIs better match the Swift API design guidelines, using a variety of heuristics. The Better Translation of Objective-C APIs into Swift proposal describes how this transformation is done. Because this approach naturally involves a number of heuristics, we track its effects on the Cocoa and Cocoa Touch frameworks, as well as Swift code using those frameworks. The Swift 3 API Design Guidelines Review repository provides a way to see how this automatic translation affects Swift code that uses Cocoa and Cocoa Touch. Specific Objective-C APIs that translate poorly into Swift will then be annotated (for example, with NS_SWIFT_NAME) to improve the resulting Swift code. While this change primarily impacts Apple platforms (where Swift uses the Objective-C runtime), it also has a direct impact on the cross-platform Swift core libraries that provide the same APIs as Objective-C frameworks.

  • Swift Guideline Checking: Existing Swift code has been written to follow a variety of different coding styles, including the Objective-C Coding Guidelines for Cocoa. By leveraging the heuristics used to import Objective-C APIs, the Swift compiler can (optionally!) check for common API design patterns that don’t meet the Swift API Design Guidelines and suggest improvements.

  • Swift 2 to Swift 3 Migrator: The updates to the Swift standard library and the imported Objective-C APIs are source-breaking changes. This effort will involve the creation of a migrator to update Swift 2 code to use the Swift 3 APIs.

All of these major pieces are under active development. If you’re interested in following along, check out the Swift API design guidelines, the Swift standard library changes, the Objective-C API importer changes proposal and correspondingreview repository, then join the discussion on the swift-evolution mailing list.

熱門文章
彭振聲、邵琇珮力求法官減刑 他100天失去2至親今仍難平復
彭振聲、邵琇珮力求法官減刑 他100天失去2至親今仍難平復

CTWANT

無業男張文無就醫紀錄!曾當月薪4萬保全「母有小額資助」
無業男張文無就醫紀錄!曾當月薪4萬保全「母有小額資助」

中天新聞

福原愛宣布「再婚且懷孕」 親揭與橫濱男交往時間點
福原愛宣布「再婚且懷孕」 親揭與橫濱男交往時間點

中天新聞

中山站遭砍騎士生前緊握手機「最後畫面」曝 網淚:疑想給家人交代
中山站遭砍騎士生前緊握手機「最後畫面」曝 網淚:疑想給家人交代

CTWANT

張文父母需要「變賣家產」賠償被害人? 律師解答了
張文父母需要「變賣家產」賠償被害人? 律師解答了

CTWANT

「開車撞死張文會怎樣」掀熱議 律師解答
「開車撞死張文會怎樣」掀熱議 律師解答

中天新聞

57歲余家昶捨命擋下張文「一整箱汽油彈」 阻斷一場大屠殺
57歲余家昶捨命擋下張文「一整箱汽油彈」 阻斷一場大屠殺

中天新聞

北捷遭恐攻秒啟動疏散模式 閘門顯示「7字」被網讚爆
北捷遭恐攻秒啟動疏散模式 閘門顯示「7字」被網讚爆

中天新聞

張文冷血奪3命!國中求學經歷曝光 母校呼籲勿標籤化
張文冷血奪3命!國中求學經歷曝光 母校呼籲勿標籤化

中天新聞

網友恐嚇下一站台中三越「目標50人」 玖壹壹春風發聲
網友恐嚇下一站台中三越「目標50人」 玖壹壹春風發聲

記者爆料網

新北也出現張文模仿犯?19歲男噴「中山砍人不揪」遭送辦
新北也出現張文模仿犯?19歲男噴「中山砍人不揪」遭送辦

中天新聞

爸當工程師、媽是會計 張文「家境小康」不滿爸管太嚴2年不跟家人聯絡
爸當工程師、媽是會計 張文「家境小康」不滿爸管太嚴2年不跟家人聯絡

CTWANT

高雄「老牌周燒肉飯」違反勞基法挨告 判賠2退休員工逾百萬
高雄「老牌周燒肉飯」違反勞基法挨告 判賠2退休員工逾百萬

CTWANT

張文失業1年、2年無就醫紀錄「資金來源成謎」 母偶爾小額匯款
張文失業1年、2年無就醫紀錄「資金來源成謎」 母偶爾小額匯款

CTWANT

90
0
分享