Bringing Back Some Old Friends

The designers of Swift seem to have really odd opinions regarding the merits of certain patterns that are very common across other languages. For example, they have deemed that the prefix and postfix operators "++" and "--" are, for some reason, not desirable. Weird. ūüßź Not a biggie because they also built Swift with the … Continue reading Bringing Back Some Old Friends

Always an Easier Way

Previously in¬†Avoiding an Objective-C Pitfall¬†#1¬†I discussed a more stable way of creating singletons in Objective-C. ¬†As with all things in the world of Apple there's always an easier way and that way comes to us via two very powerful yet unnoticed (in the Windows and Linux communities at least) APIs that Apple has contributed to … Continue reading Always an Easier Way

Avoiding an Objective-C Pitfall #1

Below is a very commonly used design pattern in Objective-C. It's the typical¬†Objective-C "Singleton Pattern" because it does just that. ¬†Returns a singleton of the class it belongs to. ¬†If we take a look at an example that uses it we can see it in action. The¬†"@synchronized(self)" statement ensures that only one thread at a … Continue reading Avoiding an Objective-C Pitfall #1