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

SwiftUI

NavigationSplitView with List selection of different types

I came across an interesting Stack Overflow question about how to support List selection of different types when using NavigationSplitView when in regular width, e.g. on iPad landscape. This problem doesn’t arise with NavigationStackView because multiple ForEach can simply iterate Read more

By malhal, 3 years12th January 2023 ago
SwiftUI

Multiple sheets in SwiftUI using subviews

If you need to show multiple sheets in SwiftUI it is best to use the framework features to your advantage. Rather than try to abstract the problem into a generic coordinator object, which you then have to unbundle again to Read more

By malhal, 3 years29th November 2022 ago
SwiftUI

Nested Property Wrappers in Swift

I designed a better way to nest property wrappers than other examples I’ve seen in this article and this Stack Overflow question. The sample below is a redesigned version of the code in the question, which I also posted as Read more

By malhal, 3 years18th November 2022 ago
SwiftUI

UITextView in a UIViewRepresentable

I’ve seen a lot of code shared online getting the Coordinator wrong so thought I’d share an example of how I believe the Coordinator should be done. makeView returning context.coordinator.textView is taken from Fruta’s PaymentButton.swift but the ideas of the Read more

By malhal, 3 years17th November 2022 ago
MapKit

UIViewRepresentable with Coordinator Example

There are not many examples of correctly using a Coordinator with UIViewRepresentable so thought I’d share one on mine. You’ll see many examples including some from Apple that return Coordinator(self) which I believe is a mistake because the UIViewRepresentable is Read more

By malhal, 3 years16th November 2022 ago
SwiftUI

SwiftUI List EditActions

It’s hard to find this feature in the documentation so thought I’d share an example here.

By malhal, 3 years14th November 2022 ago
SwiftUI

How to get @Environment or @EnvironmentObject inside ObservableObject

Saw this interesting question on Stackoverflow and thought I would answer it. The trick is to use `DynamicProperty as an intermediary as follows:

By malhal, 4 years28th June 2022 ago
SwiftUI

Open window / scene in SwiftUI 2.0 on macOS

Update June 2022: windowing APIs have now been added so the code below might not be the best way to implement it. Here is how to open a new window or re-activate an existing one in SwiftUI on macOS. In Read more

By malhal, 5 years6th December 2020 ago
CoreData

Dynamically filtering @FetchRequest with SwiftUI

Update 30/6/2022: I realised we shouldn’t be initing NSPredicate objects inside body so need a new approach. I was reading Paul Hudson’s article Dynamically filtering @FetchRequest with SwiftUI and thought I would share an improvement for declaring the singers @FetchRequest Read more

By malhal, 5 years3rd December 2020 ago
SwiftUI

SwiftUI: AppStorage with Dynamic Key

If we want to use @AppStorage but with a dynamic key passed to the View we can do this: DynamicKeyApp.swift ContentView.swift

By malhal, 5 years ago

Posts pagination

Previous 1 … 3 4 5 … 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