Swift Weekly – Issue 05 – The Builder Pattern and Fluent Interface

A few weeks ago I started checking out some Wikipedia articles about various s/e design patterns and came across theBuilder pattern which is a Creational GoF pattern. Then as you know, I cannot just read one article in one sitting. I have to click every link that the article leads to, so I stumbled upon the article about Fluent Interfaces and I could then see the possibilities.

Note: Fluent Interfaces have nothing to do with IB or a visual interface that is displayed on the screen at all. Fluent interfaces are the way that we can write our software to ensure they are… well… fluent. Read on to understand how this works.

I don’t think fluent interfaces are the same as the builder pattern. I don’t really think fluent interface is actually a pattern at all. I believe that fluent interfaces are a concept, and a kick ass one at that. I think mixing fluent interfaces and the builder pattern will allos us to build Swift classes that are amazingly simple to use, instead of the classic OOP designs that we see on pretty much every Apple class these days. I wish Apple could read this article and (ehem), just update their iOS SDK classes for instance to use fluent interfaces and the builder pattern.

If you want to write your Swift apps in the most kick ass way, continue reading. I think this article will help you a lot not only in learning more about Swift, but also writing some really crazy code that will make your life and those around you much easier.

Click here to read the full article on GitHub.

Creating string enumerations in Objective-C (The ultimate solution)

A while ago I wrote on my blog about a solution to one of the most common questions asked by Objective-C programmers which is “How can I create string enumerations?”. Well, the solution that I’ve given has immediately become one of the top subjects that attracts developers to my blog, as I can see in my stats. I thought I should now take it to a whole other level and get rid of the limitations that I had presented in the old solution, and come up with a fresh perspective.

The following video is the result of my work on this subject. I hope you’ll enjoy watching it.

Git Repositories for 4 of My Books

I have set up 4 GitHub repositories for my four books:

iOS 4 Programming Cookbook
Repo: git@github.com:vandadnp/iOS-4-Programming-Cookbook.git
Web: https://github.com/vandadnp/iOS-4-Programming-Cookbook

Concurrent Programming in Mac OS X and iOS
Repo: git@github.com:vandadnp/Concurrent-Programming-in-Mac-OS-X-and-iOS.git
Web: https://github.com/vandadnp/Concurrent-Programming-in-Mac-OS-X-and-iOS

Writing Game Center Apps in iOS
Repo: git@github.com:vandadnp/Writing-Game-Center-Apps-in-iOS.git
Web: https://github.com/vandadnp/Writing-Game-Center-Apps-in-iOS

Graphics and Animation on iOS
Repo: git@github.com:vandadnp/Graphics-and-Animation-on-iOS.git
Web: https://github.com/vandadnp/Graphics-and-Animation-on-iOS

Enjoy 🙂

Xcode 4 Refactoring Features – Part 1

In this video, you will learn about Rename, Extract, Create Superclass, and Move Up refactoring facilities in Xcode 4, Apple’s latest and greatest development environment for iOS and Mac OS X. If you have any questions, or comments, leave them down here.

Animations in iOS Using Block Objects (Video, Part 2)

After learning simple block object animations in iOS in the previous video, you will now learn how to use more complicated block based animations that take advantage of “completion” block objects to notify you of the completion of an animation block.

To learn more about graphics and animation in iOS, refer to Graphics and Animation on iOS (an O’Reilly book)

Animations in iOS Using Block Objects (Video, Part 1)

In this video, you will learn how to use the new block-based animations in the UIView class in iOS to create animations in your iOS apps.

To learn more about graphics and animation in iOS, refer to Graphics and Animation on iOS (an O’Reilly book)

Recover iPad GarageBand’s Demo Song (Curtain Call)

So you accidentally deleted or modified the demo song (Curtain Call) that comes with your iPad’s garage band… no need to worry. To recover this song, simply go to Settings on your iPad, then select GarageBand on the left hand side and choose the option to recover the demo song. That’s all!!!