Read What’s new in Swift 5.0; Watched String Interpolation in Swift 5 (Part 2)
Watched String Interpolation in Swift 5 (Part 2).
Read What’s new in Swift 5.0:
Resultis now part of Swift bringing new features:get()method either returning the successful value or throwing error- initializer accepting a throwing closure makes possible
let r = Result { try String(contentsOfFile: f) } - general
Errorprotocol could be used, rather than usingResult<Int, NetworkError>could useResult<Int, Error>
- raw strings;
- customizable string interpolation bring absolutely crazy stuff. should experiment with it (TODO:);
@dynamicCallableserves for Python or JavaScript bridging but could be used for creating some creasy stuff;@unknownfor handling future enum cases;- nested optionals resulting from
try?are flattened; isMultiple(of:)for checks likerowNumber % 2 == 0;compactMapValues()in dictionaries for transforming values while keeping keys intact;count(where:)was discarded in betatesting, may be will return in later swift versions;
Other sources mention also:
- Conform Never to Equatable and Hashable;
- Add Unicode Properties to Unicode.Scalar
isAlphabetic,isASCIIHexDigitand so on; - Character Properties like
isASCII; - Add Codable conformance to Range types.
By the way, CHANGELOG is available!