invasivecode:


Core Data Asynchronous Fetching in iOS 8 and Swift

In my previous post, I displayed a new Core Data feature that allows developers to perform batch updates directly on the Persistent Store. This time, I’m going to show how to perform asynchronous fetches, a feature that developers have desired for a long time, but has finally become available in iOS 8 (and OS X 10.10 Yosemite).

Read More

invasivecode:

Core Data Asynchronous Fetching in iOS 8 and Swift

In my previous post, I displayed a new Core Data feature that allows developers to perform batch updates directly on the Persistent Store. This time, I’m going to show how to perform asynchronous fetches, a feature that developers have desired for a long time, but has finally become available in iOS 8 (and OS X 10.10 Yosemite).

Read More

invasivecode:


Core Data Batch Updates in iOS 8 and Swift

Core Data, one of the most important Cocoa frameworks, received new interesting functionalities in iOS 8 and OS X 10.10.

Today, I am going to show you how to perform batch updates of the data contained in the Persistent Store. This will allow you to modify one or more properties of your entities with no need of loading the data into the Managed Object Context. Instead, batch updates are directly performed in the Persistent Store.

Read More

invasivecode:

Core Data Batch Updates in iOS 8 and Swift

Core Data, one of the most important Cocoa frameworks, received new interesting functionalities in iOS 8 and OS X 10.10.

Today, I am going to show you how to perform batch updates of the data contained in the Persistent Store. This will allow you to modify one or more properties of your entities with no need of loading the data into the Managed Object Context. Instead, batch updates are directly performed in the Persistent Store.

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:

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