Block Based Undo/Redo Api in SwiftUI
Aug 16, 2021, 12:00 AM
Supporting undo/redo operations within your SwiftUI app.
Using KeyPaths to Drive Programmatic Focus
Jul 27, 2021, 9:30 PM
The new focus API in iOS 15 is very nice. I have found using KeyPaths for settings and responding to focus changes is a helpful shortcut and avoids the additional boilerplate of defining a custom focus enum for every View.
List Selection Based Navigation on macOS
Jul 26, 2021, 8:00 PM
There are multiple ways to handle sidebar driven navigation on macOS with SwiftUI. I have found using a selection binding to be the most robust solution.
Adding an @EnvironmentBinding PropertyWrapper
Jun 27, 2021, 6:00 AM
We can easily pass and use mutable Observable objects to the environment but we are unable to do the same for Bindings. @EnvironmentBinding enables us to use binding based environment values with the same syntax as if they were passed to...
Using the GPU for custom function evaluation without writing a metal shader.
Jun 21, 2021, 2:00 AM
Sometimes our apps contain some heavy arithmetic work that would be ideal to run in parallel on our users GPUs. But we don't want to bother learning and implementing them in Metal. MPSGraph might give you the tools you need to evaluate...
Adding mutable static properties to Generics and Protocol extensions
Jun 14, 2021, 2:00 AM
The swift compiler does not let us define mutable static properties on generic types or in protocol extensions however using the `ObjectIdentifier` we can find a solution for this limitation.
Providing the current document to menu commands
Jun 8, 2021, 2:30 AM
How to access and modify the current document from menu items in SwiftUI.
Bringing Polymorphism to Codable
Apr 8, 2021, 4:00 AM
A clean way to add polymorphic Codable support to Swift, avoiding the typical repeated custom decode/encode logic that slows us all down.
Reducing the Codable boilerplate: Property Wrappers to the rescue
Mar 23, 2021, 1:00 AM
We sometimes need to add a little bit of custom encoding logic. Property Wrappers enables this while still maintaining the very helpful automatic conformance to Codable provided by the Swift compiler.
A better solution to SwiftUI List Reordering on macOS
Mar 12, 2021, 12:00 AM
Drag based list re-ordering in SwiftUI on macOS adds a delay to all click operations such as focusing on a text field. In this post I describe how to add drag handles that allows us to avoid this focus delay and still use the simple...
SplitView Navigation: An issue with state restoration
Feb 13, 2021, 12:00 AM
How to programatically summon the SplitView slide-over sidebar on iPadOS to enable effective state restoration in SwiftUI applications.
Adding Double Column Navigation to a SwiftUI Document App
Jan 19, 2021, 12:00 AM
Double Column Navigation in SwiftUI Document based apps is unfortunately not as straight forward as one might expect.
KeyWindow a better way of exposing values from the Key window
Jan 1, 2021, 6:00 PM
A new way of passing values to the commands section of a SwiftUI app even when the user is not focused on a text field.
Reading from the Window in a SwiftUI lifecycle app
Dec 21, 2020, 1:30 AM
Exploring how to access the hosting UIWindow & NSWindow in SwiftUI exposing its attributes and methods to your app.
Accessing the document in the SwiftUI macOS menu commands
Dec 17, 2020, 12:00 AM
How to access and modify the current document from menu items in SwiftUI.
Operating on a Binding to an Array of items in SwiftUI
Nov 28, 2020, 12:00 AM
Handing a dynamic Binding to an Array in SwiftUI. So that users and seemly edit new items.
Customise About Panel on macOS in SwiftUI
Sep 30, 2020, 1:00 AM
How to add custom information and copyright to your app's About window on macOS Big Sur when using the SwiftUI app lifecycle.
Handling Undo & Redo in SwiftUI
Sep 28, 2020, 3:23 AM
Integrate with UndoManager in SwiftUI by building a reusable UndoProvider view that can be used with any Binding.
Save Custom Codable Types in AppStorage or SceneStorage
Sep 1, 2020, 12:00 AM
Add RawRepresentable conformance to a custom type that represents a setting or a view state in SwiftUI to be able to save it in AppStorage or SceneStorage.
Add Placeholder Text to SwiftUI TextEditor
Aug 18, 2020, 12:00 AM
How to add placeholder text to the new iOS 14 TextEditor view, that doesn't support placeholder by default.
Preview Files with QuickLook in SwiftUI
Aug 14, 2020, 2:00 AM
Let users preview various file formats such as Images, Live Photos, PDFs etc. in your SwiftUI app using QuickLook framework.
Getting Ready for New iOS 14 Local Network Privacy Restrictions
Jun 25, 2020, 6:00 AM
Exploring how to add support for local network privacy if, for example, your app uses URLSession to access local servers.
Scroll to Newly Added Item using ScrollViewReader and onChange Modifier
Jun 24, 2020, 6:00 AM
Programmatically scroll SwiftUI ScrollView to a new item by combining the new APIs in iOS14: ScrollViewReader and onChange view modifier.
Using SceneStorage for State Restoration in SwiftUI Apps
Jun 23, 2020, 6:00 AM
How to use the new iOS 14 @SceneStorage property to implement simple but powerful state restoration in SwiftUI.
Building a Realtime Social Network using Django Channels
Jun 16, 2020, 1:00 AM
An example realtime social network written with Django Channels Rest Framework that lets you subscribe in realtime to a hashtag.
Dynamic Height for Text Field in SwiftUI
Jun 7, 2020, 9:00 PM
How to implement a text field that can automatically resize if the text doesn't fit on one line.
View Modifier for a Custom Hover Effect in SwiftUI
Jun 3, 2020, 9:00 PM
In this article we will look into how to create a custom hover effect in SwiftUI and how to abstract this logic into a reusable view modifier.
Access Application files on iOS Simulator
May 24, 2020, 1:00 AM
How to view and manage files created by your app on the simulator, for example browse the Documents folder or Core Data SQLite Database.
Scroll List to Row in SwiftUI
May 18, 2020, 9:00 PM
Programmatically scroll SwiftUI List to a particular item, using the fact that its internal implementation is based on UITableView in iOS 13.
SwiftUI Navigation in List View: Default Selection
May 14, 2020, 11:00 PM
How to navigate to a list item by default on app launch to avoid showing an empty detail view on iPad or for state restoration.
Subscribing to Django ORM changes over a WebSocket Connection
May 11, 2020, 6:00 PM
Publishing database changes to subscribed WebSocket clients using Django Channels Rest Framework.
SwiftUI Navigation in List View: Programmatically Dismiss Detail
May 7, 2020, 9:00 PM
Looking into the differences of programmatically dismissing the detail view on iPhone and in a split view on iPad.