Warning: not a technical post
I hate posting business-y kind of stuff so I'll keep these kinds of non-technical posts infrequent.
We're a startup . . .
In the lifecycle of any release there comes a time when known bugs are far better than unknown bugs you accidentally introduce. Obviously Apple has reached that point with iOS 8, the SDK, Xcode 6, and Swift. The version shipping in the Xcode 6 GM is certainly a good release for Swift, but did you know there is a newer version of the compiler . . .
Warning: some assembly required
Previously, I did a horrible thing by hooking up to a Swift internal library function then probing to determine its arguments.
In today's post I want to cover how I went about doing that. Perhaps it will help you in your debugging adventures.
Taking the Dump
The first step is to dump the dylib exported symbols . . .
Delicious partial function application
If you aren't familiar with Function Currying, the concept is fairly simple. Imagine you have some method that takes 4 arguments. If the function is curried, then the first function takes argument #1 and returns a function that takes argument #2. That function takes argument #2 and returns a function taking argument #3. This continues . . .
The more things change
In the fast-moving world of Swift, I'm a day late and that might as well be a year. But I'm also a developer so I just can't help myself. Let's dive into the changes in Beta 5!
- As expected, the null coalescing operator was added
??and lazily evaluates the right-hand side again as you'd . . .
Don't do this; code responsibly
Please don't do this. It's horrible, unsupported, and may crash your program.
That said, let's demangle a class name by calling an internal Swift library function.
@asmname("swift_demangleSimpleClass") func demangleSimpleClass(mangledName: ConstUnsafePointer<Int8>, moduleName: UnsafePointer . . .
There's an awful joke in here somewhere
David Owens II writes about Swift access control and unit tests. He's currently adding his source files directly to the unit test target so the internal members are visible to the tests.
That's probably the best solution possible currently, but I'm filing a radar to add the equivalent of
InternalsVisibleTo. In C#, that . . .