Malcolm Hall

  • About
  • Research
  • Consultancy
  • Products
    • AppRecorder
    • Apps Using Location
    • Clipboard Monitor
    • Common Rocks Reference
    • Core Location Info
    • Friendify
    • Grape Stomper
    • HomeMenu
    • iBeacon Scanner
    • Insomnia
    • Navigate from Maps
    • Nickname
    • Plate Smasher
    • Plugged In
    • Readster
    • Resize Image
    • Read★
    • ScreenshotMenu
    • Sleep Display
    • SleepFX
    • Stealth Cam
    • TV Tube Sleep
    • UDID Calculator
    • WiFi Booster
    • WiFi Passwords

SwiftUI, Swift, Objective-C and iOS Development

Concurrency

Merge different AsyncStream types

When I first used AsyncStream with merge from AsyncAlgorithms I struggled with merging different stream result types and had experimented with building a protocol that each stream’s result type enum implemented. That way all the streams used the same protocol Read more

By malhal, 2 years18th March 2024 ago
Swift

UISplitViewController collapse code for iOS 14 and later

A new collapse delegate was added in Xcode 12 and iOS 14. Unfortunately the Master-Detail template was removed so there has never been a good example of how to use it to maintain the behavior of the previous template which Read more

By malhal, 2 years2nd January 2024 ago
Concurrency

Capturing ‘async let’ variables is not supported

Discovered this strange error in Swift, when using the sample code from the proposal which is supposed to have been accepted and implemented

By malhal, 2 years7th December 2023 ago
Concurrency

Async/await UIAlertController

I needed to show an alert in an async context and this is how I achieved it: The idea to throw a cancellation exception was inspired by DDDevicePickerViewController which is the only built-in async UIViewController I’m aware of.

By malhal, 2 years15th October 2023 ago
CoreData

NSPersistentStoreRemoteChange

I wondered why NSPersistentStoreRemoteChange doesn’t contain any info about what process made the change. For example it isn’t possible to know if the change even was made by the current process or not. This would be useful so when you Read more

By malhal, 2 years12th October 2023 ago
SwiftUI

Make a Simple Circular Button in SwiftUI

I came across this interesting Stack Overflow question How can I make a simple circular button in SwiftUI in macOS? It’s interesting because all of the proposed solutions required hard-coding a frame size. I decided to experiment with how to Read more

By malhal, 3 years1st June 2023 ago
Uncategorised

How to download Apple event videos in 4K with Dolby Atmos

First visit the Apple Events web page and find the link to the stream you want to download, e.g. the link for the iPhone 14 event from September 2022 looks like this: Now you need to install the yt-dlp command Read more

By malhal, 3 years15th May 2023 ago
Concurrency

Async/await command line tool in Xcode 14.3

Update 10/4/2024: It appears in Xcode 15.3 nothing special is required and can use await right next to the hello world print. TLDR: add @main and rename main.swift To create a command line tool in Xcode 14.3 that uses async/await Read more

By malhal, 3 years25th April 2023 ago
SwiftUI

Learn SwiftUI’s View struct: value semantics, diffing and dependency tracking

Learning SwiftUI can be tricky because it has a very different design to previous UI frameworks. Many make the mistake of trying to apply old design patterns which are not really compatible because of SwiftUI’s use of value semantics and Read more

By malhal, 3 years23rd March 2023 ago
Concurrency

@MainActor does not always mean main thread

Seems to me some developers think that @MainActor means “always main thread” and has the same behaviour as DispatchQueue.main.async which I don’t think is try. For example, the code below outputs: Because the Database class is not marked as @MainActor Read more

By malhal, 3 years31st January 2023 ago

Posts pagination

Previous 1 2 3 4 … 7 Next
Recent Posts
  • The Evolution of a Swift Macro: Building Swift Streamable Actors
  • Introducing Swift Streamable Actors: Reactive State for Swift Actors
  • How to Expand a Synology SHR‑0 Volume to the Full Size of a New Disk After Converting from SHR‑1
  • How to Convert a Synology SHR‑1 to SHR‑0 (Single-Disk) Using mdadm
  • Understanding context.environment in SwiftUI’s UIViewRepresentable
Recent Comments
  • SwiftUI 2: the way to open view in new window on Open window / scene in SwiftUI 2.0 on macOS
  • Why Does URL Scheme/onOpenURL In SwiftUI Always Open A New Window? - Programming Questions And Solutions Blog on Open window / scene in SwiftUI 2.0 on macOS
  • Ken Carroll on Enabling iOS 9.3 SDK in Xcode 8 for iOS 10
  • Mr WordPress on Welcome to my Developer Blog
Archives
  • January 2026
  • November 2025
  • July 2025
  • June 2025
  • February 2025
  • November 2024
  • October 2024
  • July 2024
  • May 2024
  • April 2024
  • March 2024
  • January 2024
  • December 2023
  • October 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • January 2023
  • November 2022
  • June 2022
  • December 2020
  • May 2018
  • October 2017
  • September 2017
  • August 2017
  • January 2017
  • July 2016
  • May 2016
Categories
  • AppIntents
  • CloudKit
  • Concurrency
  • CoreData
  • CoreLocation
  • Mac
  • MapKit
  • NSOperation
  • Objective-C
  • Swift
  • SwiftData
  • SwiftUI
  • Synology
  • UIKit
  • Uncategorised
  • Xcode
Meta
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Hestia | Developed by ThemeIsle