public
Description: A lightweight snippet plugin for Xcode
Homepage: http://blog.skorpiostech.com/
Clone URL: git://github.com/rtmfd/sktcompletion.git
Search Repo:
sktcompletion / SKTAddSnippetController.m
100644 42 lines (32 sloc) 0.844 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// SKTAddSnippetController.m
// SKTCompletion
//
// Created by Ian Baird on 4/19/08.
// Copyright 2008 Skorpiostech, Inc. All rights reserved.
//
 
#import "SKTAddSnippetController.h"
#import "SKTTextCompletor.h"
static SKTAddSnippetController __strong *shareInst = nil;
 
@implementation SKTAddSnippetController
 
@synthesize abbreviation, snippet;
 
+ (id)sharedInstance
{
    return shareInst ? shareInst : (shareInst = [[self alloc] init]);
}
 
- (id)init
{
    return [super initWithWindowNibName:@"AddSnippet" owner:self];
}
 
#pragma mark -
#pragma mark event handlers
 
- (IBAction)addButtonEvent:(id)sender
{
    [[SKTTextCompletor sharedInstance] addSnippet:self.snippet withAbbreviation:self.abbreviation];
    [self.window performClose:nil];
}
 
- (IBAction)cancelButtonEvent:(id)sender
{
    [self.window performClose:nil];
}
 
@end