Some ‘news’ from a while back for Swift-people working with C libraries. Swift Tip: OpaquePointer vs. UnsafePointer explains the differences between these two ways of interacting with C-based APIs.
Tip of the week
Its random-tidbit thursday:
• Apple seems to be moving Xcode from using libclang to clangd. What could this possibly mean for developers? One the one hand, Apple’s commitment to improving ‘clangd’ could mean improved ObjC&Swift support in other IDEs using clangd, like VisualStudio Code. One the other hand, if Xcode gets support for the Language Server Protocol, it could become easier to add support for other languages to Xcode.
• The objc.io Swift Tip Of The Week explains us the benefits of using mutation in general and in-place map in particular – check it out.
The guys over at objc.io are posting Weekly Swift Tips on a clockwork schedule – this week they explain how ‘local computed properties‘ can be used to speed-up code where variables that can be expensive to compute are not used in all branches. This seems like one of the first things any optimising compiler should take care of (doing calculations only when they are actually needed), does anyone have any hard data on whether the Swift compiler really does not figure this out on its own? How about other languages and compilers?