Skip to content

Commit 0f7adc5

Browse files
committed
KxMenu 加上个菜单先~
1 parent 835b3cf commit 0f7adc5

10 files changed

Lines changed: 1155 additions & 28 deletions

File tree

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@
281281
4E9113AA1A1CB19900AC9431 /* icon_file_state_goon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E9113A61A1CB19900AC9431 /* icon_file_state_goon@2x.png */; };
282282
4E9113AB1A1CB19900AC9431 /* icon_file_state_look@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E9113A71A1CB19900AC9431 /* icon_file_state_look@2x.png */; };
283283
4E9113AC1A1CB19900AC9431 /* icon_file_state_pause@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E9113A81A1CB19900AC9431 /* icon_file_state_pause@2x.png */; };
284+
4E93F2331B84243D00017916 /* KxMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E93F2321B84243D00017916 /* KxMenu.m */; };
285+
4E93F23A1B84356500017916 /* file_menu_icon_delete@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E93F2351B84356500017916 /* file_menu_icon_delete@2x.png */; };
286+
4E93F23B1B84356500017916 /* file_menu_icon_edit@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E93F2361B84356500017916 /* file_menu_icon_edit@2x.png */; };
287+
4E93F23C1B84356500017916 /* file_menu_icon_info@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E93F2371B84356500017916 /* file_menu_icon_info@2x.png */; };
288+
4E93F23D1B84356500017916 /* file_menu_icon_open@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E93F2381B84356500017916 /* file_menu_icon_open@2x.png */; };
289+
4E93F23E1B84356500017916 /* file_menu_icon_share@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E93F2391B84356500017916 /* file_menu_icon_share@2x.png */; };
284290
4E94C4E71B4A6AC700EB668A /* ScanBGView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E94C4E61B4A6AC700EB668A /* ScanBGView.m */; };
285291
4E94C4ED1B4A867A00EB668A /* scan_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E94C4EC1B4A867A00EB668A /* scan_bg@2x.png */; };
286292
4E94C4EF1B4B73BB00EB668A /* scan_line@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E94C4EE1B4B73BB00EB668A /* scan_line@2x.png */; };
@@ -1277,6 +1283,13 @@
12771283
4E9113A61A1CB19900AC9431 /* icon_file_state_goon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_state_goon@2x.png"; sourceTree = "<group>"; };
12781284
4E9113A71A1CB19900AC9431 /* icon_file_state_look@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_state_look@2x.png"; sourceTree = "<group>"; };
12791285
4E9113A81A1CB19900AC9431 /* icon_file_state_pause@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_state_pause@2x.png"; sourceTree = "<group>"; };
1286+
4E93F2311B84243D00017916 /* KxMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KxMenu.h; sourceTree = "<group>"; };
1287+
4E93F2321B84243D00017916 /* KxMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KxMenu.m; sourceTree = "<group>"; };
1288+
4E93F2351B84356500017916 /* file_menu_icon_delete@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "file_menu_icon_delete@2x.png"; sourceTree = "<group>"; };
1289+
4E93F2361B84356500017916 /* file_menu_icon_edit@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "file_menu_icon_edit@2x.png"; sourceTree = "<group>"; };
1290+
4E93F2371B84356500017916 /* file_menu_icon_info@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "file_menu_icon_info@2x.png"; sourceTree = "<group>"; };
1291+
4E93F2381B84356500017916 /* file_menu_icon_open@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "file_menu_icon_open@2x.png"; sourceTree = "<group>"; };
1292+
4E93F2391B84356500017916 /* file_menu_icon_share@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "file_menu_icon_share@2x.png"; sourceTree = "<group>"; };
12801293
4E94C4E51B4A6AC700EB668A /* ScanBGView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanBGView.h; sourceTree = "<group>"; };
12811294
4E94C4E61B4A6AC700EB668A /* ScanBGView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScanBGView.m; sourceTree = "<group>"; };
12821295
4E94C4EC1B4A867A00EB668A /* scan_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "scan_bg@2x.png"; sourceTree = "<group>"; };
@@ -2690,6 +2703,27 @@
26902703
path = icon_file_state;
26912704
sourceTree = "<group>";
26922705
};
2706+
4E93F2301B84243D00017916 /* KxMenu */ = {
2707+
isa = PBXGroup;
2708+
children = (
2709+
4E93F2311B84243D00017916 /* KxMenu.h */,
2710+
4E93F2321B84243D00017916 /* KxMenu.m */,
2711+
);
2712+
path = KxMenu;
2713+
sourceTree = "<group>";
2714+
};
2715+
4E93F2341B84356500017916 /* file_menu_icon */ = {
2716+
isa = PBXGroup;
2717+
children = (
2718+
4E93F2351B84356500017916 /* file_menu_icon_delete@2x.png */,
2719+
4E93F2361B84356500017916 /* file_menu_icon_edit@2x.png */,
2720+
4E93F2371B84356500017916 /* file_menu_icon_info@2x.png */,
2721+
4E93F2381B84356500017916 /* file_menu_icon_open@2x.png */,
2722+
4E93F2391B84356500017916 /* file_menu_icon_share@2x.png */,
2723+
);
2724+
path = file_menu_icon;
2725+
sourceTree = "<group>";
2726+
};
26932727
4E94C4F51B4D2B9300EB668A /* PopMenu */ = {
26942728
isa = PBXGroup;
26952729
children = (
@@ -3550,6 +3584,7 @@
35503584
8EA6CF5D19E240C40076D59C /* Images */ = {
35513585
isa = PBXGroup;
35523586
children = (
3587+
4E93F2341B84356500017916 /* file_menu_icon */,
35533588
4EAE06BB1B7B51AF00179F4B /* file_activity_icon */,
35543589
4E0022A11B7362EF005308DE /* intro_pages */,
35553590
4E095A751B6B1E40008DC439 /* deadline_calendar */,
@@ -3927,6 +3962,7 @@
39273962
8EA6D03E19E240C40076D59C /* Vendor */ = {
39283963
isa = PBXGroup;
39293964
children = (
3965+
4E93F2301B84243D00017916 /* KxMenu */,
39303966
4E0022971B735075005308DE /* EAIntroView */,
39313967
4E0022931B73506A005308DE /* EARestrictedScrollView */,
39323968
4E095A5D1B6909F9008DC439 /* AutoSlideScrollView */,
@@ -4379,6 +4415,7 @@
43794415
4E96E7D81A1B537E0037C098 /* icon_file_ai@2x.png in Resources */,
43804416
8E525C8919F7E3F800496B34 /* blankpage_button_reload@2x.png in Resources */,
43814417
8E97CEAC1A0C7E26006F9AD7 /* coding_emoji_21@2x.png in Resources */,
4418+
4E93F23A1B84356500017916 /* file_menu_icon_delete@2x.png in Resources */,
43824419
4E4D6AC21B252CD400FD2E49 /* icon_code_tree@2x.png in Resources */,
43834420
8E97CEB01A0C7E26006F9AD7 /* coding_emoji_25@2x.png in Resources */,
43844421
8EF643B719FF7E2900F7EEB0 /* Input_OnlyText_Cell.xib in Resources */,
@@ -4419,6 +4456,7 @@
44194456
8E97CE631A0A3424006F9AD7 /* keyboard_at@2x.png in Resources */,
44204457
8E97CEA41A0C7E26006F9AD7 /* coding_emoji_13@2x.png in Resources */,
44214458
4E6383D71B32665700D98648 /* project_item_task@2x.png in Resources */,
4459+
4E93F23E1B84356500017916 /* file_menu_icon_share@2x.png in Resources */,
44224460
8EA6D14C19E240C40076D59C /* btn_delete_tweetimage@2x.png in Resources */,
44234461
4EC5AD931A258DF8006FA97C /* icon_file_cell_move@2x.png in Resources */,
44244462
4EC5AD941A258DF8006FA97C /* icon_file_cell_rename@2x.png in Resources */,
@@ -4529,11 +4567,13 @@
45294567
4EE548291AE9166B00A92306 /* icon_project_cell_pin@2x.png in Resources */,
45304568
4EBD0C661A1F2011004B4284 /* nav_project_file@2x.png in Resources */,
45314569
8EA6D17E19E240C40076D59C /* section_btn_close@2x.png in Resources */,
4570+
4E93F23C1B84356500017916 /* file_menu_icon_info@2x.png in Resources */,
45324571
8E97CE9E1A0C7E26006F9AD7 /* coding_emoji_07@2x.png in Resources */,
45334572
4EF17ECF1B3C3112003CDD2D /* intro_icon_0@2x.png in Resources */,
45344573
4E6383A91B3262D300D98648 /* taskPriority1_small@2x.png in Resources */,
45354574
4EA7F12D1A6D0C4D00A046BD /* icon_project_private@2x.png in Resources */,
45364575
4E96E7DD1A1B537E0037C098 /* icon_file_movie@2x.png in Resources */,
4576+
4E93F23D1B84356500017916 /* file_menu_icon_open@2x.png in Resources */,
45374577
4EF17EE51B3C3112003CDD2D /* intro_tip_4@3x.png in Resources */,
45384578
8E97CEB41A0C7E26006F9AD7 /* coding_emoji_29@2x.png in Resources */,
45394579
4EAE06C11B7B51AF00179F4B /* file_activity_icon_move_file@2x.png in Resources */,
@@ -4607,6 +4647,7 @@
46074647
8E97CE691A0A3424006F9AD7 /* keyboard_page_selected@2x.png in Resources */,
46084648
4E6383DB1B3266C200D98648 /* mrpr_icon_commit@2x.png in Resources */,
46094649
8E97CE611A0A3424006F9AD7 /* keyboard_add_photo@2x.png in Resources */,
4650+
4E93F23B1B84356500017916 /* file_menu_icon_edit@2x.png in Resources */,
46104651
8E1C3DF619E7F4CA00EF3032 /* address.json in Resources */,
46114652
4EF17ED41B3C3112003CDD2D /* intro_icon_2@3x.png in Resources */,
46124653
8EA6D18819E240C40076D59C /* project_selected@2x.png in Resources */,
@@ -4786,6 +4827,7 @@
47864827
4ECD72EF1AAD7EC300D69AE1 /* Tweet.m in Sources */,
47874828
8EF643CD19FF7E2900F7EEB0 /* TweetCommentMoreCell.m in Sources */,
47884829
8E59F1001A01133C009A905F /* CodeTree.m in Sources */,
4830+
4E93F2331B84243D00017916 /* KxMenu.m in Sources */,
47894831
8EF643BA19FF7E2900F7EEB0 /* MemberCell.m in Sources */,
47904832
4ECE8B021A3946C10021E29C /* JobManager.m in Sources */,
47914833
4E0BD8561B6C7DFD0061CAA6 /* UIView+Frame.m in Sources */,

Coding_iOS/Controllers/FileViewController.m

Lines changed: 91 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#import "FileActivitiesViewController.h"
1818
#import "FileVersionsViewController.h"
1919
#import "FileInfoViewController.h"
20+
#import "KxMenu.h"
2021

2122
@interface FileViewController () <QLPreviewControllerDataSource, QLPreviewControllerDelegate, UIDocumentInteractionControllerDelegate, UIWebViewDelegate, EaseToolBarDelegate>
2223
@property (strong, nonatomic, readwrite) ProjectFile *curFile;
@@ -99,10 +100,10 @@ - (void)configContent{
99100
}else{
100101
self.fileUrl = fileUrl;
101102
[self setupDocumentControllerWithURL:fileUrl];
102-
if ([self.curFile.fileType isEqualToString:@"md"]
103-
|| [self.curFile.fileType isEqualToString:@"html"]
104-
|| [self.curFile.fileType isEqualToString:@"txt"]
105-
|| [self.curFile.fileType isEqualToString:@"plist"]){
103+
if ([self.fileType isEqualToString:@"md"]
104+
|| [self.fileType isEqualToString:@"html"]
105+
|| [self.fileType isEqualToString:@"txt"]
106+
|| [self.fileType isEqualToString:@"plist"]){
106107
[self loadWebView:fileUrl];
107108
}else if ([QLPreviewController canPreviewItem:fileUrl]) {
108109
[self showDiskFile:fileUrl];
@@ -162,7 +163,7 @@ - (void)loadWebView:(NSURL *)fileUrl{
162163
// make.edges.equalTo(self.view);
163164
}];
164165
}
165-
if ([self.curFile.fileType isEqualToString:@"md"]){
166+
if ([self.fileType isEqualToString:@"md"]){
166167
NSError *error = nil;
167168
NSString *htmlStr;
168169
@try {
@@ -178,11 +179,11 @@ - (void)loadWebView:(NSURL *)fileUrl{
178179
}
179180
NSString *contentStr = [WebContentManager markdownPatternedWithContent:htmlStr];
180181
[self.contentWebView loadHTMLString:contentStr baseURL:nil];
181-
}else if ([self.curFile.fileType isEqualToString:@"html"]){
182+
}else if ([self.fileType isEqualToString:@"html"]){
182183
NSString* htmlString = [NSString stringWithContentsOfURL:fileUrl encoding:NSUTF8StringEncoding error:nil];
183184
[self.contentWebView loadHTMLString:htmlString baseURL:nil];
184-
}else if ([self.curFile.fileType isEqualToString:@"plist"]
185-
|| [self.curFile.fileType isEqualToString:@"txt"]){
185+
}else if ([self.fileType isEqualToString:@"plist"]
186+
|| [self.fileType isEqualToString:@"txt"]){
186187
NSData *fileData = [NSData dataWithContentsOfURL:fileUrl];
187188
[self.contentWebView loadData:fileData MIMEType:@"text/text" textEncodingName:@"UTF-8" baseURL:fileUrl];
188189
}else{
@@ -207,7 +208,7 @@ - (void)showDownloadView{
207208
[weakSelf configContent];
208209
};
209210
self.downloadView.otherMethodOpenBlock = ^(){
210-
[weakSelf.docInteractionController presentOpenInMenuFromBarButtonItem:weakSelf.navigationItem.rightBarButtonItem animated:YES];
211+
[weakSelf openByOtherApp];
211212
};
212213
}
213214

@@ -220,6 +221,7 @@ - (void)setupDocumentControllerWithURL:(NSURL *)url{
220221
[self setupNavigationItem];
221222
}
222223

224+
#pragma mark nav M
223225
- (void)setupNavigationItem{
224226
if (self.fileUrl) {
225227
[self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"moreBtn_Nav"] style:UIBarButtonItemStylePlain target:self action:@selector(rightNavBtnClicked)] animated:NO];
@@ -230,26 +232,71 @@ - (void)setupNavigationItem{
230232

231233
- (void)rightNavBtnClicked{
232234
__weak typeof(self) weakSelf = self;
233-
if (self.curFile.preview && self.curFile.preview.length > 0) {
234-
235-
UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle:nil buttonTitles:@[@"保存到相册", @"用其他应用打开"] destructiveTitle:nil cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
236-
switch (index) {
237-
case 0:
238-
[weakSelf saveCurImg];
239-
break;
240-
case 1:
241-
[weakSelf.docInteractionController presentOpenInMenuFromBarButtonItem:self.navigationItem.rightBarButtonItem animated:YES];
242-
break;
243-
default:
244-
break;
235+
if (!_curVersion) {
236+
if ([KxMenu isShowingInView:self.view]) {
237+
[KxMenu dismissMenu:YES];
238+
}else{
239+
[KxMenu setTitleFont:[UIFont systemFontOfSize:14]];
240+
[KxMenu setTintColor:[UIColor whiteColor]];
241+
[KxMenu setLineColor:[UIColor colorWithHexString:@"0xdddddd"]];
242+
243+
NSMutableArray *menuItems = [@[
244+
[KxMenuItem menuItem:@"共享连接" image:[UIImage imageNamed:@"file_menu_icon_share"] target:self action:@selector(goToShareFileLink)],
245+
[KxMenuItem menuItem:@"文件信息" image:[UIImage imageNamed:@"file_menu_icon_info"] target:self action:@selector(goToFileInfo)],
246+
[KxMenuItem menuItem:@"删除文件" image:[UIImage imageNamed:@"file_menu_icon_delete"] target:self action:@selector(deleteCurFile)],
247+
[KxMenuItem menuItem:@"其它应用打开" image:[UIImage imageNamed:@"file_menu_icon_open"] target:self action:@selector(openByOtherApp)],
248+
] mutableCopy];
249+
if ([self fileCanEdit]) {
250+
[menuItems insertObject:[KxMenuItem menuItem:@"编辑文件" image:[UIImage imageNamed:@"file_menu_icon_edit"] target:self action:@selector(goToShareFileLink)]
251+
atIndex:0];
245252
}
246-
}];
247-
[actionSheet showInView:self.view];
253+
[menuItems setValue:[UIColor colorWithHexString:@"0x222222"] forKey:@"foreColor"];
254+
CGRect senderFrame = CGRectMake(kScreen_Width - (kDevice_Is_iPhone6Plus? 30: 26), 0, 0, 0);
255+
[KxMenu showMenuInView:self.view
256+
fromRect:senderFrame
257+
menuItems:menuItems];
258+
}
248259
}else{
249-
[self.docInteractionController presentOpenInMenuFromBarButtonItem:self.navigationItem.rightBarButtonItem animated:YES];
260+
if (self.preview && self.preview.length > 0) {
261+
UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle:nil buttonTitles:@[@"保存到相册", @"用其他应用打开"] destructiveTitle:nil cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
262+
switch (index) {
263+
case 0:
264+
[weakSelf saveCurImg];
265+
break;
266+
case 1:
267+
[weakSelf openByOtherApp];
268+
break;
269+
default:
270+
break;
271+
}
272+
}];
273+
[actionSheet showInView:self.view];
274+
}else{
275+
[self openByOtherApp];
276+
}
250277
}
251278
}
252279

280+
- (void)goToEditFile{
281+
282+
}
283+
284+
- (void)goToShareFileLink{
285+
286+
}
287+
288+
- (void)goToFileInfo{
289+
290+
}
291+
292+
- (void)deleteCurFile{
293+
294+
}
295+
296+
- (void)openByOtherApp{
297+
[self.docInteractionController presentOpenInMenuFromBarButtonItem:self.navigationItem.rightBarButtonItem animated:YES];
298+
}
299+
253300
- (void)saveCurImg{
254301
SEL selectorToCall = @selector(imageWasSavedSuccessfully:didFinishSavingWithError:contextInfo:);
255302

@@ -292,10 +339,10 @@ - (void)webViewDidStartLoad:(UIWebView *)webView{
292339
}
293340
- (void)webViewDidFinishLoad:(UIWebView *)webView{
294341
[_activityIndicator stopAnimating];
295-
if ([self.curFile.fileType isEqualToString:@"plist"]
296-
|| [self.curFile.fileType isEqualToString:@"txt"]){
342+
if ([self.fileType isEqualToString:@"plist"]
343+
|| [self.fileType isEqualToString:@"txt"]){
297344
[webView stringByEvaluatingJavaScriptFromString:@"document.body.style.zoom = 3.0;"];
298-
}else if ([self.curFile.fileType isEqualToString:@"html"]){
345+
}else if ([self.fileType isEqualToString:@"html"]){
299346
[webView stringByEvaluatingJavaScriptFromString:@"document.body.style.zoom = 2.0;"];
300347
}
301348
}
@@ -329,6 +376,20 @@ - (NSURL *)hasBeenDownload{
329376
}
330377
return fileUrl;
331378
}
379+
- (NSString *)fileType{
380+
if (_curVersion) {
381+
return _curVersion.fileType;
382+
}else{
383+
return _curFile.fileType;
384+
}
385+
}
386+
- (NSString *)preview{
387+
if (_curVersion) {
388+
return _curVersion.preview;
389+
}else{
390+
return _curFile.preview;
391+
}
392+
}
332393
- (NSString *)titleStr{
333394
if (_curVersion) {
334395
return _curVersion.remark;
@@ -343,6 +404,9 @@ - (CGFloat)toolBarHeight{
343404
return 49.0;
344405
}
345406
}
407+
- (BOOL)fileCanEdit{
408+
return YES;
409+
}
346410
@end
347411

348412

349 Bytes
Loading
881 Bytes
Loading
1.24 KB
Loading
1.67 KB
Loading
1.33 KB
Loading

Coding_iOS/Vendor/KxMenu/KxMenu.h

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
//
2+
// KxMenu.h
3+
// kxmenu project
4+
// https://github.com/kolyvan/kxmenu/
5+
//
6+
// Created by Kolyvan on 17.05.13.
7+
//
8+
9+
/*
10+
Copyright (c) 2013 Konstantin Bukreev. All rights reserved.
11+
12+
Redistribution and use in source and binary forms, with or without
13+
modification, are permitted provided that the following conditions are met:
14+
15+
- Redistributions of source code must retain the above copyright notice, this
16+
list of conditions and the following disclaimer.
17+
18+
- Redistributions in binary form must reproduce the above copyright notice,
19+
this list of conditions and the following disclaimer in the documentation
20+
and/or other materials provided with the distribution.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
*/
33+
34+
35+
#import <Foundation/Foundation.h>
36+
37+
@interface KxMenuItem : NSObject
38+
39+
@property (readwrite, nonatomic, strong) UIImage *image;
40+
@property (readwrite, nonatomic, strong) NSString *title;
41+
@property (readwrite, nonatomic, weak) id target;
42+
@property (readwrite, nonatomic) SEL action;
43+
@property (readwrite, nonatomic, strong) UIColor *foreColor;
44+
@property (readwrite, nonatomic) NSTextAlignment alignment;
45+
46+
+ (instancetype) menuItem:(NSString *) title
47+
image:(UIImage *) image
48+
target:(id)target
49+
action:(SEL) action;
50+
51+
@end
52+
53+
@interface KxMenu : NSObject
54+
55+
+ (void) showMenuInView:(UIView *)view
56+
fromRect:(CGRect)rect
57+
menuItems:(NSArray *)menuItems;
58+
59+
+ (void)dismissMenu:(BOOL) animated;
60+
61+
+ (BOOL)isShowingInView:(UIView *)view;
62+
63+
+ (UIColor *) tintColor;
64+
+ (void) setTintColor: (UIColor *) tintColor;
65+
66+
+ (UIColor *) lineColor;
67+
+ (void) setLineColor: (UIColor *) lineColor;
68+
69+
+ (UIColor *) overlayColor;
70+
+ (void) setOverlayColor: (UIColor *) overlayColor;
71+
72+
+ (UIFont *) titleFont;
73+
+ (void) setTitleFont: (UIFont *) titleFont;
74+
75+
@end

0 commit comments

Comments
 (0)