The code scrapbook is finished, and has now produced its first set of articles. Five articles in around ten minutes seems pretty impressive to me.
Swift
Calling shell commands, including with privileges, NSBackgroundActivity, XPC Activity, and writing shell commands in Swift.
Dates with (NS)Date and DateFormatter, writing messages to Sierra’s unified log, and working with old Objective-C interfaces.
Reading and writing preference files, storing data in property list files, and reading JSON data.
Alerts, open and save file, text boxes, radio buttons, popup menus, steppers, read and write in NSDocuments, and much more.
Swift 3.1 code snippets for string manipulation, working with attributes in attributed text, and with arrays.
Covers new series of Swift Snippets articles, with links to those articles, other relevant ones here, and the whole series in a Tinderbox document.
A classic scripting task: iterate through a folder and its entire contents, testing to see if each file is readable or writable. It’s straightforward in Swift too.
There are lots of different ways to modify a string, but some would turn out to be very inefficient. A gentle wander through CharacterView and a mapping closure.
Making sure that macOS doesn’t mangle source code behind your back, and a simple solution to getting notes exported in the right order.
