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

November 2024

Swift

@Observable and didSet

When you mark a class as @Observable you can no longer use didSet because the macro converts it to a computed property, e.g. a simple: When expanded becomes: As you can see test has become a computed property that is a wrapper around a private _test property, a bit like Read more

By malhal, 11 months21st November 2024 ago
SwiftData

Dynamically filtering a SwiftData query

The built-in @Query does not currently support dynamic changes, instead we can use @DynamicQuery from the SwiftDataX open-source package to achieve it. The query declaration looks like this: By default that will load all Prospect model objects, sorting them by name. If the fetchDescriptor property is later changed and this View is Read more

By malhal, 11 months15th November 2024 ago
Recent Posts
  • Understanding context.environment in SwiftUI’s UIViewRepresentable
  • AppleRAID JBOD APFS resize error when trying to add or remove a disk
  • Converting from @StateObject to .task
  • @Observable and didSet
  • Dynamically filtering a SwiftData query
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
  • 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
  • UIKit
  • Uncategorised
  • Xcode
Meta
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Hestia | Developed by ThemeIsle