-
Notifications
You must be signed in to change notification settings - Fork 2
/
ZYMySilentActivity.m
55 lines (37 loc) · 1.13 KB
/
ZYMySilentActivity.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
//
// ZYMySilentActivity.m
// SampleProject
//
// Created by Mariano Abdala on 12/3/12.
// Copyright (c) 2012 zerously. All rights reserved.
//
#import "ZYMySilentActivity.h"
@implementation ZYMySilentActivity
#pragma mark - Hierarchy
#pragma mark UIActivity
- (NSString *)activityTitle {
return NSLocalizedString(@"Silent Activity", @"");
}
- (UIImage *)activityImage {
UIImage *activityImage =
UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ?
[UIImage imageNamed:@"silent-activity"] :
[UIImage imageNamed:@"silent-activity-ipad"];
return activityImage;
}
- (BOOL)canPerformWithActivityItems:(NSArray *)activityItems {
return YES;
}
#pragma mark ZYActivity
- (UIViewController *)performWithActivityItems:(NSArray *)activityItems {
NSOperationQueue *backgroundQueue =
[[NSOperationQueue alloc] init];
[backgroundQueue addOperationWithBlock:^{
NSLog(@"My activity has begun!", nil);
sleep(3);
NSLog(@"My activity has ended!", nil);
[self activityDidFinish:YES];
}];
return nil;
}
@end