Monthly Archives: July 2014

Swift: workaround for closure as protocol

Swift Language

In Java, it was common to implement callbacks as anonymous classes. It was nice to be able to define the callback right where you define the button. Here is a simple JButton ActionListener example:

Wouldn’t it be cool to do the same thing in Swift? Let’s create a Swift protocol. Just a single method […]

Posted in Swift | Tagged , , | Leave a comment

UIActivityViewController in Swift

Swift Language

Just a simple example of using the UIActivityViewController in Swift. You need to be logged into Facebook and Twitter for the options to share to them shows up. You can do this in the simulator by going to the settings app. If you do not log in, then you will just see Mail and Copy […]

Posted in Swift | Tagged , , | Leave a comment