ScrollView phase changes on iOS 18
In addition to scroll related view modifiers covered in the previous blog post, there is another one for detecting scroll view phases aka the state of the scrolling. The new view modifier is called...
View ArticleReferencing itself in a struct in Swift
It took a long time, I mean years, but it finally happened. I stumbled on a struct which had a property of the same type. .gist table { margin-bottom: 0; } This file contains bidirectional Unicode...
View ArticleCancellable withObservationTracking in Swift
Observation framework came out along with iOS 17 in 2023. Using this framework, we can make objects observable very easily. Please refer to @Observable macro in SwiftUI for quick recap if needed. It...
View ArticleDark Augmented Code theme for Xcode
After a couple of years, I tend to get tired of looking at the same colour scheme in Xcode. Then I spend quite a bit of time looking for a new theme and then coming back with empty hands. Material...
View ArticleWrapping async-await with a completion handler in Swift
It is not often when we need to wrap an async function with a completion handler. Typically, the reverse is what happens. This need can happen in codebases where the public interface can’t change just...
View ArticleHow to keep Date’s microseconds precision in Swift
DateFormatter is used for converting string representation of date and time to a Date type and visa-versa. Something to be aware of is that the conversion loses microseconds precision. This is...
View ArticleSorting arrays in Swift: multi-criteria
Swift’s foundation library provides a sorted(by:) function for sorting arrays. The areInIncreasingOrder closure needs to return true if the closure’s arguments are increasing, false otherwise. How to...
View ArticleAnyView is everywhere in Xcode 16
Loved to see this entry in Xcode 16’s release notes: Xcode 16 brings a new execution engine for Previews that supports a larger range of projects and configurations. Now with shared build products...
View ArticleAnyClass protocol and Objective-C methods
AnyClass is a protocol all classes conform to and it comes with a feature I was not aware of. But first, how to I ended up with using AnyClass. While working on code using CoreData, I needed a way to...
View ArticleSwift 6 suitable notification observers in iOS
I have a couple of side projects going on, although it is always a challenge to find time of them. One of them, SignalPath, is what I created back in 2015. Currently, I have been spending some time to...
View Article