├── README.md
├── ZZYMenuController
├── ZZYMenuController.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── project.pbxproj
├── ZZYMenuController
│ ├── ZZYMenuLabel.h
│ ├── ZZYTableViewCell.h
│ ├── ViewController.h
│ ├── ZZYCustomViewController.h
│ ├── ZZYTableViewController.h
│ ├── ZZYTableViewCell.m
│ ├── AppDelegate.h
│ ├── main.m
│ ├── ViewController.m
│ ├── ZZYCustomViewController.m
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── AppDelegate.m
│ ├── ZZYTableViewController.m
│ └── ZZYMenuLabel.m
├── ZZYMenuControllerTests
│ ├── Info.plist
│ └── ZZYMenuControllerTests.m
└── ZZYMenuControllerUITests
│ ├── Info.plist
│ └── ZZYMenuControllerUITests.m
├── LICENSE
└── .gitignore
/README.md:
--------------------------------------------------------------------------------
1 | # ZZYMeunControllerDemo
2 |
3 |
4 | 
5 |
6 | [简书讲解地址](http://www.jianshu.com/p/71076f65835d)
7 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ZZYMenuLabel.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYMenuLabel.h
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZZYMenuLabel : UILabel
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ZZYTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYTableViewCell.h
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZZYTableViewCell : UITableViewCell
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ZZYCustomViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYCustomViewController.h
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZZYCustomViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ZZYTableViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYTableViewController.h
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZZYTableViewController : UITableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ZZYTableViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYTableViewCell.m
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import "ZZYTableViewCell.h"
10 |
11 | @implementation ZZYTableViewCell
12 |
13 | - (BOOL)canBecomeFirstResponder
14 | {
15 | return YES;
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 |
21 |
22 |
23 |
24 | }
25 |
26 | - (void)didReceiveMemoryWarning {
27 | [super didReceiveMemoryWarning];
28 | // Dispose of any resources that can be recreated.
29 | }
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuControllerTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuControllerUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 ZYVIP
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ZZYCustomViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYCustomViewController.m
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import "ZZYCustomViewController.h"
10 | #import "ZZYMenuLabel.h"
11 |
12 | @interface ZZYCustomViewController ()
13 | @property (weak, nonatomic) IBOutlet UIWebView *webView;
14 |
15 | @property (weak, nonatomic) IBOutlet ZZYMenuLabel *label;
16 | @end
17 |
18 | @implementation ZZYCustomViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | // Do any additional setup after loading the view from its nib.
23 |
24 | [self.webView loadHTMLString:@"这是一个WebView控件
" baseURL:nil];
25 |
26 |
27 | self.label.text = @"这是一个Label控件";
28 |
29 | }
30 |
31 | - (void)didReceiveMemoryWarning {
32 | [super didReceiveMemoryWarning];
33 | // Dispose of any resources that can be recreated.
34 | }
35 |
36 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
37 | {
38 | [self.view endEditing:YES];
39 | }
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuControllerTests/ZZYMenuControllerTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYMenuControllerTests.m
3 | // ZZYMenuControllerTests
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZZYMenuControllerTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation ZZYMenuControllerTests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 | // Put setup code here. This method is called before the invocation of each test method in the class.
20 | }
21 |
22 | - (void)tearDown {
23 | // Put teardown code here. This method is called after the invocation of each test method in the class.
24 | [super tearDown];
25 | }
26 |
27 | - (void)testExample {
28 | // This is an example of a functional test case.
29 | // Use XCTAssert and related functions to verify your tests produce the correct results.
30 | }
31 |
32 | - (void)testPerformanceExample {
33 | // This is an example of a performance test case.
34 | [self measureBlock:^{
35 | // Put the code you want to measure the time of here.
36 | }];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuControllerUITests/ZZYMenuControllerUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYMenuControllerUITests.m
3 | // ZZYMenuControllerUITests
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZZYMenuControllerUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation ZZYMenuControllerUITests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 |
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 |
22 | // In UI tests it is usually best to stop immediately when a failure occurs.
23 | self.continueAfterFailure = NO;
24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
25 | [[[XCUIApplication alloc] init] launch];
26 |
27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
28 | }
29 |
30 | - (void)tearDown {
31 | // Put teardown code here. This method is called after the invocation of each test method in the class.
32 | [super tearDown];
33 | }
34 |
35 | - (void)testExample {
36 | // Use recording to get started writing UI tests.
37 | // Use XCTAssert and related functions to verify your tests produce the correct results.
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "83.5x83.5",
66 | "scale" : "2x"
67 | }
68 | ],
69 | "info" : {
70 | "version" : 1,
71 | "author" : "xcode"
72 | }
73 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xcuserstate
23 |
24 | ## Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 | *.dSYM.zip
28 | *.dSYM
29 |
30 | # CocoaPods
31 | #
32 | # We recommend against adding the Pods directory to your .gitignore. However
33 | # you should judge for yourself, the pros and cons are mentioned at:
34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
35 | #
36 | # Pods/
37 |
38 | # Carthage
39 | #
40 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
41 | # Carthage/Checkouts
42 |
43 | Carthage/Build
44 |
45 | # fastlane
46 | #
47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48 | # screenshots whenever they are needed.
49 | # For more information about the recommended setup visit:
50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
51 |
52 | fastlane/report.xml
53 | fastlane/screenshots
54 |
55 | #Code Injection
56 | #
57 | # After new code Injection tools there's a generated folder /iOSInjectionProject
58 | # https://github.com/johnno1962/injectionforxcode
59 |
60 | iOSInjectionProject/
61 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 | - (void)applicationWillResignActive:(UIApplication *)application {
24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application {
29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application {
34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ZZYTableViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYTableViewController.m
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import "ZZYTableViewController.h"
10 | #import "ZZYTableViewCell.h"
11 |
12 | @interface ZZYTableViewController ()
13 |
14 | @property (nonatomic, weak) ZZYTableViewCell * selectCell;
15 |
16 | @end
17 |
18 | @implementation ZZYTableViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 |
23 | // Uncomment the following line to preserve selection between presentations.
24 | // self.clearsSelectionOnViewWillAppear = NO;
25 |
26 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
27 | // self.navigationItem.rightBarButtonItem = self.editButtonItem;
28 | }
29 |
30 | - (void)didReceiveMemoryWarning {
31 | [super didReceiveMemoryWarning];
32 | // Dispose of any resources that can be recreated.
33 | }
34 |
35 | #pragma mark - Table view data source
36 |
37 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
38 |
39 | return 1;
40 | }
41 |
42 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
43 | return 10;
44 | }
45 |
46 |
47 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
48 | ZZYTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
49 |
50 | cell.textLabel.text = [NSString stringWithFormat:@"第%zd行",indexPath.row];
51 |
52 | return cell;
53 | }
54 |
55 |
56 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
57 | {
58 | //当menucontroller显示,点击不同的cell时为什么会显示。
59 | // menuController的显示依赖于第一响应者,当点击另外的cell时,当前cell取消第一响应者状态,menucontroller自动消失
60 | UIMenuController * menu = [UIMenuController sharedMenuController];
61 | NSLog(@"%d",menu.isMenuVisible);
62 | //防止点击多次创建
63 | if (menu.isMenuVisible)
64 | {
65 | [menu setMenuVisible:NO animated:YES];
66 | }
67 | else
68 | {
69 |
70 | ZZYTableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath];
71 | self.selectCell = cell;
72 |
73 | [cell becomeFirstResponder];
74 |
75 | UIMenuItem * item0 = [[UIMenuItem alloc]initWithTitle:@"分享" action:@selector(share:)];
76 | UIMenuItem * item1 = [[UIMenuItem alloc]initWithTitle:@"评论" action:@selector(comment:)];
77 | UIMenuItem * item2 = [[UIMenuItem alloc]initWithTitle:@"点赞" action:@selector(praise:)];
78 | menu.menuItems = @[item0,item1,item2];
79 |
80 | [menu setTargetRect:CGRectMake(0, cell.frame.size.height * 0.5, cell.frame.size.width, cell.frame.size.height) inView:cell];
81 |
82 | [menu setMenuVisible:YES animated:YES];
83 | }
84 | }
85 |
86 |
87 | - (void)share:(UIMenuController *)menu
88 | {
89 | NSLog(@"%@",self.selectCell.textLabel.text);
90 |
91 | UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"提示" message:self.selectCell.textLabel.text delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
92 | [alert show];
93 |
94 | }
95 |
96 | - (void)comment:(UIMenuController *)menu
97 | {
98 |
99 | }
100 |
101 | - (void)praise:(UIMenuController *)menu
102 | {
103 |
104 | }
105 |
106 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
107 | {
108 | UIMenuController * menu = [UIMenuController sharedMenuController];
109 | [menu setMenuVisible:NO animated:YES];
110 | }
111 |
112 | @end
113 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/ZZYMenuLabel.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZZYMenuLabel.m
3 | // ZZYMenuController
4 | //
5 | // Created by admin on 16/7/9.
6 | // Copyright © 2016年 断剑. All rights reserved.
7 | //
8 |
9 | #import "ZZYMenuLabel.h"
10 |
11 | @implementation ZZYMenuLabel
12 |
13 | /**
14 | * xib创建label时调用
15 | */
16 | - (void)awakeFromNib
17 | {
18 | [self setUp];
19 | }
20 |
21 | /**
22 | * 代码创建label时调用
23 | */
24 | - (instancetype)initWithFrame:(CGRect)frame
25 | {
26 | if (self = [super initWithFrame:frame]) {
27 | [self setUp];
28 | }
29 | return self;
30 | }
31 |
32 | - (void)setUp
33 | {
34 | self.userInteractionEnabled = YES;
35 | [self addGestureRecognizer:[[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPress)]];
36 | }
37 |
38 | - (void)longPress
39 | {
40 | NSLog(@"%s",__func__);
41 |
42 | //1.设置label为第一响应者
43 | //通过设置第一响应者UIMenuController可以获得支持哪些操作的信息,操作怎么处理
44 | [self becomeFirstResponder];
45 |
46 | //2.设置UIMenuController
47 | UIMenuController * menu = [UIMenuController sharedMenuController];
48 |
49 | //自定义 UIMenuController
50 |
51 | UIMenuItem * item1 = [[UIMenuItem alloc]initWithTitle:@"剪切" action:@selector(myCut:)];
52 | UIMenuItem * item2 = [[UIMenuItem alloc]initWithTitle:@"粘贴" action:@selector(myPaste:)];
53 | menu.menuItems = @[item1,item2];
54 |
55 | NSLog(@"%d",menu.isMenuVisible);
56 | //当长按label的时候,这个方法会不断调用,menu就会出现一闪一闪不断显示,需要在此处进行判断
57 | if (menu.isMenuVisible)return;
58 | /**
59 | * 设置UIMenuController的显示相关信息
60 | *
61 | * @param targetRect UIMenuController 需要指向的矩形框
62 | * @param targetView targetRect会以targetView的左上角为坐标原点进行显示
63 | */
64 | // - (void)setTargetRect:(CGRect)targetRect inView:(UIView *)targetView;
65 | [menu setTargetRect:self.bounds inView:self];
66 | // [menu setTargetRect:self.frame inView:self.superview];
67 |
68 | [menu setMenuVisible:YES animated:YES];
69 |
70 | }
71 |
72 | #pragma mark - 对控件权限进行设置
73 | /**
74 | * 设置label可以成为第一响应者
75 | *
76 | * @注意:不是每个控件都有资格成为第一响应者
77 | */
78 | - (BOOL)canBecomeFirstResponder
79 | {
80 | return YES;
81 | }
82 | /**
83 | * 设置label能够执行那些具体操作
84 | *
85 | * @param action 具体操作
86 | *
87 | * @return YES:支持该操作
88 | */
89 | - (BOOL)canPerformAction:(SEL)action withSender:(id)sender
90 | {
91 | // NSLog(@"%@",NSStringFromSelector(action));
92 |
93 | if(action == @selector(cut:) || action == @selector(copy:) || action == @selector(myCut:)|| action == @selector(myPaste:)) return YES;
94 | return NO;
95 | }
96 |
97 | /** 系统默认方法:
98 |
99 | * cut:
100 | copy:
101 | select:
102 | selectAll:
103 | paste:
104 | delete:
105 | _promptForReplace:
106 | _transliterateChinese:
107 | _showTextStyleOptions:
108 | _define:
109 | _addShortcut:
110 | _accessibilitySpeak:
111 | _accessibilitySpeakLanguageSelection:
112 | _accessibilityPauseSpeaking:
113 | _share:
114 | makeTextWritingDirectionRightToLeft:
115 | makeTextWritingDirectionLeftToRight:
116 | */
117 |
118 | #pragma mark - 方法的实现
119 | //- (void)cut:(id)sender
120 | //{
121 | //
122 | // NSLog(@"%@",sender);
123 | //
124 | //}
125 |
126 | - (void)myCut:(UIMenuController *) menu
127 | {
128 | NSLog(@"%s---%@",__func__,menu);
129 | //复制文字到剪切板
130 | [self copy:menu];
131 | //清空文字
132 | self.text = nil;
133 |
134 | }
135 |
136 | - (void)cut:(UIMenuController *)menu
137 | {
138 | NSLog(@"%s---%@",__func__,menu);
139 |
140 | //复制文字到剪切板
141 | [self copy:menu];
142 | //清空文字
143 | self.text = nil;
144 |
145 | }
146 |
147 | - (void)copy:(UIMenuController *)menu
148 | {
149 | //当没有文字的时候调用这个方法会崩溃
150 | if (!self.text) return;
151 | //复制文字到剪切板
152 | UIPasteboard * paste = [UIPasteboard generalPasteboard];
153 | paste.string = self.text;
154 |
155 | }
156 |
157 | - (void)myPaste:(UIMenuController *)menu
158 | {
159 | //将剪切板文字赋值给label
160 | UIPasteboard * paste = [UIPasteboard generalPasteboard];
161 | self.text = paste.string;
162 | }
163 |
164 | @end
165 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
50 |
51 |
52 |
53 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
118 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
--------------------------------------------------------------------------------
/ZZYMenuController/ZZYMenuController.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 84ECB2DE1D30FC3600E86756 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ECB2DD1D30FC3600E86756 /* main.m */; };
11 | 84ECB2E11D30FC3600E86756 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ECB2E01D30FC3600E86756 /* AppDelegate.m */; };
12 | 84ECB2E41D30FC3600E86756 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ECB2E31D30FC3600E86756 /* ViewController.m */; };
13 | 84ECB2E71D30FC3600E86756 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84ECB2E51D30FC3600E86756 /* Main.storyboard */; };
14 | 84ECB2E91D30FC3600E86756 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84ECB2E81D30FC3600E86756 /* Assets.xcassets */; };
15 | 84ECB2EC1D30FC3600E86756 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84ECB2EA1D30FC3600E86756 /* LaunchScreen.storyboard */; };
16 | 84ECB2F71D30FC3600E86756 /* ZZYMenuControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ECB2F61D30FC3600E86756 /* ZZYMenuControllerTests.m */; };
17 | 84ECB3021D30FC3600E86756 /* ZZYMenuControllerUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ECB3011D30FC3600E86756 /* ZZYMenuControllerUITests.m */; };
18 | 84ECB3121D3102CD00E86756 /* ZZYCustomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ECB3101D3102CD00E86756 /* ZZYCustomViewController.m */; };
19 | 84ECB3161D3123DA00E86756 /* ZZYMenuLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ECB3151D3123DA00E86756 /* ZZYMenuLabel.m */; };
20 | 84ECB3191D3134AB00E86756 /* ZZYTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ECB3181D3134AB00E86756 /* ZZYTableViewController.m */; };
21 | 84ECB31C1D3145C800E86756 /* ZZYTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ECB31B1D3145C800E86756 /* ZZYTableViewCell.m */; };
22 | /* End PBXBuildFile section */
23 |
24 | /* Begin PBXContainerItemProxy section */
25 | 84ECB2F31D30FC3600E86756 /* PBXContainerItemProxy */ = {
26 | isa = PBXContainerItemProxy;
27 | containerPortal = 84ECB2D11D30FC3600E86756 /* Project object */;
28 | proxyType = 1;
29 | remoteGlobalIDString = 84ECB2D81D30FC3600E86756;
30 | remoteInfo = ZZYMenuController;
31 | };
32 | 84ECB2FE1D30FC3600E86756 /* PBXContainerItemProxy */ = {
33 | isa = PBXContainerItemProxy;
34 | containerPortal = 84ECB2D11D30FC3600E86756 /* Project object */;
35 | proxyType = 1;
36 | remoteGlobalIDString = 84ECB2D81D30FC3600E86756;
37 | remoteInfo = ZZYMenuController;
38 | };
39 | /* End PBXContainerItemProxy section */
40 |
41 | /* Begin PBXFileReference section */
42 | 84ECB2D91D30FC3600E86756 /* ZZYMenuController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZZYMenuController.app; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 84ECB2DD1D30FC3600E86756 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
44 | 84ECB2DF1D30FC3600E86756 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
45 | 84ECB2E01D30FC3600E86756 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
46 | 84ECB2E21D30FC3600E86756 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
47 | 84ECB2E31D30FC3600E86756 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
48 | 84ECB2E61D30FC3600E86756 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
49 | 84ECB2E81D30FC3600E86756 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
50 | 84ECB2EB1D30FC3600E86756 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
51 | 84ECB2ED1D30FC3600E86756 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
52 | 84ECB2F21D30FC3600E86756 /* ZZYMenuControllerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZZYMenuControllerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 84ECB2F61D30FC3600E86756 /* ZZYMenuControllerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZZYMenuControllerTests.m; sourceTree = ""; };
54 | 84ECB2F81D30FC3600E86756 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | 84ECB2FD1D30FC3600E86756 /* ZZYMenuControllerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZZYMenuControllerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
56 | 84ECB3011D30FC3600E86756 /* ZZYMenuControllerUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZZYMenuControllerUITests.m; sourceTree = ""; };
57 | 84ECB3031D30FC3600E86756 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | 84ECB30F1D3102CD00E86756 /* ZZYCustomViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZZYCustomViewController.h; sourceTree = ""; };
59 | 84ECB3101D3102CD00E86756 /* ZZYCustomViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZZYCustomViewController.m; sourceTree = ""; };
60 | 84ECB3141D3123DA00E86756 /* ZZYMenuLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZZYMenuLabel.h; sourceTree = ""; };
61 | 84ECB3151D3123DA00E86756 /* ZZYMenuLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZZYMenuLabel.m; sourceTree = ""; };
62 | 84ECB3171D3134AB00E86756 /* ZZYTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZZYTableViewController.h; sourceTree = ""; };
63 | 84ECB3181D3134AB00E86756 /* ZZYTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZZYTableViewController.m; sourceTree = ""; };
64 | 84ECB31A1D3145C800E86756 /* ZZYTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZZYTableViewCell.h; sourceTree = ""; };
65 | 84ECB31B1D3145C800E86756 /* ZZYTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZZYTableViewCell.m; sourceTree = ""; };
66 | /* End PBXFileReference section */
67 |
68 | /* Begin PBXFrameworksBuildPhase section */
69 | 84ECB2D61D30FC3600E86756 /* Frameworks */ = {
70 | isa = PBXFrameworksBuildPhase;
71 | buildActionMask = 2147483647;
72 | files = (
73 | );
74 | runOnlyForDeploymentPostprocessing = 0;
75 | };
76 | 84ECB2EF1D30FC3600E86756 /* Frameworks */ = {
77 | isa = PBXFrameworksBuildPhase;
78 | buildActionMask = 2147483647;
79 | files = (
80 | );
81 | runOnlyForDeploymentPostprocessing = 0;
82 | };
83 | 84ECB2FA1D30FC3600E86756 /* Frameworks */ = {
84 | isa = PBXFrameworksBuildPhase;
85 | buildActionMask = 2147483647;
86 | files = (
87 | );
88 | runOnlyForDeploymentPostprocessing = 0;
89 | };
90 | /* End PBXFrameworksBuildPhase section */
91 |
92 | /* Begin PBXGroup section */
93 | 84ECB2D01D30FC3600E86756 = {
94 | isa = PBXGroup;
95 | children = (
96 | 84ECB2DB1D30FC3600E86756 /* ZZYMenuController */,
97 | 84ECB2F51D30FC3600E86756 /* ZZYMenuControllerTests */,
98 | 84ECB3001D30FC3600E86756 /* ZZYMenuControllerUITests */,
99 | 84ECB2DA1D30FC3600E86756 /* Products */,
100 | );
101 | sourceTree = "";
102 | };
103 | 84ECB2DA1D30FC3600E86756 /* Products */ = {
104 | isa = PBXGroup;
105 | children = (
106 | 84ECB2D91D30FC3600E86756 /* ZZYMenuController.app */,
107 | 84ECB2F21D30FC3600E86756 /* ZZYMenuControllerTests.xctest */,
108 | 84ECB2FD1D30FC3600E86756 /* ZZYMenuControllerUITests.xctest */,
109 | );
110 | name = Products;
111 | sourceTree = "";
112 | };
113 | 84ECB2DB1D30FC3600E86756 /* ZZYMenuController */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 84ECB2DF1D30FC3600E86756 /* AppDelegate.h */,
117 | 84ECB2E01D30FC3600E86756 /* AppDelegate.m */,
118 | 84ECB2E21D30FC3600E86756 /* ViewController.h */,
119 | 84ECB2E31D30FC3600E86756 /* ViewController.m */,
120 | 84ECB30F1D3102CD00E86756 /* ZZYCustomViewController.h */,
121 | 84ECB3101D3102CD00E86756 /* ZZYCustomViewController.m */,
122 | 84ECB3171D3134AB00E86756 /* ZZYTableViewController.h */,
123 | 84ECB3181D3134AB00E86756 /* ZZYTableViewController.m */,
124 | 84ECB3141D3123DA00E86756 /* ZZYMenuLabel.h */,
125 | 84ECB3151D3123DA00E86756 /* ZZYMenuLabel.m */,
126 | 84ECB31A1D3145C800E86756 /* ZZYTableViewCell.h */,
127 | 84ECB31B1D3145C800E86756 /* ZZYTableViewCell.m */,
128 | 84ECB2E51D30FC3600E86756 /* Main.storyboard */,
129 | 84ECB2E81D30FC3600E86756 /* Assets.xcassets */,
130 | 84ECB2EA1D30FC3600E86756 /* LaunchScreen.storyboard */,
131 | 84ECB2ED1D30FC3600E86756 /* Info.plist */,
132 | 84ECB2DC1D30FC3600E86756 /* Supporting Files */,
133 | );
134 | path = ZZYMenuController;
135 | sourceTree = "";
136 | };
137 | 84ECB2DC1D30FC3600E86756 /* Supporting Files */ = {
138 | isa = PBXGroup;
139 | children = (
140 | 84ECB2DD1D30FC3600E86756 /* main.m */,
141 | );
142 | name = "Supporting Files";
143 | sourceTree = "";
144 | };
145 | 84ECB2F51D30FC3600E86756 /* ZZYMenuControllerTests */ = {
146 | isa = PBXGroup;
147 | children = (
148 | 84ECB2F61D30FC3600E86756 /* ZZYMenuControllerTests.m */,
149 | 84ECB2F81D30FC3600E86756 /* Info.plist */,
150 | );
151 | path = ZZYMenuControllerTests;
152 | sourceTree = "";
153 | };
154 | 84ECB3001D30FC3600E86756 /* ZZYMenuControllerUITests */ = {
155 | isa = PBXGroup;
156 | children = (
157 | 84ECB3011D30FC3600E86756 /* ZZYMenuControllerUITests.m */,
158 | 84ECB3031D30FC3600E86756 /* Info.plist */,
159 | );
160 | path = ZZYMenuControllerUITests;
161 | sourceTree = "";
162 | };
163 | /* End PBXGroup section */
164 |
165 | /* Begin PBXNativeTarget section */
166 | 84ECB2D81D30FC3600E86756 /* ZZYMenuController */ = {
167 | isa = PBXNativeTarget;
168 | buildConfigurationList = 84ECB3061D30FC3600E86756 /* Build configuration list for PBXNativeTarget "ZZYMenuController" */;
169 | buildPhases = (
170 | 84ECB2D51D30FC3600E86756 /* Sources */,
171 | 84ECB2D61D30FC3600E86756 /* Frameworks */,
172 | 84ECB2D71D30FC3600E86756 /* Resources */,
173 | );
174 | buildRules = (
175 | );
176 | dependencies = (
177 | );
178 | name = ZZYMenuController;
179 | productName = ZZYMenuController;
180 | productReference = 84ECB2D91D30FC3600E86756 /* ZZYMenuController.app */;
181 | productType = "com.apple.product-type.application";
182 | };
183 | 84ECB2F11D30FC3600E86756 /* ZZYMenuControllerTests */ = {
184 | isa = PBXNativeTarget;
185 | buildConfigurationList = 84ECB3091D30FC3600E86756 /* Build configuration list for PBXNativeTarget "ZZYMenuControllerTests" */;
186 | buildPhases = (
187 | 84ECB2EE1D30FC3600E86756 /* Sources */,
188 | 84ECB2EF1D30FC3600E86756 /* Frameworks */,
189 | 84ECB2F01D30FC3600E86756 /* Resources */,
190 | );
191 | buildRules = (
192 | );
193 | dependencies = (
194 | 84ECB2F41D30FC3600E86756 /* PBXTargetDependency */,
195 | );
196 | name = ZZYMenuControllerTests;
197 | productName = ZZYMenuControllerTests;
198 | productReference = 84ECB2F21D30FC3600E86756 /* ZZYMenuControllerTests.xctest */;
199 | productType = "com.apple.product-type.bundle.unit-test";
200 | };
201 | 84ECB2FC1D30FC3600E86756 /* ZZYMenuControllerUITests */ = {
202 | isa = PBXNativeTarget;
203 | buildConfigurationList = 84ECB30C1D30FC3600E86756 /* Build configuration list for PBXNativeTarget "ZZYMenuControllerUITests" */;
204 | buildPhases = (
205 | 84ECB2F91D30FC3600E86756 /* Sources */,
206 | 84ECB2FA1D30FC3600E86756 /* Frameworks */,
207 | 84ECB2FB1D30FC3600E86756 /* Resources */,
208 | );
209 | buildRules = (
210 | );
211 | dependencies = (
212 | 84ECB2FF1D30FC3600E86756 /* PBXTargetDependency */,
213 | );
214 | name = ZZYMenuControllerUITests;
215 | productName = ZZYMenuControllerUITests;
216 | productReference = 84ECB2FD1D30FC3600E86756 /* ZZYMenuControllerUITests.xctest */;
217 | productType = "com.apple.product-type.bundle.ui-testing";
218 | };
219 | /* End PBXNativeTarget section */
220 |
221 | /* Begin PBXProject section */
222 | 84ECB2D11D30FC3600E86756 /* Project object */ = {
223 | isa = PBXProject;
224 | attributes = {
225 | LastUpgradeCheck = 0720;
226 | ORGANIZATIONNAME = "断剑";
227 | TargetAttributes = {
228 | 84ECB2D81D30FC3600E86756 = {
229 | CreatedOnToolsVersion = 7.2;
230 | };
231 | 84ECB2F11D30FC3600E86756 = {
232 | CreatedOnToolsVersion = 7.2;
233 | TestTargetID = 84ECB2D81D30FC3600E86756;
234 | };
235 | 84ECB2FC1D30FC3600E86756 = {
236 | CreatedOnToolsVersion = 7.2;
237 | TestTargetID = 84ECB2D81D30FC3600E86756;
238 | };
239 | };
240 | };
241 | buildConfigurationList = 84ECB2D41D30FC3600E86756 /* Build configuration list for PBXProject "ZZYMenuController" */;
242 | compatibilityVersion = "Xcode 3.2";
243 | developmentRegion = English;
244 | hasScannedForEncodings = 0;
245 | knownRegions = (
246 | en,
247 | Base,
248 | );
249 | mainGroup = 84ECB2D01D30FC3600E86756;
250 | productRefGroup = 84ECB2DA1D30FC3600E86756 /* Products */;
251 | projectDirPath = "";
252 | projectRoot = "";
253 | targets = (
254 | 84ECB2D81D30FC3600E86756 /* ZZYMenuController */,
255 | 84ECB2F11D30FC3600E86756 /* ZZYMenuControllerTests */,
256 | 84ECB2FC1D30FC3600E86756 /* ZZYMenuControllerUITests */,
257 | );
258 | };
259 | /* End PBXProject section */
260 |
261 | /* Begin PBXResourcesBuildPhase section */
262 | 84ECB2D71D30FC3600E86756 /* Resources */ = {
263 | isa = PBXResourcesBuildPhase;
264 | buildActionMask = 2147483647;
265 | files = (
266 | 84ECB2EC1D30FC3600E86756 /* LaunchScreen.storyboard in Resources */,
267 | 84ECB2E91D30FC3600E86756 /* Assets.xcassets in Resources */,
268 | 84ECB2E71D30FC3600E86756 /* Main.storyboard in Resources */,
269 | );
270 | runOnlyForDeploymentPostprocessing = 0;
271 | };
272 | 84ECB2F01D30FC3600E86756 /* Resources */ = {
273 | isa = PBXResourcesBuildPhase;
274 | buildActionMask = 2147483647;
275 | files = (
276 | );
277 | runOnlyForDeploymentPostprocessing = 0;
278 | };
279 | 84ECB2FB1D30FC3600E86756 /* Resources */ = {
280 | isa = PBXResourcesBuildPhase;
281 | buildActionMask = 2147483647;
282 | files = (
283 | );
284 | runOnlyForDeploymentPostprocessing = 0;
285 | };
286 | /* End PBXResourcesBuildPhase section */
287 |
288 | /* Begin PBXSourcesBuildPhase section */
289 | 84ECB2D51D30FC3600E86756 /* Sources */ = {
290 | isa = PBXSourcesBuildPhase;
291 | buildActionMask = 2147483647;
292 | files = (
293 | 84ECB2E41D30FC3600E86756 /* ViewController.m in Sources */,
294 | 84ECB31C1D3145C800E86756 /* ZZYTableViewCell.m in Sources */,
295 | 84ECB2E11D30FC3600E86756 /* AppDelegate.m in Sources */,
296 | 84ECB2DE1D30FC3600E86756 /* main.m in Sources */,
297 | 84ECB3121D3102CD00E86756 /* ZZYCustomViewController.m in Sources */,
298 | 84ECB3161D3123DA00E86756 /* ZZYMenuLabel.m in Sources */,
299 | 84ECB3191D3134AB00E86756 /* ZZYTableViewController.m in Sources */,
300 | );
301 | runOnlyForDeploymentPostprocessing = 0;
302 | };
303 | 84ECB2EE1D30FC3600E86756 /* Sources */ = {
304 | isa = PBXSourcesBuildPhase;
305 | buildActionMask = 2147483647;
306 | files = (
307 | 84ECB2F71D30FC3600E86756 /* ZZYMenuControllerTests.m in Sources */,
308 | );
309 | runOnlyForDeploymentPostprocessing = 0;
310 | };
311 | 84ECB2F91D30FC3600E86756 /* Sources */ = {
312 | isa = PBXSourcesBuildPhase;
313 | buildActionMask = 2147483647;
314 | files = (
315 | 84ECB3021D30FC3600E86756 /* ZZYMenuControllerUITests.m in Sources */,
316 | );
317 | runOnlyForDeploymentPostprocessing = 0;
318 | };
319 | /* End PBXSourcesBuildPhase section */
320 |
321 | /* Begin PBXTargetDependency section */
322 | 84ECB2F41D30FC3600E86756 /* PBXTargetDependency */ = {
323 | isa = PBXTargetDependency;
324 | target = 84ECB2D81D30FC3600E86756 /* ZZYMenuController */;
325 | targetProxy = 84ECB2F31D30FC3600E86756 /* PBXContainerItemProxy */;
326 | };
327 | 84ECB2FF1D30FC3600E86756 /* PBXTargetDependency */ = {
328 | isa = PBXTargetDependency;
329 | target = 84ECB2D81D30FC3600E86756 /* ZZYMenuController */;
330 | targetProxy = 84ECB2FE1D30FC3600E86756 /* PBXContainerItemProxy */;
331 | };
332 | /* End PBXTargetDependency section */
333 |
334 | /* Begin PBXVariantGroup section */
335 | 84ECB2E51D30FC3600E86756 /* Main.storyboard */ = {
336 | isa = PBXVariantGroup;
337 | children = (
338 | 84ECB2E61D30FC3600E86756 /* Base */,
339 | );
340 | name = Main.storyboard;
341 | sourceTree = "";
342 | };
343 | 84ECB2EA1D30FC3600E86756 /* LaunchScreen.storyboard */ = {
344 | isa = PBXVariantGroup;
345 | children = (
346 | 84ECB2EB1D30FC3600E86756 /* Base */,
347 | );
348 | name = LaunchScreen.storyboard;
349 | sourceTree = "";
350 | };
351 | /* End PBXVariantGroup section */
352 |
353 | /* Begin XCBuildConfiguration section */
354 | 84ECB3041D30FC3600E86756 /* Debug */ = {
355 | isa = XCBuildConfiguration;
356 | buildSettings = {
357 | ALWAYS_SEARCH_USER_PATHS = NO;
358 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
359 | CLANG_CXX_LIBRARY = "libc++";
360 | CLANG_ENABLE_MODULES = YES;
361 | CLANG_ENABLE_OBJC_ARC = YES;
362 | CLANG_WARN_BOOL_CONVERSION = YES;
363 | CLANG_WARN_CONSTANT_CONVERSION = YES;
364 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
365 | CLANG_WARN_EMPTY_BODY = YES;
366 | CLANG_WARN_ENUM_CONVERSION = YES;
367 | CLANG_WARN_INT_CONVERSION = YES;
368 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
369 | CLANG_WARN_UNREACHABLE_CODE = YES;
370 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
371 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
372 | COPY_PHASE_STRIP = NO;
373 | DEBUG_INFORMATION_FORMAT = dwarf;
374 | ENABLE_STRICT_OBJC_MSGSEND = YES;
375 | ENABLE_TESTABILITY = YES;
376 | GCC_C_LANGUAGE_STANDARD = gnu99;
377 | GCC_DYNAMIC_NO_PIC = NO;
378 | GCC_NO_COMMON_BLOCKS = YES;
379 | GCC_OPTIMIZATION_LEVEL = 0;
380 | GCC_PREPROCESSOR_DEFINITIONS = (
381 | "DEBUG=1",
382 | "$(inherited)",
383 | );
384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
385 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
386 | GCC_WARN_UNDECLARED_SELECTOR = YES;
387 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
388 | GCC_WARN_UNUSED_FUNCTION = YES;
389 | GCC_WARN_UNUSED_VARIABLE = YES;
390 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
391 | MTL_ENABLE_DEBUG_INFO = YES;
392 | ONLY_ACTIVE_ARCH = YES;
393 | SDKROOT = iphoneos;
394 | TARGETED_DEVICE_FAMILY = "1,2";
395 | };
396 | name = Debug;
397 | };
398 | 84ECB3051D30FC3600E86756 /* Release */ = {
399 | isa = XCBuildConfiguration;
400 | buildSettings = {
401 | ALWAYS_SEARCH_USER_PATHS = NO;
402 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
403 | CLANG_CXX_LIBRARY = "libc++";
404 | CLANG_ENABLE_MODULES = YES;
405 | CLANG_ENABLE_OBJC_ARC = YES;
406 | CLANG_WARN_BOOL_CONVERSION = YES;
407 | CLANG_WARN_CONSTANT_CONVERSION = YES;
408 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
409 | CLANG_WARN_EMPTY_BODY = YES;
410 | CLANG_WARN_ENUM_CONVERSION = YES;
411 | CLANG_WARN_INT_CONVERSION = YES;
412 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
413 | CLANG_WARN_UNREACHABLE_CODE = YES;
414 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
415 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
416 | COPY_PHASE_STRIP = NO;
417 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
418 | ENABLE_NS_ASSERTIONS = NO;
419 | ENABLE_STRICT_OBJC_MSGSEND = YES;
420 | GCC_C_LANGUAGE_STANDARD = gnu99;
421 | GCC_NO_COMMON_BLOCKS = YES;
422 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
423 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
424 | GCC_WARN_UNDECLARED_SELECTOR = YES;
425 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
426 | GCC_WARN_UNUSED_FUNCTION = YES;
427 | GCC_WARN_UNUSED_VARIABLE = YES;
428 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
429 | MTL_ENABLE_DEBUG_INFO = NO;
430 | SDKROOT = iphoneos;
431 | TARGETED_DEVICE_FAMILY = "1,2";
432 | VALIDATE_PRODUCT = YES;
433 | };
434 | name = Release;
435 | };
436 | 84ECB3071D30FC3600E86756 /* Debug */ = {
437 | isa = XCBuildConfiguration;
438 | buildSettings = {
439 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
440 | INFOPLIST_FILE = ZZYMenuController/Info.plist;
441 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
442 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
443 | PRODUCT_BUNDLE_IDENTIFIER = com.niannan.ZZYMenuController;
444 | PRODUCT_NAME = "$(TARGET_NAME)";
445 | };
446 | name = Debug;
447 | };
448 | 84ECB3081D30FC3600E86756 /* Release */ = {
449 | isa = XCBuildConfiguration;
450 | buildSettings = {
451 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
452 | INFOPLIST_FILE = ZZYMenuController/Info.plist;
453 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
455 | PRODUCT_BUNDLE_IDENTIFIER = com.niannan.ZZYMenuController;
456 | PRODUCT_NAME = "$(TARGET_NAME)";
457 | };
458 | name = Release;
459 | };
460 | 84ECB30A1D30FC3600E86756 /* Debug */ = {
461 | isa = XCBuildConfiguration;
462 | buildSettings = {
463 | BUNDLE_LOADER = "$(TEST_HOST)";
464 | INFOPLIST_FILE = ZZYMenuControllerTests/Info.plist;
465 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
466 | PRODUCT_BUNDLE_IDENTIFIER = com.niannan.ZZYMenuControllerTests;
467 | PRODUCT_NAME = "$(TARGET_NAME)";
468 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZZYMenuController.app/ZZYMenuController";
469 | };
470 | name = Debug;
471 | };
472 | 84ECB30B1D30FC3600E86756 /* Release */ = {
473 | isa = XCBuildConfiguration;
474 | buildSettings = {
475 | BUNDLE_LOADER = "$(TEST_HOST)";
476 | INFOPLIST_FILE = ZZYMenuControllerTests/Info.plist;
477 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
478 | PRODUCT_BUNDLE_IDENTIFIER = com.niannan.ZZYMenuControllerTests;
479 | PRODUCT_NAME = "$(TARGET_NAME)";
480 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZZYMenuController.app/ZZYMenuController";
481 | };
482 | name = Release;
483 | };
484 | 84ECB30D1D30FC3600E86756 /* Debug */ = {
485 | isa = XCBuildConfiguration;
486 | buildSettings = {
487 | INFOPLIST_FILE = ZZYMenuControllerUITests/Info.plist;
488 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
489 | PRODUCT_BUNDLE_IDENTIFIER = com.niannan.ZZYMenuControllerUITests;
490 | PRODUCT_NAME = "$(TARGET_NAME)";
491 | TEST_TARGET_NAME = ZZYMenuController;
492 | USES_XCTRUNNER = YES;
493 | };
494 | name = Debug;
495 | };
496 | 84ECB30E1D30FC3600E86756 /* Release */ = {
497 | isa = XCBuildConfiguration;
498 | buildSettings = {
499 | INFOPLIST_FILE = ZZYMenuControllerUITests/Info.plist;
500 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
501 | PRODUCT_BUNDLE_IDENTIFIER = com.niannan.ZZYMenuControllerUITests;
502 | PRODUCT_NAME = "$(TARGET_NAME)";
503 | TEST_TARGET_NAME = ZZYMenuController;
504 | USES_XCTRUNNER = YES;
505 | };
506 | name = Release;
507 | };
508 | /* End XCBuildConfiguration section */
509 |
510 | /* Begin XCConfigurationList section */
511 | 84ECB2D41D30FC3600E86756 /* Build configuration list for PBXProject "ZZYMenuController" */ = {
512 | isa = XCConfigurationList;
513 | buildConfigurations = (
514 | 84ECB3041D30FC3600E86756 /* Debug */,
515 | 84ECB3051D30FC3600E86756 /* Release */,
516 | );
517 | defaultConfigurationIsVisible = 0;
518 | defaultConfigurationName = Release;
519 | };
520 | 84ECB3061D30FC3600E86756 /* Build configuration list for PBXNativeTarget "ZZYMenuController" */ = {
521 | isa = XCConfigurationList;
522 | buildConfigurations = (
523 | 84ECB3071D30FC3600E86756 /* Debug */,
524 | 84ECB3081D30FC3600E86756 /* Release */,
525 | );
526 | defaultConfigurationIsVisible = 0;
527 | defaultConfigurationName = Release;
528 | };
529 | 84ECB3091D30FC3600E86756 /* Build configuration list for PBXNativeTarget "ZZYMenuControllerTests" */ = {
530 | isa = XCConfigurationList;
531 | buildConfigurations = (
532 | 84ECB30A1D30FC3600E86756 /* Debug */,
533 | 84ECB30B1D30FC3600E86756 /* Release */,
534 | );
535 | defaultConfigurationIsVisible = 0;
536 | defaultConfigurationName = Release;
537 | };
538 | 84ECB30C1D30FC3600E86756 /* Build configuration list for PBXNativeTarget "ZZYMenuControllerUITests" */ = {
539 | isa = XCConfigurationList;
540 | buildConfigurations = (
541 | 84ECB30D1D30FC3600E86756 /* Debug */,
542 | 84ECB30E1D30FC3600E86756 /* Release */,
543 | );
544 | defaultConfigurationIsVisible = 0;
545 | defaultConfigurationName = Release;
546 | };
547 | /* End XCConfigurationList section */
548 | };
549 | rootObject = 84ECB2D11D30FC3600E86756 /* Project object */;
550 | }
551 |
--------------------------------------------------------------------------------