Sam Soffes


String Homogeneousness Algorithms

Today, I tweeted the following code while I was working on Whiskey: import Foundation extension String { var isHomogeneous: Bool { var homogeneous = true var character: NSString? enumerateSubstringsInRange(Range(start: startIndex, end: endIndex), options: [.ByComposedCharacterSequences]) { substring, _, _, stop in if let character = character { if character != substring { homogeneous = false

Continue Reading

Network Testing in Swift with DVR

Networking testing is hard. There’s a few approaches. The most common I’ve seen is stubbing requests. OCMock is a common approach. Personally, I’ve never been a fan of mocks and stubs. At some point you just end up testing your mocks and

Continue Reading

SyntaxKit

I sat down to work on Whiskey the other day and go super side tracked. I have this new master plan to greatly improve Whiskey's markdown parsing, but it's a lot of work so I started procrastiworking. I noticed some bugs in SyntaxKit, what I

Continue Reading

Automatic UI Updates with Value Types in Swift

Value types are one of my favorite things in Swift. At first, I was resistant. It’s a much different way of thinking. Let’s look at a simple example that really shows the power. I was recently working on a little control for entering

Continue Reading

Redacted for Mac Launch

Yesterday, Redacted for Mac hit the App Store. It's this little app I've been working on here and there to quickly hide parts of an image. Here's a one minute video demo if you want the quick rundown. All I did was tweet the video

Continue Reading