Swift 3.0 更改項目
更改項目說明
SE-0002: Removing currying func declaration syntax
1 | // Before: |
SE-0003: Removing var from Function Parameters
為了避免使用者混淆 inout 宣告,所以移除 Parameters var
1 | func doSomethingWithVar(var i: Int) { |
SE-0004: Remove the ++ and – operators
1 | 移除 |
SE-0005: Better Translation of Objective-C APIs Into Swift
改進整合 OBJ-C API 到 Swift 中
SE-0006: Apply API Guidelines to the Standard Library
改一些 API 名稱
SE-0007: Remove C-style for-loops with conditions and incrementers
移除 C 語言的 for-loop,改用 Swift 的 for-in 和 stride
SE-0008: Add a Lazy flatMap for Sequences of Optionals
flatMap 有兩種版本寫法,原本只有其中一種有 lazy,現在另外一種也支援 lazy-flatmap-for-optionals
SE-0016: Adding initializers to Int and UInt to convert from UnsafePointer and UnsafeMutablePointer
加強 Swift pointer 的運算
SE-0017: Change Unmanaged to use UnsafePointer
測試 module 改進
SE-0023: API Design Guidelines
SE-0028: Modernizing Swift’s Debugging Identifiers (FILE, etc)
1 | 將原本 Snake case 命名改掉 |
SE-0029: Remove implicit tuple splat behavior from function applications
SE-0031: Adjusting inout Declarations for Type Decoration
調整 inout 宣告
SE-0032: Add first(where:) method to SequenceType
在 Sequence 類別中加入 first(where:) 方法
SE-0033: Import Objective-C Constants as Swift Types
將 OBJ-C 常數匯入成 Swift 的類型
SE-0034: Disambiguating Line Control Statements from Debugging Identifiers
SE-0037: Clarify interaction between comments & operators
註解在運算子旁邊的問題,改進某些 Case 會編譯錯誤
SE-0039: Modernizing Playground Literals
改進 Playground 中文宣告的問題
SE-0040: Replacing Equal Signs with Colons For Attribute Arguments
當比較 Attribute Arguments 時,使用冒號代替等號
SE-0043: Declare variables in ‘case’ labels with multiple patterns
改進在 switch 中宣告變數問題
SE-0046: Establish consistent label behavior across all parameters including first labels
SE-0047: Defaulting non-Void functions so they warn on unused results
typealias 泛型類別
SE-0049: Move @noescape and @autoclosure to be type attributes
SE-0053: Remove explicit use of let from Function Parameters
SE-0054: Abolish ImplicitlyUnwrappedOptional type
SE-0055: Make unsafe pointer nullability explicit using Optional
SE-0057: Importing Objective-C Lightweight Generics
SE-0059: Update API Naming Guidelines and Rewrite Set APIs Accordingly
SE-0061: Add Generic Result and Error Handling to autoreleasepool()
SE-0062: Referencing Objective-C key-paths
SE-0064: Referencing the Objective-C selector of property getters and setters
SE-0065: A New Model For Collections and Indices
SE-0066: Standardize function type argument syntax to require parentheses
SE-0069: Mutability and Foundation Value Types
SE-0070: Make Optional Requirements Objective-C-only
SE-0071: Allow (most) keywords in member references
SE-0085: Package Manager Command Names
SE-0094: Add sequence(first:next:) and sequence(state:next:) to the stdlib