Swift 2, Beta 5
August 06, 2015
Here is a quick rundown of some of the changes in Beta 5 posted today. For the full details as always check out the release notes
- Structs and classes can conform to
- Non-failable initializers can now chain to failable initializers by using
- Debug builds should have better performance due to using pre-specialized generics in the standard library
- Generic subclasses of Objective-C classes are no longer exposed in the bridging header
removeAtIndexreturns a key-value tuple (matching Ar
@NSManagedcan now be used with methods and properties so you can deal with the automatically generated KVC accessors
- You can now reflect on enum instances to get the current case if the enum has a payload; there will be one child where the label is the case name and the value is a tuple containing the payload. Unfortunately to handle a case without a payload you can't use the mirror (use String interpolation instead), nor can you get a list of the enum cases by reflecting the type.
forEachto let you apply a function to each element
- SIMD integer vectors only support the unchecked operators (because that's how the underlying hardware works in most cases anyway). For those who may have forgotten, operators like
&-are not checked for overflow or underflow.
- The confusing
UWordtypes were removed; just use
- The Swift migrator doesn't generate spurious build errors
- The full documentation for the Swift standard library is now shown in Xcode (yay!)
- Changing the body of a function should no longer trigger rebuilding of dependencies; this should speed up builds by a decent amount in many cases
- The ambiguous "Type checker diagnostics continue to improve in precision and specificity". I have no idea how extensive this is yet.
- The compiler no longer crashes when a generic struct contains a weak or unowned reference
Still Bugs or New Bugs
- LLDB enforces
trywhich is not intentional
- Use of
guard letat the top level of a playground or script may result in memory corruption(!); this bug gets an explicit "will be fixed before release" mention.
This blog represents my own personal opinion and is not endorsed by my employer.