Repository navigation
Expand file tree
/
Copy pathAppInteractor.m
More file actions
66 lines (50 loc) · 2.19 KB
/
Copy pathAppInteractor.m
File metadata and controls
66 lines (50 loc) · 2.19 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// AppInteractor.m
// SMPlayer
//
// Created by SimonMiao on 16/7/29.
// Copyright © 2016年 MSY. All rights reserved.
//
#import "AppInteractor.h"
#import "ATNavigationController.h"
#import "SMNoteFolderController.h"
static NSString *const KAppShortcutItemItem_share = @"com.MSY.SMNote.share";
static NSString *const KAppShortcutItemItem_search = @"com.MSY.SMNote.search";
static NSString *const KAppShortcutItemItem_one = @"com.MSY.SMNote.one";
@interface AppInteractor ()
@property (nonatomic, strong) UINavigationController *navCtr;
@end
@implementation AppInteractor
- (void)creatShortcutItems {
UIApplicationShortcutIcon *curIcon = [UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeShare];
UIApplicationShortcutItem *item = [[UIApplicationShortcutItem alloc] initWithType:KAppShortcutItemItem_share localizedTitle:@"分享" localizedSubtitle:@"分享副标题" icon:curIcon userInfo:nil];
UIApplicationShortcutIcon *cutIcon2 = [UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeSearch];
UIApplicationShortcutItem *item2 = [[UIApplicationShortcutItem alloc] initWithType:KAppShortcutItemItem_search localizedTitle:@"搜索" localizedSubtitle:@"搜索副标题" icon:cutIcon2 userInfo:nil];
UIApplicationShortcutItem *item3 = [[UIApplicationShortcutItem alloc] initWithType:KAppShortcutItemItem_one localizedTitle:@"第一个按钮"];
//添加到快捷选项数组
[UIApplication sharedApplication].shortcutItems = @[item,item2,item3];
}
- (void)judgeTheShortcutItemType:(NSString *)type {
if ([type isEqualToString:KAppShortcutItemItem_share]) {
ATLog(@"分享点击了");
}
else if ([type isEqualToString:KAppShortcutItemItem_search]) {
ATLog(@"搜索点击了");
}
else if ([type isEqualToString:KAppShortcutItemItem_one]) {
ATLog(@"第一个按钮点击");
}
}
- (void)startUIFlow
{
[self startMain];
}
- (void)startMain
{
if (!self.navCtr) {
SMNoteFolderController *ctr = [[SMNoteFolderController alloc] init];
self.navCtr = [[UINavigationController alloc] initWithRootViewController:ctr];
}
self.keyWindow.rootViewController = self.navCtr;
}
@end