A small detour
In Xcode 7 Clang learned a new trick: Objective-C generics. Now that I've started using this feature in our legacy code I can't live without it. Even without Swift interop consequences I would still use it.
Objective-C can now declare that an
NSArray is an
NSArray<NSString *>. This helps on the Objective-C side by . . .
Another day, another Xcode beta.
IDE & Playgrounds
- You can now set Swift Error breakpoints, including restricting the breakpoint to specific error types.
- The in-playground API has been revamped.
XCPlaygroundPage.currentPagenow grants a reference to the current page.
- The playground live view support has been enhanced. Types can adopt
. . .
If you thought Apple was slowing down with Swift, think again. Xcode 7.1 Beta 2 includes Swift 2.1. As always you can check the release notes for yourself because I don't necessarily address everything here.
Interop & Types
- Enums imported from C automatically conform to
Equatableso now they work in pattern matching switch statements . . .
Some highlights from Beta 6:
Compiler & Tools
- A new
try?keyword has been added. This attempts an operation that may throw (fail). If it succeeds the result is wrapped in an optional. If it fails the error is ignored and
nilis returned. This seems like a pragmatic compromise but I have to imagine someone lost a battle somewhere because . . .
Way too meta
What about Swift? If you've looked closely at the Swift Language Reference you'll see two short paragraphs describing
SomeClass.Type, a short example (that doesn't address
Type at all), and that's it.
In Swift, all types have metatypes, not . . .
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 . . .
Mirror struct now has a
children property that you can indeed iterate over so this isn't really applicable anymore but the sequence stuff is still relevant. You can check out Rob Napier's post about AnySequence for more info.
I've been playing with the new reflection API in Swift 2 and found one constant annoyance:
. . .