Plugin for Xcode! You can add your plugin to this panel and you should not care about ui in Xcode! It looks like left panel(tree of files, breakpoints etc). Xcode 6+ only.
Build this plugin, then the plugin will automatically be installed in ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
.
Relaunch Xcode and PluginPanel will make your life easier.
- Install this plugin to Xcode.
- Move
PluginPanelClient
folder to your plugin Xcode project. - Start observe
PluginPanelDidLoadedWindowNotification
notification wheninit
is called in your plugin - Create your main
NSViewController
- Set image and your view controller to
DVTChoice
- Call
PluginPanelAddPlugin
function withDVTChoice
object and window from notification (notification.userInfo[PluginPanelWindowNotificationKey]) - Build your plugin and see result!
Please, see example (panelDidLoadNote
method for creation DVTChoice
)
Example usage:
+ (void)pluginDidLoad:(NSBundle *)plugin {
static id sharedPlugin = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedPlugin = [[self alloc] init];
});
}
- (id)init {
if (self = [super init]) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(panelDidLoadNote:) name:PluginPanelDidLoadedWindowNotification object:nil];
}
return self;
}
- (void)panelDidLoadNote:(NSNotification *)note {
static NSImage *image = nil;
if (!image) {
image = [[NSImage alloc] initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForImageResource:@"plugin_icon"]];
}
TPViewController *c = [[TPViewController alloc] initWithNibName:@"TPView" bundle:[NSBundle bundleForClass:self.class]];
c.mainWindow = [note.userInfo objectForKey:PluginPanelWindowNotificationKey];
DVTChoice *choice = [[NSClassFromString(@"DVTChoice") alloc] initWithTitle:@"Time" toolTip:@"Time management plugin" image:image representedObject:c];
PluginPanelAddPlugin(choice, [[note userInfo] objectForKey:PluginPanelWindowNotificationKey]);
}
TimePlugin is released under the MIT License, see LICENSE.txt.