Editor Extensions

Xcode extensions use the XcodeKit framework, which contains protocols for extensions to implement, and data types sent to and from extensions. As of Xcode 9, the only extension point is the ability to add commands to the Editor menu while editing source code. The extension can access the contents of the file being edited, as well as the current text selection.

That’s not a lot, but you can do interesting things with it. For example, some developers have used extensions to perform code formatting and other niceties. As a simple version of this, you can create an app extension to replace escape sequences for emoji with their actual emoji characters, like how Slack or Discord will replace :thumbsup: with the thumbs-up emoji. ...

Get Xcode Treasures now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.