invasivecode:


Singletons in Swift

In this post, I will to demonstrate one particular way of creating singletons in Swift. But, before starting, let me just say: Swift is a very powerful programming language that allows developers to construct the same functionality in multiple ways. Therefore, the following example is just one way of building a singleton in Swift.

Generally, I discourage the use of singletons, as instantiating an object that will last forever is not good design. Instead, I prefer letting ARC do the memory management and letting ARC decide when to release an object or keep it alive. Additionally, there’s always an alternative way to build what you are trying to do with a singleton.

Read More

invasivecode:

Singletons in Swift

In this post, I will to demonstrate one particular way of creating singletons in Swift. But, before starting, let me just say: Swift is a very powerful programming language that allows developers to construct the same functionality in multiple ways. Therefore, the following example is just one way of building a singleton in Swift.

Generally, I discourage the use of singletons, as instantiating an object that will last forever is not good design. Instead, I prefer letting ARC do the memory management and letting ARC decide when to release an object or keep it alive. Additionally, there’s always an alternative way to build what you are trying to do with a singleton.

Read More

invasivecode:


Objective-C selectors in Swift

I was building new exercises in Swift—Apple’s new development language—for our upcoming iOS training class in San Francisco, and when combining Swift and Cocoa Touch, I discovered something really interesting.

In particular, for this tutorial, I will examine methods that require a selector as the argument, such as: performSelector:, respondsToSelector: or performSelector:withObject:afterDelay:.

Read More

invasivecode:

Objective-C selectors in Swift

I was building new exercises in Swift—Apple’s new development language—for our upcoming iOS training class in San Francisco, and when combining Swift and Cocoa Touch, I discovered something really interesting.

In particular, for this tutorial, I will examine methods that require a selector as the argument, such as: performSelector:, respondsToSelector: or performSelector:withObject:afterDelay:.

Read More

invasivecode:


Teaching Swift—Apple’s new development language

This year, the WWDC was amazing. The shear amount of new stuff is overwhelming, and I still can’t believe that most of my wish list is now covered.

This year’s biggest surprise, however, which I was not really expecting (I guess nobody was), was Apple’s introduction of a new programming language—Swift. But now, Swift is here, and we have to deal with it.

Read More

invasivecode:

Teaching Swift—Apple’s new development language

This year, the WWDC was amazing. The shear amount of new stuff is overwhelming, and I still can’t believe that most of my wish list is now covered.

This year’s biggest surprise, however, which I was not really expecting (I guess nobody was), was Apple’s introduction of a new programming language—Swift. But now, Swift is here, and we have to deal with it.

Read More

WWDC 2014

invasivecode:


WWDC 2014 wish list for developers

Every year, before WWDC, there’s a lot of buzz. Transforming technologies are on our minds, and everyone is asking—what’s going to be the next big thing, as technology and change are seemingly synonymous.

Read More

invasivecode:

WWDC 2014 wish list for developers

Every year, before WWDC, there’s a lot of buzz. Transforming technologies are on our minds, and everyone is asking—what’s going to be the next big thing, as technology and change are seemingly synonymous.

Read More