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.

熱門文章
8.7超級大震恐襲台?專家大膽預警1事
8.7超級大震恐襲台?專家大膽預警1事

中天新聞

影/印度神童預言再中 最新預言警告台灣、美國、中國、印度小心10件事 特別注意5月
影/印度神童預言再中 最新預言警告台灣、美國、中國、印度小心10件事 特別注意5月

中天新聞

印度神童最新預言曝光 台灣、美國、中國小心7件事 警告注意4、5、6月
印度神童最新預言曝光 台灣、美國、中國小心7件事 警告注意4、5、6月

中天新聞

張書偉、謝京穎絕美婚紗照曝光!4款造型藏暖心故事 婚禮確認:6/9舉行
張書偉、謝京穎絕美婚紗照曝光!4款造型藏暖心故事 婚禮確認:6/9舉行

LIFE生活網記者-郭懿慧

擱是詐騙!台中辣妹荷官暈船牛郎 奔現等無人「收竹聯戰堂血腥照」求買遊戲點數
擱是詐騙!台中辣妹荷官暈船牛郎 奔現等無人「收竹聯戰堂血腥照」求買遊戲點數

CTWANT

再撐4天!5月「4生肖」財運大爆發 升官加薪買樂透也賺
再撐4天!5月「4生肖」財運大爆發 升官加薪買樂透也賺

TVBS新聞網

早知黃子佼有性癖?卜學亮首露面吐真相 不願切割:還是朋友
早知黃子佼有性癖?卜學亮首露面吐真相 不願切割:還是朋友

中天新聞

立夏悄然而至!「4生肖」事業將飛黃騰達 成為眾人羨慕對象
立夏悄然而至!「4生肖」事業將飛黃騰達 成為眾人羨慕對象

中天新聞

倒數3個月!LINE「Keep」7/31終止服務 3招輕鬆備份
倒數3個月!LINE「Keep」7/31終止服務 3招輕鬆備份

中天新聞

台餐飲集團「驚爆倒閉」!500人失業 30間門市一排倒
台餐飲集團「驚爆倒閉」!500人失業 30間門市一排倒

TVBS新聞網

李芷婷無罩入鏡被讚深夜福利!網友直指:激凸了 她認不舒服
李芷婷無罩入鏡被讚深夜福利!網友直指:激凸了 她認不舒服

中天新聞

同款衛生紙,酷澎便宜4成!燒錢燒到原廠都怕...「韓國亞馬遜」為何流血低價出貨,也要拿下台灣市場?
同款衛生紙,酷澎便宜4成!燒錢燒到原廠都怕...「韓國亞馬遜」為何流血低價出貨,也要拿下台灣市場?

今周刊

90
0
分享