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.

熱門文章
山陀兒清晨在台灣上空「原地解散」史上第2 23年前潭美引發水災5死
山陀兒清晨在台灣上空「原地解散」史上第2 23年前潭美引發水災5死

上報Up Media

逾30隻流浪犬頻追車 深夜嚇壞經過騎士
逾30隻流浪犬頻追車 深夜嚇壞經過騎士

CTWANT

明13縣市恐停班停課! 「北北基颱風假」風雨達標了
明13縣市恐停班停課! 「北北基颱風假」風雨達標了

TVBS新聞網

「山陀兒」恐原地解散!全台保底2天假 鄉民狂讚「模範勞工颱風」
「山陀兒」恐原地解散!全台保底2天假 鄉民狂讚「模範勞工颱風」

中天新聞

拚一次吧!大樂透頭獎今晚飆4.1億 「3生肖」偏財運爆棚有機會發大財
拚一次吧!大樂透頭獎今晚飆4.1億 「3生肖」偏財運爆棚有機會發大財

中天新聞

難抵山陀兒強風! 3超商店員「擋門被吹飛」
難抵山陀兒強風! 3超商店員「擋門被吹飛」

TVBS新聞網

《不熙娣》班底替跨性別者出櫃!電視台也不挺宣布封殺:暫停邀她上節目
《不熙娣》班底替跨性別者出櫃!電視台也不挺宣布封殺:暫停邀她上節目

CTWANT

公費流感與新冠疫苗同步開打 50歲以上小心帶狀疱疹來襲
公費流感與新冠疫苗同步開打 50歲以上小心帶狀疱疹來襲

I-Media 愛傳媒

「I人」董仔、八弟、Leo王出發彰化找廣告委託主 八弟形容:災難現場
「I人」董仔、八弟、Leo王出發彰化找廣告委託主 八弟形容:災難現場

公共電視

影/連2天颱風假「這族群」影響最大 郭正亮:收入少了4千元
影/連2天颱風假「這族群」影響最大 郭正亮:收入少了4千元

中天新聞

新/名嘴張友驊跌倒「頭部重創」命危! 妻子見狀報案送醫
新/名嘴張友驊跌倒「頭部重創」命危! 妻子見狀報案送醫

記者爆料網

柯以柔喜迎45歲生日!甜蜜合照男友曬恩愛 得到夢想禮物
柯以柔喜迎45歲生日!甜蜜合照男友曬恩愛 得到夢想禮物

記者爆料網

高雄、屏東連放4天!「這地方」緊急停班課 10/4最新颱風假資訊一覽
高雄、屏東連放4天!「這地方」緊急停班課 10/4最新颱風假資訊一覽

中天新聞

快訊/深夜嚴重走山!基隆新豐街遭黃泥土掩蓋 傷亡人數尚不明
快訊/深夜嚴重走山!基隆新豐街遭黃泥土掩蓋 傷亡人數尚不明

中天新聞

安泰醫院9死!病患摸黑臉貼地爬出逃生 員工胞兄悲認屍:弟說醫院比家重要
安泰醫院9死!病患摸黑臉貼地爬出逃生 員工胞兄悲認屍:弟說醫院比家重要

CTWANT

週五台灣還能再放颱風假?戴立綱「一句話」笑翻全網5000人
週五台灣還能再放颱風假?戴立綱「一句話」笑翻全網5000人

中天新聞

90
0
分享