-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathAccountRemovalViewController.m
58 lines (43 loc) · 1.1 KB
/
AccountRemovalViewController.m
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// AccountRemovalViewController.m
// Pinna
//
// Created by Kevin MacWhinnie on 5/8/13.
//
//
#import "AccountRemovalViewController.h"
#import "RoundaboutKitMac.h"
#import "RKSideSheetView.h"
#import "ServiceDescriptor.h"
#import "AccountManager.h"
@interface AccountRemovalViewController ()
@end
@implementation AccountRemovalViewController
- (id)initWithAccount:(Account *)account
{
NSParameterAssert(account);
if((self = [super init])) {
self.account = account;
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.title = self.account.descriptor.name;
}
#pragma mark - Actions
- (IBAction)cancel:(id)sender
{
[self.containingSheet dismiss:YES completionHandler:nil];
}
- (IBAction)remove:(id)sender
{
[[[AccountManager sharedAccountManager] deleteAccount:self.account] then:^(id <Service> service) {
[self.containingSheet dismiss:YES completionHandler:nil];
} otherwise:^(NSError *error) {
[NSApp presentError:error];
[self.containingSheet dismiss:YES completionHandler:nil];
}];
}
@end