Code-free
Code-free

Swift 2.1

Russ Bishop
September 23, 2015

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 Equatable so now they work in pattern . . .

Read More

Swift 2: Beta 6

Russ Bishop
August 26, 2015

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 nil is returned. This seems like a pragmatic compromise but I have to imagine someone lost a . . .

Read More

Type & Self

Way too meta

Russ Bishop
August 19, 2015

In Objective-C, every class is an instance of its metaclass.

What about Swift? If you've looked closely at the Swift Language Reference you'll see two short paragraphs describing SomeClass.self and SomeClass.Type, a short example (that doesn't address Type at all), and that's it.

Meta

In Swift, all . . .

Read More

Swift 2, Beta 5

Russ Bishop
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 ErrorType
  • Non-failable initializers can now chain to failable initializers by using !
  • Debug builds should have better performance due to using . . .

Read More

Swift Quickie: MirrorType Extension

Russ Bishop
July 23, 2015

edit: 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 . . .

Read More

Swift 2: SIMD

Single Instruction, Multiple Awesome

Russ Bishop
June 24, 2015

Swift 2 brings updated support for SIMD (Single Instruction Multiple Data). What exactly does that mean?

SIMD Primer

Lanes

Each CPU vendor has their own unique snowflake versionÂș but the premise is the same: process data in parallel chunks. Each SIMD instruction operates on a group of values organized into what are . . .

Read More

Swift 2, Beta 2

Quick Recap

Russ Bishop
June 23, 2015

A quick recap for those who haven't parsed the release notes yet:

New Features

  • Enum cases with values can be used as a function; basically the compiler automatically creates a function that accepts parameters matching the case's values and returns that enum case with the values filled in.
  • Non-mutating . . .

Read More

Archive
   Subscribe by email and never miss a post.