Swift Structured Concurrency
How to run in a non-main thread
Figuring out software, one rabbit hole at a time.
How to run in a non-main thread
This template is for multiplatform app supporting both iOS and macOS in the same target.
If you create a new project in 2023, these 2 components are no longer a thing.
Since iOS 14, there are lots of “features” and changes to UICollectionView, making it possible to create a standard table/list UI. This WWDC 2020 session introduced the modern w...
This is an insight into programmers’ favorite website, as I have unlocked the secret access. This post has screenshots of the analytic data, or you can also watch my vlog.
If you use Swift Package, there are 2 pesky problems whenever you create a new file.
Enable Push Capability
If you do run unit tests, here’s 1 useful tip to make your tests run faster, and more predictable.
If you have used #imageLiteral you might understand how dumb an Xcode feature can be. It is most likely a half-baked idea. Won’t be surprise to see them deprecate it.
GitHub pull request (PR) provides 3 options for a PR merge. You can (1) regular merge, (2) squash merge, or (3) rebase.
Long-lived branches require frequent merge from the master or main branch, and resolving conflicts repeatedly. Here are some tips on how to perform the merge.
Improving app launch time is an evergreen topic, with Apple sharing tips since the first iOS SDK. Overtime, the techniques will change. I was looking at it again, after many yea...
If your debugger output is producing too many log messages, here are some ways you can reduce it.
It is common for a CI/CD pipeline to run a build on Github when a certain tag is pushed. For example, if I want to release v1.2 of an app, I can simply tag v1.2, push, and that ...
Sometimes you need to run an app on simulator without building in Xcode. It is especially useful for QA/Test engineers. While they usually has an arsenal of iPhones, there is 1 ...
I was naive to create a view model using a service that is also an ObservableObject. It looks like this:
With the new Xcode 14, the biggest feature 😂 of Swift 5.7 has to be the enhancement of the unwrapping syntax. We can delete a lot of code with a simple find & replace.
@AppStorage is a property wrapper for UserDefaults, provided by SwiftUI framework. It is very simple to use, but in practice, some simple things are not obvious.
Factory is the Dependency Injection (DI) library which will replace it’s popular predecessor – Resolver.
Most developers have experience using RxSwift. But since iOS 13, Apple has provided their 1st party framework, tightly integrated into other frameworks, including SwiftUI.
I fell into this trap and had a retain cycle.
This is cool trick to inject a certain property for a type.
Unit testing for networking API requires some work because to mock the HTTP response is non-trivial, be it using 1st party URLSession or 3rd party Alamofire.
If you’re supporting iOS 13 minimally, you should give Asset Catalog and the system dark mode another look. It was in iOS 13 (back in 2019!) that Apple added dark mode support. ...
A gitattributes template for Xcode projects, specifying how files are to be diff and merged for pbxproj file format.
Xcode comes bundled with a version of Swift. You can refer to this list for the shipped versions. Sometimes, you won’t want to upgrade Swift for your project. So if you update X...
Since a few years ago, Xcode has added an awesome feature. Automatically manage signing is a simple checkbox that will make life so much happier for all Apple developers. No lon...
If you ever run swfitlint in a CI/CD pipeline, you might have experienced errors merely due to linting. You have to fix it, push it, then wait for another few minutes (or hours)...
GitHub Actions are jobs that can be run on GitHub machines, which is usually used for CI/CD. But you can also conveniently add manual workflows with custom inputs, then click to...
If you have a personal account and a work account, then it gets more tedious to use both on the same computer. Here is a step-by-step guide on how to set them up.