├── .gitignore
├── LICENSE
├── README.md
├── XDKAirMenu.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── xcuserdata
│ └── Wizarx.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ ├── XDKAirMenu.xcscheme
│ └── xcschememanagement.plist
├── XDKAirMenu
├── AppDelegate.h
├── AppDelegate.m
├── Base.lproj
│ ├── Main_iPad.storyboard
│ └── Main_iPhone.storyboard
├── FirstViewController.h
├── FirstViewController.m
├── Images.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── LaunchImage.launchimage
│ │ └── Contents.json
├── SecondViewController.h
├── SecondViewController.m
├── ViewController.h
├── ViewController.m
├── XDKAirMenu-Info.plist
├── XDKAirMenu-Prefix.pch
├── XDKAirMenu
│ ├── XDKAirMenuController.h
│ └── XDKAirMenuController.m
├── en.lproj
│ └── InfoPlist.strings
└── main.m
├── XDKAirMenuTests
├── XDKAirMenuTests-Info.plist
├── XDKAirMenuTests.m
└── en.lproj
│ └── InfoPlist.strings
└── img.gif
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
3 | */build/*
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | profile
14 | *.moved-aside
15 | DerivedData
16 | .idea/
17 | *.hmap
18 | *.xccheckout
19 |
20 | #CocoaPods
21 | Pods
22 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 XavierDK
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | 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, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | XDKAirMenu
2 | ==========
3 |
4 | XDKAirMenu provides a iOs menu like the FIFA app playing with scale and alpha.
5 |
6 | It is compatible for iPhone/iPad, works for portrait and landscape modes and is highly customisable.
7 |
8 |
9 |
10 |
11 | ## How To Get Started
12 |
13 | Download XDKAirMenu and try out the included iPhone example app.
14 |
15 | Check out the documentation for a comprehensive look at all of the functionalities available in XDKAirMenu.
16 |
17 | ### Installation with CocoaPods
18 |
19 | CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the "Getting Started" guide for more information.
20 |
21 | http://guides.cocoapods.org/using/getting-started.html
22 |
23 | Podfile
24 |
25 | pod "XDKAirMenu"
26 |
27 | ### Other installation
28 |
29 | Git clone the source.
30 |
31 | Add XDKAirMenu/XDKAirMenu folder to your project (or workspace).
32 |
33 | ## Quick start
34 |
35 | Import the main header:
36 |
37 | #import
38 |
39 | Get the XDKAirMenuController instance, set the delegate and add it to your hierachy of views/controllers.
40 |
41 | For example:
42 |
43 | - (void)viewDidLoad
44 | {
45 | [super viewDidLoad];
46 |
47 | XDKAirMenuController *menuCtr = [XDKAirMenuController sharedMenu];
48 | menuCtr.airDelegate = self;
49 |
50 | [self.view addSubview:menuCtr.view];
51 | [self addChildViewController:menuCtr];
52 | }
53 |
54 | After that, just implement the required methods delegates :
55 |
56 | /**
57 | * Method of protocol returning the tableView used by the menu
58 | * @param airMenu The menu caller
59 | * @return The tableView used by the menu
60 | */
61 | - (UITableView*)tableViewForAirMenu:(XDKAirMenuController*)airMenu;
62 |
63 | /**
64 | * Method of protocol returning the viewController used by the menu at the indexPath
65 | * @param airMenu The menu caller
66 | * @param indexPath The indexPath
67 | * @return The viewController used by the menu at the indexPath
68 | */
69 | - (UIViewController*)airMenu:(XDKAirMenuController*)airMenu viewControllerAtIndexPath:(NSIndexPath*)indexPath;
70 |
71 | That's all!
72 |
73 | You can also call the opening and closing actions :
74 |
75 | - (IBAction)menuButtonPressed:(id)sender
76 | {
77 | XDKAirMenuController *menu = [XDKAirMenuController sharedMenu];
78 |
79 | if (menu.isMenuOpened)
80 | [menu closeMenuAnimated];
81 | else
82 | [menu openMenuAnimated];
83 | }
84 |
85 | You can also customize with these optionnals methods delegates :
86 |
87 | /**
88 | * Method of protocol returning the width of visible part (Default : 35.f)
89 | *
90 | * @param airMenu The menu caller
91 | *
92 | * @return The width of visible part for controller when menu opened
93 | */
94 | - (CGFloat)widthControllerForAirMenu:(XDKAirMenuController*)airMenu;
95 |
96 | /**
97 | * Method of protocol returning the minimum of scale for the controller (Default : 0.5f)
98 | *
99 | * @param airMenu The menu caller
100 | *
101 | * @return The minimum of scale for the controller
102 | */
103 | - (CGFloat)minScaleControllerForAirMenu:(XDKAirMenuController*)airMenu;
104 |
105 | /**
106 | * Method of protocol returning the minimum of scale for the tableView (Default : 0.8f)
107 | *
108 | * @param airMenu The menu caller
109 | *
110 | * @return The minimum of scale for the tableView
111 | */
112 | - (CGFloat)minScaleTableViewForAirMenu:(XDKAirMenuController*)airMenu;
113 |
114 | /**
115 | * Method of protocol returning the minimum of alpha for the tableView (Default : 0.01f)
116 | *
117 | * @param airMenu The menu caller
118 | *
119 | * @return The minimum of alpha for the tableView
120 | */
121 | - (CGFloat)minAlphaTableViewForAirMenu:(XDKAirMenuController*)airMenu;
122 |
123 |
124 | ##Documentation
125 |
126 | XDKAirMenu comes with full API documentation, which is Xcode Document Set ready. Use appledoc to generate and install the document set into Xcode - http://gentlebytes.com/appledoc/
127 |
128 | To generate the document set using appledoc from the command-line, cd to the root of the source directory and enter:
129 |
130 | ./gen-apple-doc-set
131 |
132 | ##Requirements
133 |
134 | XDKAirMenu is compatible with iOS 6 and upwards. XDKAirMenu uses automatic reference counting (ARC).
135 |
136 | The demo app included with the source requires iOS 6.
137 |
138 | ##ARC
139 |
140 | XDKAirMenu uses automatic reference counting (ARC).
141 |
142 | ##Support
143 |
144 | XDKAirMenu is provided open source with no warranty and no guarantee of support. However, best effort is made to address issues raised on Github.
145 |
146 | If you would like assistance with integrating XDKAirMenu or modifying it for your needs, contact the author Xavier De Koninck xavier.dekoninck@gmail.com for consulting opportunities.
147 |
148 | ##License
149 |
150 | XDKAirMenu is Copyright (c) 2013 Xavier De Koninck and released open source under a MIT license:
151 |
152 | Permission is hereby granted, free of charge, to any person obtaining a copy
153 | of this software and associated documentation files (the "Software"), to deal
154 | in the Software without restriction, including without limitation the rights
155 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
156 | copies of the Software, and to permit persons to whom the Software is
157 | furnished to do so, subject to the following conditions:
158 |
159 | The above copyright notice and this permission notice shall be included in
160 | all copies or substantial portions of the Software.
161 |
162 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
163 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
164 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
165 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
166 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
167 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
168 | THE SOFTWARE.
169 |
170 |
171 |
--------------------------------------------------------------------------------
/XDKAirMenu.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 4C7752E41870942900163E78 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7752E31870942900163E78 /* Foundation.framework */; };
11 | 4C7752E81870942900163E78 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7752E71870942900163E78 /* UIKit.framework */; };
12 | 4C7752EE1870942900163E78 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C7752EC1870942900163E78 /* InfoPlist.strings */; };
13 | 4C7752F01870942900163E78 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7752EF1870942900163E78 /* main.m */; };
14 | 4C7752F41870942900163E78 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7752F31870942900163E78 /* AppDelegate.m */; };
15 | 4C7752F71870942900163E78 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4C7752F51870942900163E78 /* Main_iPhone.storyboard */; };
16 | 4C7752FD1870942900163E78 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7752FC1870942900163E78 /* ViewController.m */; };
17 | 4C7752FF1870942900163E78 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C7752FE1870942900163E78 /* Images.xcassets */; };
18 | 4C7753061870942900163E78 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7753051870942900163E78 /* XCTest.framework */; };
19 | 4C7753071870942900163E78 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7752E31870942900163E78 /* Foundation.framework */; };
20 | 4C7753081870942900163E78 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7752E71870942900163E78 /* UIKit.framework */; };
21 | 4C7753101870942900163E78 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C77530E1870942900163E78 /* InfoPlist.strings */; };
22 | 4C7753121870942900163E78 /* XDKAirMenuTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7753111870942900163E78 /* XDKAirMenuTests.m */; };
23 | 4C77531E1870948D00163E78 /* XDKAirMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C77531D1870948D00163E78 /* XDKAirMenuController.m */; };
24 | 4CC02C861878BCED0020C6F2 /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC02C851878BCED0020C6F2 /* FirstViewController.m */; };
25 | 4CC02C891878BCFB0020C6F2 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC02C881878BCFB0020C6F2 /* SecondViewController.m */; };
26 | 4CC02C8C18796B440020C6F2 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4CC02C8A18796B440020C6F2 /* Main_iPad.storyboard */; };
27 | /* End PBXBuildFile section */
28 |
29 | /* Begin PBXContainerItemProxy section */
30 | 4C7753091870942900163E78 /* PBXContainerItemProxy */ = {
31 | isa = PBXContainerItemProxy;
32 | containerPortal = 4C7752D81870942900163E78 /* Project object */;
33 | proxyType = 1;
34 | remoteGlobalIDString = 4C7752DF1870942900163E78;
35 | remoteInfo = XDKAirMenu;
36 | };
37 | /* End PBXContainerItemProxy section */
38 |
39 | /* Begin PBXFileReference section */
40 | 4C7752E01870942900163E78 /* XDKAirMenu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XDKAirMenu.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 4C7752E31870942900163E78 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
42 | 4C7752E71870942900163E78 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
43 | 4C7752EB1870942900163E78 /* XDKAirMenu-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XDKAirMenu-Info.plist"; sourceTree = ""; };
44 | 4C7752ED1870942900163E78 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
45 | 4C7752EF1870942900163E78 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
46 | 4C7752F11870942900163E78 /* XDKAirMenu-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XDKAirMenu-Prefix.pch"; sourceTree = ""; };
47 | 4C7752F21870942900163E78 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
48 | 4C7752F31870942900163E78 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
49 | 4C7752F61870942900163E78 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; };
50 | 4C7752FB1870942900163E78 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
51 | 4C7752FC1870942900163E78 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
52 | 4C7752FE1870942900163E78 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
53 | 4C7753041870942900163E78 /* XDKAirMenuTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XDKAirMenuTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
54 | 4C7753051870942900163E78 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
55 | 4C77530D1870942900163E78 /* XDKAirMenuTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XDKAirMenuTests-Info.plist"; sourceTree = ""; };
56 | 4C77530F1870942900163E78 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
57 | 4C7753111870942900163E78 /* XDKAirMenuTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XDKAirMenuTests.m; sourceTree = ""; };
58 | 4C77531C1870948D00163E78 /* XDKAirMenuController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XDKAirMenuController.h; path = XDKAirMenu/XDKAirMenuController.h; sourceTree = ""; };
59 | 4C77531D1870948D00163E78 /* XDKAirMenuController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XDKAirMenuController.m; path = XDKAirMenu/XDKAirMenuController.m; sourceTree = ""; };
60 | 4CC02C841878BCED0020C6F2 /* FirstViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FirstViewController.h; sourceTree = ""; };
61 | 4CC02C851878BCED0020C6F2 /* FirstViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = ""; };
62 | 4CC02C871878BCFB0020C6F2 /* SecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; };
63 | 4CC02C881878BCFB0020C6F2 /* SecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; };
64 | 4CC02C8B18796B440020C6F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; };
65 | /* End PBXFileReference section */
66 |
67 | /* Begin PBXFrameworksBuildPhase section */
68 | 4C7752DD1870942900163E78 /* Frameworks */ = {
69 | isa = PBXFrameworksBuildPhase;
70 | buildActionMask = 2147483647;
71 | files = (
72 | 4C7752E81870942900163E78 /* UIKit.framework in Frameworks */,
73 | 4C7752E41870942900163E78 /* Foundation.framework in Frameworks */,
74 | );
75 | runOnlyForDeploymentPostprocessing = 0;
76 | };
77 | 4C7753011870942900163E78 /* Frameworks */ = {
78 | isa = PBXFrameworksBuildPhase;
79 | buildActionMask = 2147483647;
80 | files = (
81 | 4C7753061870942900163E78 /* XCTest.framework in Frameworks */,
82 | 4C7753081870942900163E78 /* UIKit.framework in Frameworks */,
83 | 4C7753071870942900163E78 /* Foundation.framework in Frameworks */,
84 | );
85 | runOnlyForDeploymentPostprocessing = 0;
86 | };
87 | /* End PBXFrameworksBuildPhase section */
88 |
89 | /* Begin PBXGroup section */
90 | 4C7752D71870942900163E78 = {
91 | isa = PBXGroup;
92 | children = (
93 | 4C7752E91870942900163E78 /* XDKAirMenu */,
94 | 4C77530B1870942900163E78 /* XDKAirMenuTests */,
95 | 4C7752E21870942900163E78 /* Frameworks */,
96 | 4C7752E11870942900163E78 /* Products */,
97 | );
98 | sourceTree = "";
99 | };
100 | 4C7752E11870942900163E78 /* Products */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 4C7752E01870942900163E78 /* XDKAirMenu.app */,
104 | 4C7753041870942900163E78 /* XDKAirMenuTests.xctest */,
105 | );
106 | name = Products;
107 | sourceTree = "";
108 | };
109 | 4C7752E21870942900163E78 /* Frameworks */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 4C7752E31870942900163E78 /* Foundation.framework */,
113 | 4C7752E71870942900163E78 /* UIKit.framework */,
114 | 4C7753051870942900163E78 /* XCTest.framework */,
115 | );
116 | name = Frameworks;
117 | sourceTree = "";
118 | };
119 | 4C7752E91870942900163E78 /* XDKAirMenu */ = {
120 | isa = PBXGroup;
121 | children = (
122 | 4C77531B1870944900163E78 /* XDKAirMenu */,
123 | 4C7752F21870942900163E78 /* AppDelegate.h */,
124 | 4C7752F31870942900163E78 /* AppDelegate.m */,
125 | 4C7752F51870942900163E78 /* Main_iPhone.storyboard */,
126 | 4CC02C8A18796B440020C6F2 /* Main_iPad.storyboard */,
127 | 4C7752FB1870942900163E78 /* ViewController.h */,
128 | 4C7752FC1870942900163E78 /* ViewController.m */,
129 | 4CC02C841878BCED0020C6F2 /* FirstViewController.h */,
130 | 4CC02C851878BCED0020C6F2 /* FirstViewController.m */,
131 | 4CC02C871878BCFB0020C6F2 /* SecondViewController.h */,
132 | 4CC02C881878BCFB0020C6F2 /* SecondViewController.m */,
133 | 4C7752FE1870942900163E78 /* Images.xcassets */,
134 | 4C7752EA1870942900163E78 /* Supporting Files */,
135 | );
136 | path = XDKAirMenu;
137 | sourceTree = "";
138 | };
139 | 4C7752EA1870942900163E78 /* Supporting Files */ = {
140 | isa = PBXGroup;
141 | children = (
142 | 4C7752EB1870942900163E78 /* XDKAirMenu-Info.plist */,
143 | 4C7752EC1870942900163E78 /* InfoPlist.strings */,
144 | 4C7752EF1870942900163E78 /* main.m */,
145 | 4C7752F11870942900163E78 /* XDKAirMenu-Prefix.pch */,
146 | );
147 | name = "Supporting Files";
148 | sourceTree = "";
149 | };
150 | 4C77530B1870942900163E78 /* XDKAirMenuTests */ = {
151 | isa = PBXGroup;
152 | children = (
153 | 4C7753111870942900163E78 /* XDKAirMenuTests.m */,
154 | 4C77530C1870942900163E78 /* Supporting Files */,
155 | );
156 | path = XDKAirMenuTests;
157 | sourceTree = "";
158 | };
159 | 4C77530C1870942900163E78 /* Supporting Files */ = {
160 | isa = PBXGroup;
161 | children = (
162 | 4C77530D1870942900163E78 /* XDKAirMenuTests-Info.plist */,
163 | 4C77530E1870942900163E78 /* InfoPlist.strings */,
164 | );
165 | name = "Supporting Files";
166 | sourceTree = "";
167 | };
168 | 4C77531B1870944900163E78 /* XDKAirMenu */ = {
169 | isa = PBXGroup;
170 | children = (
171 | 4C77531C1870948D00163E78 /* XDKAirMenuController.h */,
172 | 4C77531D1870948D00163E78 /* XDKAirMenuController.m */,
173 | );
174 | name = XDKAirMenu;
175 | sourceTree = "";
176 | };
177 | /* End PBXGroup section */
178 |
179 | /* Begin PBXNativeTarget section */
180 | 4C7752DF1870942900163E78 /* XDKAirMenu */ = {
181 | isa = PBXNativeTarget;
182 | buildConfigurationList = 4C7753151870942900163E78 /* Build configuration list for PBXNativeTarget "XDKAirMenu" */;
183 | buildPhases = (
184 | 4C7752DC1870942900163E78 /* Sources */,
185 | 4C7752DD1870942900163E78 /* Frameworks */,
186 | 4C7752DE1870942900163E78 /* Resources */,
187 | );
188 | buildRules = (
189 | );
190 | dependencies = (
191 | );
192 | name = XDKAirMenu;
193 | productName = XDKAirMenu;
194 | productReference = 4C7752E01870942900163E78 /* XDKAirMenu.app */;
195 | productType = "com.apple.product-type.application";
196 | };
197 | 4C7753031870942900163E78 /* XDKAirMenuTests */ = {
198 | isa = PBXNativeTarget;
199 | buildConfigurationList = 4C7753181870942900163E78 /* Build configuration list for PBXNativeTarget "XDKAirMenuTests" */;
200 | buildPhases = (
201 | 4C7753001870942900163E78 /* Sources */,
202 | 4C7753011870942900163E78 /* Frameworks */,
203 | 4C7753021870942900163E78 /* Resources */,
204 | );
205 | buildRules = (
206 | );
207 | dependencies = (
208 | 4C77530A1870942900163E78 /* PBXTargetDependency */,
209 | );
210 | name = XDKAirMenuTests;
211 | productName = XDKAirMenuTests;
212 | productReference = 4C7753041870942900163E78 /* XDKAirMenuTests.xctest */;
213 | productType = "com.apple.product-type.bundle.unit-test";
214 | };
215 | /* End PBXNativeTarget section */
216 |
217 | /* Begin PBXProject section */
218 | 4C7752D81870942900163E78 /* Project object */ = {
219 | isa = PBXProject;
220 | attributes = {
221 | LastUpgradeCheck = 0500;
222 | ORGANIZATIONNAME = XavierDeKoninck;
223 | TargetAttributes = {
224 | 4C7753031870942900163E78 = {
225 | TestTargetID = 4C7752DF1870942900163E78;
226 | };
227 | };
228 | };
229 | buildConfigurationList = 4C7752DB1870942900163E78 /* Build configuration list for PBXProject "XDKAirMenu" */;
230 | compatibilityVersion = "Xcode 3.2";
231 | developmentRegion = English;
232 | hasScannedForEncodings = 0;
233 | knownRegions = (
234 | en,
235 | Base,
236 | );
237 | mainGroup = 4C7752D71870942900163E78;
238 | productRefGroup = 4C7752E11870942900163E78 /* Products */;
239 | projectDirPath = "";
240 | projectRoot = "";
241 | targets = (
242 | 4C7752DF1870942900163E78 /* XDKAirMenu */,
243 | 4C7753031870942900163E78 /* XDKAirMenuTests */,
244 | );
245 | };
246 | /* End PBXProject section */
247 |
248 | /* Begin PBXResourcesBuildPhase section */
249 | 4C7752DE1870942900163E78 /* Resources */ = {
250 | isa = PBXResourcesBuildPhase;
251 | buildActionMask = 2147483647;
252 | files = (
253 | 4C7752FF1870942900163E78 /* Images.xcassets in Resources */,
254 | 4CC02C8C18796B440020C6F2 /* Main_iPad.storyboard in Resources */,
255 | 4C7752F71870942900163E78 /* Main_iPhone.storyboard in Resources */,
256 | 4C7752EE1870942900163E78 /* InfoPlist.strings in Resources */,
257 | );
258 | runOnlyForDeploymentPostprocessing = 0;
259 | };
260 | 4C7753021870942900163E78 /* Resources */ = {
261 | isa = PBXResourcesBuildPhase;
262 | buildActionMask = 2147483647;
263 | files = (
264 | 4C7753101870942900163E78 /* InfoPlist.strings in Resources */,
265 | );
266 | runOnlyForDeploymentPostprocessing = 0;
267 | };
268 | /* End PBXResourcesBuildPhase section */
269 |
270 | /* Begin PBXSourcesBuildPhase section */
271 | 4C7752DC1870942900163E78 /* Sources */ = {
272 | isa = PBXSourcesBuildPhase;
273 | buildActionMask = 2147483647;
274 | files = (
275 | 4CC02C891878BCFB0020C6F2 /* SecondViewController.m in Sources */,
276 | 4C7752FD1870942900163E78 /* ViewController.m in Sources */,
277 | 4C77531E1870948D00163E78 /* XDKAirMenuController.m in Sources */,
278 | 4CC02C861878BCED0020C6F2 /* FirstViewController.m in Sources */,
279 | 4C7752F41870942900163E78 /* AppDelegate.m in Sources */,
280 | 4C7752F01870942900163E78 /* main.m in Sources */,
281 | );
282 | runOnlyForDeploymentPostprocessing = 0;
283 | };
284 | 4C7753001870942900163E78 /* Sources */ = {
285 | isa = PBXSourcesBuildPhase;
286 | buildActionMask = 2147483647;
287 | files = (
288 | 4C7753121870942900163E78 /* XDKAirMenuTests.m in Sources */,
289 | );
290 | runOnlyForDeploymentPostprocessing = 0;
291 | };
292 | /* End PBXSourcesBuildPhase section */
293 |
294 | /* Begin PBXTargetDependency section */
295 | 4C77530A1870942900163E78 /* PBXTargetDependency */ = {
296 | isa = PBXTargetDependency;
297 | target = 4C7752DF1870942900163E78 /* XDKAirMenu */;
298 | targetProxy = 4C7753091870942900163E78 /* PBXContainerItemProxy */;
299 | };
300 | /* End PBXTargetDependency section */
301 |
302 | /* Begin PBXVariantGroup section */
303 | 4C7752EC1870942900163E78 /* InfoPlist.strings */ = {
304 | isa = PBXVariantGroup;
305 | children = (
306 | 4C7752ED1870942900163E78 /* en */,
307 | );
308 | name = InfoPlist.strings;
309 | sourceTree = "";
310 | };
311 | 4C7752F51870942900163E78 /* Main_iPhone.storyboard */ = {
312 | isa = PBXVariantGroup;
313 | children = (
314 | 4C7752F61870942900163E78 /* Base */,
315 | );
316 | name = Main_iPhone.storyboard;
317 | sourceTree = "";
318 | };
319 | 4C77530E1870942900163E78 /* InfoPlist.strings */ = {
320 | isa = PBXVariantGroup;
321 | children = (
322 | 4C77530F1870942900163E78 /* en */,
323 | );
324 | name = InfoPlist.strings;
325 | sourceTree = "";
326 | };
327 | 4CC02C8A18796B440020C6F2 /* Main_iPad.storyboard */ = {
328 | isa = PBXVariantGroup;
329 | children = (
330 | 4CC02C8B18796B440020C6F2 /* Base */,
331 | );
332 | name = Main_iPad.storyboard;
333 | sourceTree = "";
334 | };
335 | /* End PBXVariantGroup section */
336 |
337 | /* Begin XCBuildConfiguration section */
338 | 4C7753131870942900163E78 /* Debug */ = {
339 | isa = XCBuildConfiguration;
340 | buildSettings = {
341 | ALWAYS_SEARCH_USER_PATHS = NO;
342 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
343 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
344 | CLANG_CXX_LIBRARY = "libc++";
345 | CLANG_ENABLE_MODULES = YES;
346 | CLANG_ENABLE_OBJC_ARC = YES;
347 | CLANG_WARN_BOOL_CONVERSION = YES;
348 | CLANG_WARN_CONSTANT_CONVERSION = YES;
349 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
350 | CLANG_WARN_EMPTY_BODY = YES;
351 | CLANG_WARN_ENUM_CONVERSION = YES;
352 | CLANG_WARN_INT_CONVERSION = YES;
353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
354 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
355 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
356 | COPY_PHASE_STRIP = NO;
357 | GCC_C_LANGUAGE_STANDARD = gnu99;
358 | GCC_DYNAMIC_NO_PIC = NO;
359 | GCC_OPTIMIZATION_LEVEL = 0;
360 | GCC_PREPROCESSOR_DEFINITIONS = (
361 | "DEBUG=1",
362 | "$(inherited)",
363 | );
364 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
365 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
366 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
367 | GCC_WARN_UNDECLARED_SELECTOR = YES;
368 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
369 | GCC_WARN_UNUSED_FUNCTION = YES;
370 | GCC_WARN_UNUSED_VARIABLE = YES;
371 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
372 | ONLY_ACTIVE_ARCH = YES;
373 | SDKROOT = iphoneos;
374 | TARGETED_DEVICE_FAMILY = "1,2";
375 | };
376 | name = Debug;
377 | };
378 | 4C7753141870942900163E78 /* Release */ = {
379 | isa = XCBuildConfiguration;
380 | buildSettings = {
381 | ALWAYS_SEARCH_USER_PATHS = NO;
382 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
383 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
384 | CLANG_CXX_LIBRARY = "libc++";
385 | CLANG_ENABLE_MODULES = YES;
386 | CLANG_ENABLE_OBJC_ARC = YES;
387 | CLANG_WARN_BOOL_CONVERSION = YES;
388 | CLANG_WARN_CONSTANT_CONVERSION = YES;
389 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
390 | CLANG_WARN_EMPTY_BODY = YES;
391 | CLANG_WARN_ENUM_CONVERSION = YES;
392 | CLANG_WARN_INT_CONVERSION = YES;
393 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
395 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
396 | COPY_PHASE_STRIP = YES;
397 | ENABLE_NS_ASSERTIONS = NO;
398 | GCC_C_LANGUAGE_STANDARD = gnu99;
399 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
400 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
401 | GCC_WARN_UNDECLARED_SELECTOR = YES;
402 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
403 | GCC_WARN_UNUSED_FUNCTION = YES;
404 | GCC_WARN_UNUSED_VARIABLE = YES;
405 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
406 | SDKROOT = iphoneos;
407 | TARGETED_DEVICE_FAMILY = "1,2";
408 | VALIDATE_PRODUCT = YES;
409 | };
410 | name = Release;
411 | };
412 | 4C7753161870942900163E78 /* Debug */ = {
413 | isa = XCBuildConfiguration;
414 | buildSettings = {
415 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
416 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
417 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
418 | GCC_PREFIX_HEADER = "XDKAirMenu/XDKAirMenu-Prefix.pch";
419 | INFOPLIST_FILE = "XDKAirMenu/XDKAirMenu-Info.plist";
420 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
421 | PRODUCT_NAME = "$(TARGET_NAME)";
422 | TARGETED_DEVICE_FAMILY = "1,2";
423 | WRAPPER_EXTENSION = app;
424 | };
425 | name = Debug;
426 | };
427 | 4C7753171870942900163E78 /* Release */ = {
428 | isa = XCBuildConfiguration;
429 | buildSettings = {
430 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
431 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
432 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
433 | GCC_PREFIX_HEADER = "XDKAirMenu/XDKAirMenu-Prefix.pch";
434 | INFOPLIST_FILE = "XDKAirMenu/XDKAirMenu-Info.plist";
435 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
436 | PRODUCT_NAME = "$(TARGET_NAME)";
437 | TARGETED_DEVICE_FAMILY = "1,2";
438 | WRAPPER_EXTENSION = app;
439 | };
440 | name = Release;
441 | };
442 | 4C7753191870942900163E78 /* Debug */ = {
443 | isa = XCBuildConfiguration;
444 | buildSettings = {
445 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
446 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XDKAirMenu.app/XDKAirMenu";
447 | FRAMEWORK_SEARCH_PATHS = (
448 | "$(SDKROOT)/Developer/Library/Frameworks",
449 | "$(inherited)",
450 | "$(DEVELOPER_FRAMEWORKS_DIR)",
451 | );
452 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
453 | GCC_PREFIX_HEADER = "XDKAirMenu/XDKAirMenu-Prefix.pch";
454 | GCC_PREPROCESSOR_DEFINITIONS = (
455 | "DEBUG=1",
456 | "$(inherited)",
457 | );
458 | INFOPLIST_FILE = "XDKAirMenuTests/XDKAirMenuTests-Info.plist";
459 | PRODUCT_NAME = "$(TARGET_NAME)";
460 | TEST_HOST = "$(BUNDLE_LOADER)";
461 | WRAPPER_EXTENSION = xctest;
462 | };
463 | name = Debug;
464 | };
465 | 4C77531A1870942900163E78 /* Release */ = {
466 | isa = XCBuildConfiguration;
467 | buildSettings = {
468 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
469 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XDKAirMenu.app/XDKAirMenu";
470 | FRAMEWORK_SEARCH_PATHS = (
471 | "$(SDKROOT)/Developer/Library/Frameworks",
472 | "$(inherited)",
473 | "$(DEVELOPER_FRAMEWORKS_DIR)",
474 | );
475 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
476 | GCC_PREFIX_HEADER = "XDKAirMenu/XDKAirMenu-Prefix.pch";
477 | INFOPLIST_FILE = "XDKAirMenuTests/XDKAirMenuTests-Info.plist";
478 | PRODUCT_NAME = "$(TARGET_NAME)";
479 | TEST_HOST = "$(BUNDLE_LOADER)";
480 | WRAPPER_EXTENSION = xctest;
481 | };
482 | name = Release;
483 | };
484 | /* End XCBuildConfiguration section */
485 |
486 | /* Begin XCConfigurationList section */
487 | 4C7752DB1870942900163E78 /* Build configuration list for PBXProject "XDKAirMenu" */ = {
488 | isa = XCConfigurationList;
489 | buildConfigurations = (
490 | 4C7753131870942900163E78 /* Debug */,
491 | 4C7753141870942900163E78 /* Release */,
492 | );
493 | defaultConfigurationIsVisible = 0;
494 | defaultConfigurationName = Release;
495 | };
496 | 4C7753151870942900163E78 /* Build configuration list for PBXNativeTarget "XDKAirMenu" */ = {
497 | isa = XCConfigurationList;
498 | buildConfigurations = (
499 | 4C7753161870942900163E78 /* Debug */,
500 | 4C7753171870942900163E78 /* Release */,
501 | );
502 | defaultConfigurationIsVisible = 0;
503 | defaultConfigurationName = Release;
504 | };
505 | 4C7753181870942900163E78 /* Build configuration list for PBXNativeTarget "XDKAirMenuTests" */ = {
506 | isa = XCConfigurationList;
507 | buildConfigurations = (
508 | 4C7753191870942900163E78 /* Debug */,
509 | 4C77531A1870942900163E78 /* Release */,
510 | );
511 | defaultConfigurationIsVisible = 0;
512 | defaultConfigurationName = Release;
513 | };
514 | /* End XCConfigurationList section */
515 | };
516 | rootObject = 4C7752D81870942900163E78 /* Project object */;
517 | }
518 |
--------------------------------------------------------------------------------
/XDKAirMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/XDKAirMenu.xcodeproj/xcuserdata/Wizarx.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/XDKAirMenu.xcodeproj/xcuserdata/Wizarx.xcuserdatad/xcschemes/XDKAirMenu.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
86 |
87 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/XDKAirMenu.xcodeproj/xcuserdata/Wizarx.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | XDKAirMenu.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 4C7752DF1870942900163E78
16 |
17 | primary
18 |
19 |
20 | 4C7753031870942900163E78
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/XDKAirMenu/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 29/12/2013.
6 | // Copyright (c) 2013 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/XDKAirMenu/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 29/12/2013.
6 | // Copyright (c) 2013 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @implementation AppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | // Override point for customization after application launch.
16 | return YES;
17 | }
18 |
19 | - (void)applicationWillResignActive:(UIApplication *)application
20 | {
21 | // 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.
22 | // 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.
23 | }
24 |
25 | - (void)applicationDidEnterBackground:(UIApplication *)application
26 | {
27 | // 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.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | - (void)applicationWillEnterForeground:(UIApplication *)application
32 | {
33 | // 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.
34 | }
35 |
36 | - (void)applicationDidBecomeActive:(UIApplication *)application
37 | {
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 | {
43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/XDKAirMenu/Base.lproj/Main_iPad.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 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
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 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
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 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
--------------------------------------------------------------------------------
/XDKAirMenu/Base.lproj/Main_iPhone.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 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
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 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
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 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
--------------------------------------------------------------------------------
/XDKAirMenu/FirstViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FirstViewController.h
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 04/01/2014.
6 | // Copyright (c) 2014 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FirstViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/XDKAirMenu/FirstViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // FirstViewController.m
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 04/01/2014.
6 | // Copyright (c) 2014 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import "FirstViewController.h"
10 | #import "XDKAirMenuController.h"
11 |
12 | @interface FirstViewController ()
13 |
14 | @end
15 |
16 | @implementation FirstViewController
17 |
18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
19 | {
20 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
21 | if (self) {
22 | }
23 | return self;
24 | }
25 |
26 | - (void)viewDidLoad
27 | {
28 | [super viewDidLoad];
29 | }
30 |
31 | - (void)didReceiveMemoryWarning
32 | {
33 | [super didReceiveMemoryWarning];
34 | }
35 |
36 | - (IBAction)menuButtonPressed:(id)sender
37 | {
38 | XDKAirMenuController *menu = [XDKAirMenuController sharedMenu];
39 |
40 | if (menu.isMenuOpened)
41 | [menu closeMenuAnimated];
42 | else
43 | [menu openMenuAnimated];
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/XDKAirMenu/Images.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" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "ipad",
20 | "size" : "29x29",
21 | "scale" : "1x"
22 | },
23 | {
24 | "idiom" : "ipad",
25 | "size" : "29x29",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "ipad",
30 | "size" : "40x40",
31 | "scale" : "1x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "40x40",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "76x76",
41 | "scale" : "1x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "76x76",
46 | "scale" : "2x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/XDKAirMenu/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | },
18 | {
19 | "orientation" : "portrait",
20 | "idiom" : "ipad",
21 | "extent" : "full-screen",
22 | "minimum-system-version" : "7.0",
23 | "scale" : "1x"
24 | },
25 | {
26 | "orientation" : "landscape",
27 | "idiom" : "ipad",
28 | "extent" : "full-screen",
29 | "minimum-system-version" : "7.0",
30 | "scale" : "1x"
31 | },
32 | {
33 | "orientation" : "portrait",
34 | "idiom" : "ipad",
35 | "extent" : "full-screen",
36 | "minimum-system-version" : "7.0",
37 | "scale" : "2x"
38 | },
39 | {
40 | "orientation" : "landscape",
41 | "idiom" : "ipad",
42 | "extent" : "full-screen",
43 | "minimum-system-version" : "7.0",
44 | "scale" : "2x"
45 | }
46 | ],
47 | "info" : {
48 | "version" : 1,
49 | "author" : "xcode"
50 | }
51 | }
--------------------------------------------------------------------------------
/XDKAirMenu/SecondViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // SecondViewController.h
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 04/01/2014.
6 | // Copyright (c) 2014 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface SecondViewController : UITableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/XDKAirMenu/SecondViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // SecondViewController.m
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 04/01/2014.
6 | // Copyright (c) 2014 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import "SecondViewController.h"
10 | #import "XDKAirMenuController.h"
11 |
12 | @interface SecondViewController ()
13 |
14 | @end
15 |
16 | @implementation SecondViewController
17 |
18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
19 | {
20 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
21 | if (self) {
22 | // Custom initialization
23 | }
24 | return self;
25 | }
26 |
27 | - (void)viewDidLoad
28 | {
29 | [super viewDidLoad];
30 | // Do any additional setup after loading the view.
31 | }
32 |
33 | - (void)didReceiveMemoryWarning
34 | {
35 | [super didReceiveMemoryWarning];
36 | // Dispose of any resources that can be recreated.
37 | }
38 |
39 | - (IBAction)menuButtonPressed:(id)sender
40 | {
41 | XDKAirMenuController *menu = [XDKAirMenuController sharedMenu];
42 |
43 | if (menu.isMenuOpened)
44 | [menu closeMenuAnimated];
45 | else
46 | [menu openMenuAnimated];
47 | }
48 |
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/XDKAirMenu/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 29/12/2013.
6 | // Copyright (c) 2013 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "XDKAirMenuController.h"
11 |
12 | @interface ViewController : UIViewController
13 |
14 | @property (nonatomic, strong) XDKAirMenuController *airMenuController;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/XDKAirMenu/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 29/12/2013.
6 | // Copyright (c) 2013 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @property (nonatomic, strong) UITableView *tableView;
14 |
15 | @end
16 |
17 |
18 | @implementation ViewController
19 |
20 | - (void)awakeFromNib
21 | {
22 | [super awakeFromNib];
23 | }
24 |
25 | - (void)viewDidLoad
26 | {
27 | [super viewDidLoad];
28 |
29 | self.airMenuController = [XDKAirMenuController sharedMenu];
30 | self.airMenuController.airDelegate = self;
31 | //self.airMenuController.isMenuOnRight = TRUE;
32 |
33 | [self.view addSubview:self.airMenuController.view];
34 | [self addChildViewController:self.airMenuController];
35 | }
36 |
37 | - (void)didReceiveMemoryWarning
38 | {
39 | [super didReceiveMemoryWarning];
40 | }
41 |
42 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
43 | {
44 | if ([segue.identifier isEqualToString:@"TableViewSegue"])
45 | {
46 | self.tableView = ((UITableViewController*)segue.destinationViewController).tableView;
47 | }
48 | }
49 |
50 |
51 | #pragma mark - XDKAirMenuDelegate
52 |
53 | - (UIViewController*)airMenu:(XDKAirMenuController*)airMenu viewControllerAtIndexPath:(NSIndexPath*)indexPath
54 | {
55 | UIStoryboard *storyboard = self.storyboard;
56 | UIViewController *vc = nil;
57 |
58 | vc.view.autoresizesSubviews = TRUE;
59 | vc.view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
60 |
61 | if (indexPath.row == 0)
62 | vc = [storyboard instantiateViewControllerWithIdentifier:@"ViewController1"];
63 | else if (indexPath.row == 1)
64 | vc = [storyboard instantiateViewControllerWithIdentifier:@"ViewController2"];
65 |
66 | return vc;
67 | }
68 |
69 | - (UITableView*)tableViewForAirMenu:(XDKAirMenuController*)airMenu
70 | {
71 | return self.tableView;
72 | }
73 |
74 | @end
75 |
--------------------------------------------------------------------------------
/XDKAirMenu/XDKAirMenu-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | com.XavierDeKoninck.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 7.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.1
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.1
25 | LSRequiresIPhoneOS
26 |
27 | UIMainStoryboardFile
28 | Main_iPhone
29 | UIMainStoryboardFile~ipad
30 | Main_iPad
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UIStatusBarHidden
36 |
37 | UISupportedInterfaceOrientations
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationLandscapeLeft
41 | UIInterfaceOrientationLandscapeRight
42 |
43 | UISupportedInterfaceOrientations~ipad
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationPortraitUpsideDown
47 | UIInterfaceOrientationLandscapeLeft
48 | UIInterfaceOrientationLandscapeRight
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/XDKAirMenu/XDKAirMenu-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/XDKAirMenu/XDKAirMenu/XDKAirMenuController.h:
--------------------------------------------------------------------------------
1 | //
2 | // XDKAirMenuController.h
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 29/12/2013.
6 | // Copyright (c) 2013 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class XDKAirMenuController;
12 |
13 |
14 | @protocol XDKAirMenuDelegate
15 |
16 | @required
17 |
18 | /**
19 | * Method of protocol returning the tableView used by the menu
20 | *
21 | * @param airMenu The menu caller
22 | *
23 | * @return The tableView used by the menu
24 | */
25 | - (UITableView*)tableViewForAirMenu:(XDKAirMenuController*)airMenu;
26 |
27 | /**
28 | * Method of protocol returning the viewController used by the menu at the indexPath
29 | *
30 | * @param airMenu The menu caller
31 | *
32 | * @param indexPath The indexPath
33 | *
34 | * @return The viewController used by the menu at the indexPath
35 | */
36 | - (UIViewController*)airMenu:(XDKAirMenuController*)airMenu viewControllerAtIndexPath:(NSIndexPath*)indexPath;
37 |
38 |
39 | @optional
40 |
41 | /**
42 | * Method of protocol returning the width of visible part (Default : 35.f)
43 | *
44 | * @param airMenu The menu caller
45 | *
46 | * @return The width of visible part for controller when menu opened
47 | */
48 | - (CGFloat)widthControllerForAirMenu:(XDKAirMenuController*)airMenu;
49 |
50 | /**
51 | * Method of protocol returning the minimum of scale for the controller (Default : 0.5f)
52 | *
53 | * @param airMenu The menu caller
54 | *
55 | * @return The minimum of scale for the controller
56 | */
57 | - (CGFloat)minScaleControllerForAirMenu:(XDKAirMenuController*)airMenu;
58 |
59 | /**
60 | * Method of protocol returning the minimum of scale for the tableView (Default : 0.8f)
61 | *
62 | * @param airMenu The menu caller
63 | *
64 | * @return The minimum of scale for the tableView
65 | */
66 | - (CGFloat)minScaleTableViewForAirMenu:(XDKAirMenuController*)airMenu;
67 |
68 | /**
69 | * Method of protocol returning the minimum of alpha for the tableView (Default : 0.01f)
70 | *
71 | * @param airMenu The menu caller
72 | *
73 | * @return The minimum of alpha for the tableView
74 | */
75 | - (CGFloat)minAlphaTableViewForAirMenu:(XDKAirMenuController*)airMenu;
76 |
77 | @end
78 |
79 |
80 |
81 | /**
82 | *
83 | * Controller which is in charge of managing a XDKAirMenu
84 | *
85 | */
86 | @interface XDKAirMenuController : UIViewController
87 |
88 |
89 | /**
90 | * The actual viewController opened by the menu
91 | */
92 | @property (nonatomic, strong, readonly) UIViewController *currentViewController;
93 |
94 | /**
95 | * The delegate of the XDKAirMenuController
96 | */
97 | @property (nonatomic, weak) id airDelegate;
98 |
99 | /**
100 | * A boolean indicating if the menu is opened or not
101 | */
102 | @property (nonatomic, assign, readonly) BOOL isMenuOpened;
103 |
104 | /**
105 | * A boolean indicating if the menu should be on right or not
106 | */
107 | @property (nonatomic, assign) BOOL isMenuOnRight;
108 |
109 |
110 | /**
111 | * Method returning the singleton instance of the XDKAirMenuController
112 | *
113 | * @return An instance of XDKAirMenuController
114 | */
115 | + (instancetype)sharedMenu;
116 |
117 | /**
118 | * Method to open menu with animation
119 | */
120 | - (void)openMenuAnimated;
121 |
122 | /**
123 | * Method to close menu with animation
124 | */
125 | - (void)closeMenuAnimated;
126 |
127 |
128 | @end
129 |
--------------------------------------------------------------------------------
/XDKAirMenu/XDKAirMenu/XDKAirMenuController.m:
--------------------------------------------------------------------------------
1 | //
2 | // XDKAirMenuController.m
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 29/12/2013.
6 | // Copyright (c) 2013 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import "XDKAirMenuController.h"
10 |
11 | #define WIDTH_OPENED (35.f)
12 | #define MIN_SCALE_CONTROLLER (0.5f)
13 | #define MIN_SCALE_TABLEVIEW (0.8f)
14 | #define MIN_ALPHA_TABLEVIEW (0.01f)
15 | #define DELTA_OPENING (65.f)
16 |
17 |
18 | @interface XDKAirMenuController ()
19 |
20 | @property (nonatomic, assign) CGPoint startLocation;
21 | @property (nonatomic, assign) CGPoint lastLocation;
22 | @property (nonatomic, weak) UITableView *tableView;
23 |
24 | @property (nonatomic, assign) CGFloat widthOpened;
25 | @property (nonatomic, assign) CGFloat minScaleController;
26 | @property (nonatomic, assign) CGFloat minScaleTableView;
27 | @property (nonatomic, assign) CGFloat minAlphaTableView;
28 |
29 | @end
30 |
31 |
32 | @implementation XDKAirMenuController
33 |
34 | + (instancetype)sharedMenu
35 | {
36 | static XDKAirMenuController *controller = nil;
37 |
38 | static dispatch_once_t onceToken;
39 | dispatch_once(&onceToken, ^{
40 | controller = [[XDKAirMenuController alloc] init];
41 | });
42 |
43 | return controller;
44 | }
45 |
46 | - (void)viewDidLoad
47 | {
48 | [super viewDidLoad];
49 |
50 | if ([self.airDelegate respondsToSelector:@selector(tableViewForAirMenu:)])
51 | {
52 | self.tableView = [self.airDelegate tableViewForAirMenu:self];
53 | self.tableView.delegate = self;
54 | }
55 |
56 | self.widthOpened = WIDTH_OPENED;
57 | self.minAlphaTableView = MIN_ALPHA_TABLEVIEW;
58 | self.minScaleTableView = MIN_SCALE_TABLEVIEW;
59 | self.minScaleController = MIN_SCALE_CONTROLLER;
60 |
61 | if ([self.airDelegate respondsToSelector:@selector(widthControllerForAirMenu:)])
62 | self.widthOpened = [self.airDelegate widthControllerForAirMenu:self];
63 |
64 | if ([self.airDelegate respondsToSelector:@selector(minAlphaTableViewForAirMenu:)])
65 | self.minAlphaTableView = [self.airDelegate minAlphaTableViewForAirMenu:self];
66 |
67 | if ([self.airDelegate respondsToSelector:@selector(minScaleTableViewForAirMenu:)])
68 | self.minScaleTableView = [self.airDelegate minScaleTableViewForAirMenu:self];
69 |
70 | if ([self.airDelegate respondsToSelector:@selector(minScaleControllerForAirMenu:)])
71 | self.minScaleController = [self.airDelegate minScaleControllerForAirMenu:self];
72 |
73 |
74 | _isMenuOpened = FALSE;
75 | [self openViewControllerAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]];
76 | }
77 |
78 | - (void)viewDidAppear:(BOOL)animated
79 | {
80 | [super viewDidAppear:animated];
81 |
82 | UIWindow *frontWindow = [[UIApplication sharedApplication] keyWindow];
83 |
84 | UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGesture:)];
85 | panGesture.delegate = self;
86 | [frontWindow addGestureRecognizer:panGesture];
87 | }
88 |
89 | - (void)didReceiveMemoryWarning
90 | {
91 | [super didReceiveMemoryWarning];
92 | }
93 |
94 | - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
95 | {
96 | [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
97 |
98 | if (self.isMenuOpened)
99 | [self closeMenuAnimated];
100 | }
101 |
102 |
103 | #pragma mark - Gestures
104 |
105 | - (void)panGesture:(UIPanGestureRecognizer *)sender {
106 |
107 | if (sender.state == UIGestureRecognizerStateBegan)
108 | self.startLocation = [sender locationInView:self.view];
109 | else if (sender.state == UIGestureRecognizerStateEnded
110 | && (self.isMenuOpened
111 | || ((self.startLocation.x < DELTA_OPENING && !self.isMenuOnRight)
112 | || (self.startLocation.x > self.currentViewController.view.frame.size.width -DELTA_OPENING && self.isMenuOnRight))))
113 | {
114 | CGFloat dx = self.lastLocation.x - self.startLocation.x;
115 |
116 | if (self.isMenuOnRight)
117 | {
118 | if ((self.isMenuOpened && dx > 0.f) || self.view.frame.origin.x > 3*self.view.frame.size.width / 4)
119 | [self closeMenuAnimated];
120 | else
121 | [self openMenuAnimated];
122 | }
123 | else
124 | {
125 | if ((self.isMenuOpened && dx < 0.f) || self.view.frame.origin.x < self.view.frame.size.width / 4)
126 | [self closeMenuAnimated];
127 | else
128 | [self openMenuAnimated];
129 | }
130 |
131 | }
132 | else if (sender.state == UIGestureRecognizerStateChanged
133 | && (self.isMenuOpened
134 | || ((self.startLocation.x < DELTA_OPENING && !self.isMenuOnRight)
135 | || (self.startLocation.x > self.currentViewController.view.frame.size.width -DELTA_OPENING && self.isMenuOnRight))))
136 | [self menuDragging:sender];
137 |
138 | }
139 |
140 | - (void)menuDragging:(UIPanGestureRecognizer *)sender
141 | {
142 | CGPoint stopLocation = [sender locationInView:self.view];
143 | self.lastLocation = stopLocation;
144 |
145 | CGFloat dx = stopLocation.x - self.startLocation.x;
146 |
147 | CGFloat distance = dx;
148 |
149 | CGFloat width = (self.isMenuOnRight) ? (-self.view.frame.size.width + self.widthOpened) : (self.view.frame.size.width - self.widthOpened);
150 |
151 |
152 | CGFloat scaleController = 1 - ((self.view.frame.origin.x / width) * (1-self.minScaleController));
153 |
154 | CGFloat scaleTableView = 1 - ((1 - self.minScaleTableView) + ((self.view.frame.origin.x / width) * (-1+self.minScaleTableView)));
155 |
156 | CGFloat alphaTableView = 1 - ((1 - self.minAlphaTableView) + ((self.view.frame.origin.x / width) * (-1+self.minAlphaTableView)));
157 |
158 |
159 | if (scaleTableView < self.minScaleTableView)
160 | scaleTableView = self.minScaleTableView;
161 |
162 | if (scaleController > 1.f)
163 | scaleController = 1.f;
164 |
165 | self.tableView.transform = CGAffineTransformMakeScale(scaleTableView, scaleTableView);
166 |
167 | self.tableView.alpha = alphaTableView;
168 |
169 | self.currentViewController.view.transform = CGAffineTransformMakeScale(scaleController, scaleController);
170 |
171 | CGRect frame = self.view.frame;
172 | frame.origin.x = frame.origin.x + distance;
173 |
174 | if (self.isMenuOnRight)
175 | {
176 | if (frame.origin.x < -frame.size.width)
177 | frame.origin.x = -frame.size.width;
178 | if (frame.origin.x > 0.f)
179 | frame.origin.x = 0.f;
180 | }
181 | else
182 | {
183 | if (frame.origin.x < 0.f)
184 | frame.origin.x = 0.f;
185 | if (frame.origin.x > (frame.size.width))
186 | frame.origin.x = (frame.size.width);
187 | }
188 |
189 | self.view.frame = frame;
190 |
191 | frame = self.currentViewController.view.frame;
192 | if (self.isMenuOnRight)
193 | frame.origin.x = self.view.frame.size.width - frame.size.width;
194 | else
195 | frame.origin.x = 0.f;
196 | self.currentViewController.view.frame = frame;
197 | }
198 |
199 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
200 | {
201 | if (self.isMenuOpened)
202 | return TRUE;
203 | return FALSE;
204 | }
205 |
206 |
207 | #pragma mark - Menu
208 |
209 | - (void)openViewControllerAtIndexPath:(NSIndexPath*)indexPath
210 | {
211 | if ([self.airDelegate respondsToSelector:@selector(airMenu:viewControllerAtIndexPath:)])
212 | {
213 | BOOL firstTime = FALSE;
214 | if (self.currentViewController == nil)
215 | firstTime = TRUE;
216 |
217 | _currentViewController = [self.airDelegate airMenu:self viewControllerAtIndexPath:indexPath];
218 |
219 | UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeMenuAnimated)];
220 | tapGesture.delegate = self;
221 | [self.currentViewController.view addGestureRecognizer:tapGesture];
222 |
223 | CGRect frame = self.view.frame;
224 | frame.origin.x = 0.f;
225 | frame.origin.y = 0.f;
226 | self.currentViewController.view.frame = frame;
227 |
228 | frame = self.view.frame;
229 | frame.origin.x = 0.f;
230 | frame.origin.y = 0.f;
231 | self.view.frame = frame;
232 |
233 | self.currentViewController.view.autoresizesSubviews = TRUE;
234 | self.currentViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
235 |
236 | [self.view addSubview:self.currentViewController.view];
237 | [self addChildViewController:self.currentViewController];
238 |
239 | UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGesture:)];
240 | [self.view addGestureRecognizer:panGesture];
241 |
242 | if (!firstTime)
243 | [self openingAnimation];
244 | }
245 | }
246 |
247 | - (void)openingAnimation
248 | {
249 | self.currentViewController.view.transform = CGAffineTransformMakeScale(self.minScaleController, self.minScaleController);
250 |
251 | CGRect frame = self.view.frame;
252 | if (self.isMenuOnRight)
253 | frame.origin.x = -frame.size.width + self.widthOpened;
254 | else
255 | frame.origin.x = frame.size.width - self.widthOpened;
256 | self.view.frame = frame;
257 |
258 | self.tableView.alpha = 1.f;
259 |
260 | self.tableView.transform = CGAffineTransformMakeScale(1.f, 1.f);
261 |
262 | frame = self.currentViewController.view.frame;
263 | if (self.isMenuOnRight)
264 | frame.origin.x = self.view.frame.size.width - frame.size.width;
265 | else
266 | frame.origin.x = 0.f;
267 |
268 | self.currentViewController.view.frame = frame;
269 |
270 | [self closeMenuAnimated];
271 |
272 | }
273 |
274 |
275 | #pragma mark - Actions
276 |
277 | - (void)openMenuAnimated
278 | {
279 | [UIView animateWithDuration:0.3f animations:^{
280 |
281 | self.currentViewController.view.transform = CGAffineTransformMakeScale(self.minScaleController, self.minScaleController);
282 |
283 | CGRect frame = self.view.frame;
284 |
285 | if (self.isMenuOnRight)
286 | frame.origin.x = -frame.size.width + self.widthOpened;
287 | else
288 | frame.origin.x = frame.size.width - self.widthOpened;
289 |
290 | self.view.frame = frame;
291 |
292 | self.tableView.alpha = 1.f;
293 |
294 | self.tableView.transform = CGAffineTransformMakeScale(1.f, 1.f);
295 |
296 | frame = self.currentViewController.view.frame;
297 | if (self.isMenuOnRight)
298 | frame.origin.x = self.view.frame.size.width - frame.size.width;
299 | else
300 | frame.origin.x = 0.f;
301 | self.currentViewController.view.frame = frame;
302 | }];
303 |
304 | _isMenuOpened = TRUE;
305 | }
306 |
307 | - (void)closeMenuAnimated
308 | {
309 | [UIView animateWithDuration:0.3f animations:^{
310 |
311 | self.currentViewController.view.transform = CGAffineTransformMakeScale(1.f, 1.f);
312 |
313 | CGRect frame = self.view.frame;
314 | frame.origin.x = 0.f;
315 | self.view.frame = frame;
316 |
317 | self.tableView.alpha = self.minAlphaTableView;
318 |
319 | self.tableView.transform = CGAffineTransformMakeScale(self.minScaleTableView, self.minScaleTableView);
320 |
321 | frame = self.currentViewController.view.frame;
322 | frame.origin.x = 0.f;
323 | self.currentViewController.view.frame = frame;
324 | }];
325 |
326 | _isMenuOpened = FALSE;
327 | }
328 |
329 |
330 | #pragma mark - TableView Delegate
331 |
332 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
333 | {
334 | [self.currentViewController.view removeFromSuperview];
335 | [self.currentViewController removeFromParentViewController];
336 | [self openViewControllerAtIndexPath:indexPath];
337 | }
338 |
339 |
340 | #pragma mark - Setters
341 |
342 | - (void)setIsMenuOnRight:(BOOL)isMenuOnRight
343 | {
344 | if (self.view.superview == nil)
345 | _isMenuOnRight = isMenuOnRight;
346 | }
347 |
348 | @end
349 |
--------------------------------------------------------------------------------
/XDKAirMenu/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/XDKAirMenu/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // XDKAirMenu
4 | //
5 | // Created by Xavier De Koninck on 29/12/2013.
6 | // Copyright (c) 2013 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "AppDelegate.h"
12 |
13 | int main(int argc, char * argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/XDKAirMenuTests/XDKAirMenuTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.XavierDeKoninck.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/XDKAirMenuTests/XDKAirMenuTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // XDKAirMenuTests.m
3 | // XDKAirMenuTests
4 | //
5 | // Created by Xavier De Koninck on 29/12/2013.
6 | // Copyright (c) 2013 XavierDeKoninck. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface XDKAirMenuTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation XDKAirMenuTests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/XDKAirMenuTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/img.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XavierDK/XDKAirMenu/436da2eb726ad15621a64fbe1896bc3d828fa8f6/img.gif
--------------------------------------------------------------------------------