Updated to compile with V1.0 swift.

This example was so amazingly helpful to me, I just had to contribute back with a few humble changes to enable things to compile with v1.0 swift.