WOODY'S
FINDINGS

Posts

Tip

Use chain of member references to categorize static elements

27 March 2022

An idea to use the new chain of member references syntax to improve the declaration of static properties when working with a large number of elements

Tip

CoreData: the burden of the past

6 February 2022

What I do not appreciate about CoreData today

Tip

Improve iPadOS pointer interactions - Part 1: buttons

26 September 2021

Some techniques to improve the pointer interactions and animations for buttons

Tip

Programmatically logout a user in Swift

12 August 2021

As well as restarting, shutting down and putting the computer to sleep.

Tip

Positioning a window in macOS

8 August 2021

Some ideas to easily position a NSWindow with AppKit and SwiftUI.

Tutorial

Scripting with SwiftUI (III) - Forms

13 June 2021

Learn how to build a form using SwiftUI, and then how to export the user's inputs as JSON. A last optional part explains how to validate the inputs and how to warn the user.

Tutorial

Scripting with SwiftUI (II) - Scripts Provider

13 December 2020

In this second tutorial of the series you will learn how to develop an interface to let the user choose a script to execute and execute it.

Tip

Safer singletons with property wrappers

22 November 2020

A solution to hide a singleton behind a property wrapper for easier use and dependency injection.

Tutorial

Scripting with SwiftUI (I) - Coding a color picker View

25 October 2020

This tutorial is the first one of a series to learn how to use SwiftUI in Swift scripts. Some basis of SwiftUI are explained, as well as how to display an interface like with an application in a Swift script.

Tip

Working with Swifty NSNotification

4 October 2020

An overview of <code>NSNotification</code> usage then a discussion about making <code>NSNotification</code> more "Swifty" by implementing extensions and a <code>NotificationObserver</code> wrapper (final Playground file provided).

Tip

Advanced array slicing

21 September 2020

Whenever your work with numbers, you might want to define special ones that act a bit differently from others, while keeping their value. For example, it could be useful to define a <code>first</code> and <code>last</code> integers to be used in a range to target the first and last valid indexes of an array.

Tutorial

Cocoa: implement a privileged Helper

4 September 2020

In this tutorial, learn how to implement a privileged helper on macOS from scratch. The goal is to make the application Scriptex able to execute scripts with root privileges.