Swift 3.0 閱讀準備
swift-evolution
2016-02-16
Proposals (Swift 2.2 已實現)
1 Allow (most) keywords as argument labels
主要訴求:在參數中可使用 `關鍵字(keywords)`
1 | indexOf(value, in: collection) |
1 | indexOf(value, `in`: collection) |
11 Replace typealias
keyword with associatedtype
for associated type declarations
14 Constraining AnySequence.init
15 Tuple comparison operators
主要訴求:節省 tuple comparison implement code 的麻煩事。
1 | @warn_unused_result |
20 Swift Language Version Build Configuration
21 Naming Functions with Argument Labels
22 Referencing the Objective-C selector of a method
主要訴求:Selector 去 String 化。
1 | // Instead of this: |
Proposals (Swift 2.2 已採用)
8 Add a Lazy flatMap for Sequences of Optionals
Proposals (Swift 3 已實現)
3 Removing var
from Function Parameters
5 Better Translation of Objective-C APIs Into Swift
6 Apply API Guidelines to the Standard Library
19 Swift Testing
23 同6 API Design Guidelines
28 Modernizing Swift’s Debugging Identifiers
31 Adjusting inout
Declarations for Type Decoration
34 Disambiguating Line Control Statements from Debugging Identifiers
37 Clarify interaction between comments & operators
40 Replacing Equal Signs with Colons For Attribute Arguments
43 Declare variables in ‘case’ labels with multiple patterns
53 Remove explicit use of let from Function Parameters
Proposals (Swift 3 已採用)
2 Removing currying func
declaration syntax
4 Remove the ++
and --
operators
7 Remove C-style for-loops with conditions and incrementers
16 Add initializers to Int and UInt to convert from UnsafePointer and UnsafeMutablePointer
29 Remove implicit tuple splat behavior from function applications
33 Import Objective-C Constants as Swift Types
35 Limiting inout
capture to @noescape
contexts
38 Package Manager C Language Target Support
39 Modernizing Playground Literals
42 Flattening the function type of unapplied method references
44 Import as member
46 Establish consistent label behavior across all parameters including first labels
47 Defaulting non-Void functions so they warn on unused results
54 Abolish ImplicitlyUnwrappedOptional type
55 Make unsafe pointer nullability explicit using Optional
Swift org
- Its Coming: the Great Swift API Transformation
Class 去除NS
方法 去除withXX
1 | class UIBezierPath : NSObject, NSCopying, NSCoding { ... } |
1 | class UIBezierPath : Object, Copying, Coding { ... } |