Category Archives: Swift

MVVM -> Avoiding the “Imperative Soup”

The Setup After working with MVC and MVP in cocoa touch for the last few years, I think it’s time to take a step back and consider the MVVM approach. Recently, I watched a talk given my Ben DiFrancesco where he discusses how and why you should adopt MVVM in your projects. Ben explains how adding […]

Hacking with Swift -> All ASCII chars in UTF-8 string? 💩

Unicode is great! It’s so great that it solves all of our localized character issues. But what if you’re working with a low level accessory that requires ASCII ONLY characters as valid input? Let’s say you were to throw in some 💩? How would this system deal with that? This may produce unexpected results and really mess-up-yo-day. […]

Using Closures in Xcode Playgrounds

When starting to learn Swift, you will eventually want to explore creating Swift closures as asynchronous completion handlers. Naturally, you’ll try and fire up a Playground and wire up a function that takes another function as an argument. But when you want to test your completion execution, you might have noticed that the debug console […]

Swift in-out variables – passing by reference

Passing by reference is sometimes convenient depending on your needs. Luckily, if you’re using Swift, it’s pretty simple.Watch Full Movie Online Streaming Online and Download In Swift, you can add the inout keyword in place of var. Here’s an example: Swift <br /> var myInt:Int = 5</p> <p>func doubleInt(inout myInt:Int) -> Void {<br /> myInt *= […]