marksinkovics / PluginHost

PluginHost - A Swift application for macOS with a plugin architecture framework and callbacks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PluginHost - A Swift application for macOS with a plugin framework and callbacks

This Swift language project for XCode demonstrates an application with Cocoa's plugin architecture, with a framework for the plugins, and callbacks from the plugins to the host application.

Two subprojects are included within the main project:

The Plugin subproject defines the Plugin.framework. It includes a protocol for callbacks to the host application.

The PluginTestA subproject implements a plugin based on Plugin.framework.

Open PluginHost.xcworkspace and build the Plugin framework and PluginHost application. The main application and plugins will send this output to the Xcode console to verify that the architecture works -

Hello from PluginTestA
PluginHost - Loaded plugin named Optional("PluginTestA")

The plugin loading code is adapted from "Swift Plugins Example" by Jarek Pendowski -

https://github.com/pendowski/SwiftPluginsExample

http://blog.pendowski.com/plugin-architecture-in-swift-ish/

See Apple's 'Plugin Architectures' guide for information about Cocoa plugin bundles -

https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingCode/Concepts/Plugins.html

About

PluginHost - A Swift application for macOS with a plugin architecture framework and callbacks

License:MIT License


Languages

Language:Swift 89.7%Language:Objective-C 10.3%