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.

熱門文章
駕照怎麼考的?三寶「螃蟹女」挑戰學長失敗還肇逃 被抓後竟稱太害怕不知怎麼辦?
駕照怎麼考的?三寶「螃蟹女」挑戰學長失敗還肇逃 被抓後竟稱太害怕不知怎麼辦?

記者爆料網

鋒面入夜殺來!「半個台灣」雷雨狂炸 這天風雨更大
鋒面入夜殺來!「半個台灣」雷雨狂炸 這天風雨更大

TVBS新聞網

穀雨禁忌一次看!「4生肖」難躲血光之災 命理師:嚴重恐致死
穀雨禁忌一次看!「4生肖」難躲血光之災 命理師:嚴重恐致死

TVBS新聞網

宜蘭小轎車天雨失控撞飛修剪花草男  摔至快車道又遭撞
宜蘭小轎車天雨失控撞飛修剪花草男  摔至快車道又遭撞

記者爆料網

2024圓臉適合髮型推薦!高層次剪、公主切進化版超顯臉小、這款短髮初戀感滿分!
2024圓臉適合髮型推薦!高層次剪、公主切進化版超顯臉小、這款短髮初戀感滿分!

BEAUTY美人圈

影/打開餐盒蛆在爬!桃園4.5星燒臘飯出事 「保護色」活體蠕動畫面曝
影/打開餐盒蛆在爬!桃園4.5星燒臘飯出事 「保護色」活體蠕動畫面曝

中天新聞

屏東17歲「跳舞妖精」超高人氣!最新熱舞影片網瘋看:可以出道了
屏東17歲「跳舞妖精」超高人氣!最新熱舞影片網瘋看:可以出道了

中天新聞

當天還上傳影片…90萬「飛飛一杯酒」心臟病猝逝 享年34歲
當天還上傳影片…90萬「飛飛一杯酒」心臟病猝逝 享年34歲

中天新聞

5歲童上課走丟媽媽急瘋!新北早療診所竟嗆:我們不是安親班
5歲童上課走丟媽媽急瘋!新北早療診所竟嗆:我們不是安親班

TVBS新聞網

台北市要發錢了!限量1500元運動金快來領 逾百間館場都能用
台北市要發錢了!限量1500元運動金快來領 逾百間館場都能用

中天新聞

剴剴之死/北檢詳列惡保母罪狀 塞水桶、頭撞牆、冬天赤裸⋯慘不忍睹
剴剴之死/北檢詳列惡保母罪狀 塞水桶、頭撞牆、冬天赤裸⋯慘不忍睹

CTWANT

拿香油錢簽賭!麻豆代天府廟務私吞百萬 坦承買運彩「全賠光」
拿香油錢簽賭!麻豆代天府廟務私吞百萬 坦承買運彩「全賠光」

中天新聞

90
0
分享