Archive for June 28, 2022

Tuesday, June 28, 2022

Creating Custom Extension Points for Mac Apps With ExtensionKit

Guilherme Rambo (tweet):

We’ve been able to develop extensions for Apple’s apps and operating systems for a while, but Apple never offered a native way for third-party apps to provide custom extension points that other apps can take advantage of.

With ExtensionFoundation and ExtensionKit on macOS, now we can.

However, Apple’s documentation lacks crucial information on how to use these new APIs (FB10140097), and there were no WWDC sessions or sample code available in the weeks following the keynote.

Thanks to some trial and error, and some help from other developers, I was able to put together some sample code demonstrating how one can use ExtensionFoundation/ExtensionKit to define custom extension points for their Mac apps.

Update (2022-06-30): Jesper:

This is not the first time I’m getting these vibes from Apple frameworks; IOSurface and its ilk has been like that, and the sessions on ScreenCaptureKit were almost comical at their circuitous avoidance of describing what you actually do with the audio/video buffers you are handed.

[…]

Apple is big enough that it’s time to grow beyond the scrappy image, respect developers both inside and outside the company and allocate time and opportunity to move beyond “no overview available”.

BBEdit 14.5

Bare Bones Software:

If a language server includes “quick fix” information in a diagnostic (error/warning) that it returns, BBEdit will add a “Fix” button to the diagnostic’s item in the popover list.

[…]

Added “Tail Mode”: when turned on, BBEdit will move the insertion point to the end of the file if it is changed while BBEdit has it open.

[…]

The Find, Multi-File Search, and Pattern Playground windows get an additional cheat sheet for the “Replace” field. This provides a quick reference for constructing Grep replacement patterns.

[…]

Added finer-grained control over invisibles display: it is now possible to explicitly turn on (or off) display of spaces and line endings when “Show Invisibles” is enabled.

[…]

When Auto-Indent is turned on, “New Line Before Paragraph” and “New Line After Paragraph” will indent the inserted line by the same indentation as the line on which the command was invoked.

Previously:

Update (2022-07-01): Dr. Drang:

What I like about Tail Mode is that it works like tail -f but by doing so in a BBEdit window, all my ingrained habits for searching and copying text will work, which they don’t in Terminal or iTerm.

[…]

Although I have a feeling Rich Siegel will soon have a bbtail command to go along with bbdiff and bbfind, I couldn’t wait. Here’s my combination shell script/AppleScript[…]