XDKAirMenu提供类似于FIFA应用的游戏菜单功能,具有缩放和alpha效果。
与iPhone/iPad兼容,支持纵向和横向模式,并且高度可定制。
下载XDKAirMenu并尝试内置的iPhone示例应用。
查看文档,详细了解XDKAirMenu的所有功能。
使用Git克隆源代码。
将XDKAirMenu/XDKAirMenu文件夹添加到您的项目(或工作区)中。
导入主头文件
#import <XDKAirMenu/XDKAirMenuController.h>
获取XDKAirMenuController实例,设置代理并在视图/控制器层次结构中添加。
例如
- (void)viewDidLoad
{
[super viewDidLoad];
XDKAirMenuController *menuCtr = [XDKAirMenuController sharedMenu];
menuCtr.airDelegate = self;
[self.view addSubview:menuCtr.view];
[self addChildViewController:menuCtr];
}
之后,只需实现所需的委托方法
/**
* Method of protocol returning the tableView used by the menu
* @param airMenu The menu caller
* @return The tableView used by the menu
*/
- (UITableView*)tableViewForAirMenu:(XDKAirMenuController*)airMenu;
/**
* Method of protocol returning the viewController used by the menu at the indexPath
* @param airMenu The menu caller
* @param indexPath The indexPath
* @return The viewController used by the menu at the indexPath
*/
- (UIViewController*)airMenu:(XDKAirMenuController*)airMenu viewControllerAtIndexPath:(NSIndexPath*)indexPath;
这就完成了!
您也可以调用开启和关闭动作
- (IBAction)menuButtonPressed:(id)sender
{
XDKAirMenuController *menu = [XDKAirMenuController sharedMenu];
if (menu.isMenuOpened)
[menu closeMenuAnimated];
else
[menu openMenuAnimated];
}
您也可以使用这些可选的委托方法自定义
/**
* Method of protocol returning the width of visible part (Default : 35.f)
*
* @param airMenu The menu caller
*
* @return The width of visible part for controller when menu opened
*/
- (CGFloat)widthControllerForAirMenu:(XDKAirMenuController*)airMenu;
/**
* Method of protocol returning the minimum of scale for the controller (Default : 0.5f)
*
* @param airMenu The menu caller
*
* @return The minimum of scale for the controller
*/
- (CGFloat)minScaleControllerForAirMenu:(XDKAirMenuController*)airMenu;
/**
* Method of protocol returning the minimum of scale for the tableView (Default : 0.8f)
*
* @param airMenu The menu caller
*
* @return The minimum of scale for the tableView
*/
- (CGFloat)minScaleTableViewForAirMenu:(XDKAirMenuController*)airMenu;
/**
* Method of protocol returning the minimum of alpha for the tableView (Default : 0.01f)
*
* @param airMenu The menu caller
*
* @return The minimum of alpha for the tableView
*/
- (CGFloat)minAlphaTableViewForAirMenu:(XDKAirMenuController*)airMenu;
XDKAirMenu附带完整的API文档,它已准备好Xcode文档集。使用appledoc生成并安装文档集到Xcode中 - http://gentlebytes.com/appledoc/
要从命令行使用appledoc生成文档集,请切换到源目录的根目录并输入
./gen-apple-doc-set
XDKAirMenu兼容iOS 6及以上版本。XDKAirMenu使用自动引用计数(ARC)。
提供的示例应用需要iOS 6。
XDKAirMenu使用自动引用计数(ARC)。
XDKAirMenu作为开源软件提供,不提供任何担保和保修,也不提供支持。但是,我们会尽最大努力解决GitHub上提出的问题。
如果您需要帮助集成XDKAirMenu或将它修改为满足您的需求,请联系作者Xavier De Koninck以获取咨询机会 [email protected]。
XDKAirMenu 版权所有(C)2013 Xavier De Koninck,遵循 MIT 许可证开源。
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.