Within the Swift Foundation Library there exists a function called withoutActuallyEscaping(_:do:) that has, at least for me, become one of those hidden gems that is extremely useful for things beyond its original intention. As it's documentation states: Allows a nonescaping closure to temporarily be used as if it were allowed to escape.Apple Documentation - Swift … Continue reading Helpful Swift Trick #1 – withoutActuallyEscaping(_:do:)
Objective-C
Avoiding a Swift NSRegularExpression Pitfall
Until Swift gets a native regular expression class of it's own we are stuck with the Objective-C version - NSRegularExpression. The Objective-C version is very capable and works very well but it's important to remember that it is working on Objective-C NSStrings which, unlike Swift's native Strings, are based on the UTF-16 encoding. What this … Continue reading Avoiding a Swift NSRegularExpression Pitfall
Swift Struct vs. Class
I've been having a tough time in Swift with the Struct vs. Class issue. Unlike Java and Objective-C, Swift allows value type "classes" known as Struct types. These behave very similar to C++ objects that are created without dynamic memory allocation - in other words they're created on the stack instead of the heap. This … Continue reading Swift Struct vs. Class
What in the Hell is a Grapheme Cluster?
In my previous post I talked about Swift's handling of strings and the problems making the characters of a string randomly accessible because of Swift Strings being Unicode compliant. Another part of the issue, and the reason that we can think of Characters in Swift as just Strings in and of themselves, is the concept … Continue reading What in the Hell is a Grapheme Cluster?
Thoughts on Strings in Swift
Okay, I really do understand the plight. Honestly I do. I mean, I get it! Strings in Swift are not randomly accessible collections of bytes like they are in C or 16-bit words like they are in Objective-C or Java. In Swift a String is a collection of grapheme clusters. So, why not allow you … Continue reading Thoughts on Strings in Swift
Working with Dynamic Libraries in Xcode
Here's just a little tidbit that I ran across recently where Xcode, which normally does a good job covering all the bases, fell short just a bit. When you're working with dynamic libraries in just about any environment, especially Linux and MacOS, there is a two-way street when it comes to a program or another … Continue reading Working with Dynamic Libraries in Xcode
Swift – First Impressions
After playing with Swift a bit here are my first impressions of the language. There is definitely a lot to like about it! There's also a few things that annoy me. 😎 But first I'll start out with a giving you a 1,000 foot overview of the language itself. Syntax aside, Swift and Objective-C 2.0 (as … Continue reading Swift – First Impressions
Taking the Swift Plunge
Okay... So... I think I'm finally ready to take the plunge and start learning the Swift Programming Language in earnest. I've been watching it and starting with version 5 there is finally enough there for me to get excited about. But this isn't going to be easy for me. Not like it was when I … Continue reading Taking the Swift Plunge
Rubicon
I've made a major milestone in my personal project Rubicon. Â I've gotten it where it will build on Linux as well as Mac OS X. Â More info is in the readme file. Â Check it out:Â https://github.com/GalenRhodes/Rubicon
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