iOS-Slide-Menu
---------
iOS Slide Menu built on top of UINavigationController, with configurable buttons, reveal animations, and tap/swiper gesture recognizers.
- [Setup](https://github.com/aryaxt/iOS-Slide-Menu#setup)
- [Enable/Disable Left/Right Menu](https://github.com/aryaxt/iOS-Slide-Menu#configuring-left-and-right-menu-for-different-viewcontrollers)
- [Public Properties](https://github.com/aryaxt/iOS-Slide-Menu#public-properties)
- [Public Methods](https://github.com/aryaxt/iOS-Slide-Menu#public-methods)
- [Custom Animations](https://github.com/aryaxt/iOS-Slide-Menu#custom-animations)
- [Notifications](https://github.com/aryaxt/iOS-Slide-Menu#notifications)
![alt tag](https://raw.github.com/aryaxt/iOS-Slide-Menu/master/slideMenuAnimation.gif)
Version 1.4.0 Notes
---------
```switchToViewController:withCompletion:``` method has been deprecated. In order to get the exact same behavior use ```popToRootAndSwitchToViewController:withCompletion```
New features:
- Allows limiting pan gesture to the sides of the view
- Allows turning shadow on/off
- Allows turning slide-out animation on/off when switching between viewControllers
- Minor bug fixes
Version 1.3.0 Notes
---------
If you are updating from previous versions you'll get compile errors, due to changes to RevealAnimations.
Animation configuration is now handled differently, and is separated from the SlideNavigationController.
Please see bwlow for more information.
Setup
---------
```
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
LeftMenuViewController *leftMenu = [[LeftMenuViewController alloc] init];
RightMenuViewController *righMenu = [[RightMenuViewController alloc] init];
[SlideNavigationController sharedInstance].righMenu = rightMenu;
[SlideNavigationController sharedInstance].leftMenu = leftMenu;
// Override point for customization after application launch.
return YES;
}
```
Configuring Left and Right menu for different Viewcontrollers
---------
You decide whether to enable or disable slide functionality on **each viewController** by implementing the following delegate methods of SlideNavigationControllerDelegate. These methods are optional, and if not implemented the menu functionality will be disabled for that particulat viewController.
```
@interface MyViewController : UIViewController <SlideNavigationControllerDelegate>
@end
```
```
@implementation MyViewController
- (BOOL)slideNavigationControllerShouldDisplayLeftMenu
{
return YES;
}
- (BOOL)slideNavigationControllerShouldDisplayRightMenu
{
return YES;
}
@end
```
Public properties
---------
###### avoidSwitchingToSameClassViewController
Default value is set to YES.
If set to YES when switching to a new ViewController if the new viewcontroller is the same type as the current viewcontroller it'll close the menu instead of switching to the viewController.
If set to NO it'll switch to the viewController regardless of types
This can be usefull when you have a menu item, and when the user selects an already selected menu item you don't want to navigate to a new instance of the viewController
###### enableSwipeGesture
When set to YES user can swipe to open the menu
When set to NO swipe is disabled, and use can only open the menu using the UIBarButtonItem added to the navigationBar
######panGestureSideOffset
This property allows you to limit the gesture to the sides of the view. For instance setting this value to 50 means touches are limited to 50 pixels to the right and 50 pixels to the left of the view. This could be useful if you are expecting slide-to-delete functionality on UITableViews.
Default value of panGestureSideOffset is set to 0. Setting panGestureSideOffset to 0 means touches are detected in the whole view if enableSwipeGesture is set to true.
###### enableShadow
A boolean that allows you to turn shadow on/off. On default shadow is set to true
###### rightMenu
The viewController of the right menu in the navigationController
###### leftMenu
The viewController of the left menu in the navigationController
###### leftBarButtonItem
Default value is null. When this button is set navigationController uses this UIBarButtonItem as the leftItem. this property is intended to be used when a custom UIBarButton is needed (UIBarButtonItem initialized with a custom view)
###### rightBarButtonItem
Behaves exactly the same as leftbarButtonItem, but it's used as the right button for the menu
###### portraitSlideOffset
Default value of portraitSlideOffset is 60. This means when the menu is open, the width of the visible portion of the navigation controller is 60 pixels in portrait mode
###### landscapeSlideOffset
Default value of portraitSlideOffset is 60. This means when the menu is open, the width of the visible portion of the navigation controller is 60 pixels in landscape mode
###### menuRevealAnimator
menuRevealAnimator is used to animate the left/right menu during reveal. The default value is nil, that means no animations occure when opening/closing the menu.
There are existing animation classes that can be used. These animation classes can be configured through init method options.
- SlideNavigationContorllerAnimatorSlide
- SlideNavigationContorllerAnimatorFade
- SlideNavigationContorllerAnimatorScale
- SlideNavigationContorllerAnimatorScaleAndFade
- SlideNavigationContorllerAnimatorSlideAndFade
```
SlideNavigationContorllerAnimatorSlideAndFade *alideAndFadeAnimator = [[SlideNavigationContorllerAnimatorSlideAndFade alloc] initWithMaximumFadeAlpha:.8 fadeColor:[UIColor redColor] andSlideMovement:100];
[SlideNavigationController sharedInstance].menuRevealAnimator = alideAndFadeAnimator;
```
Public Methods
---------
###### + (SlideNavigationController *)sharedInstance;
Returns the singleton instance of SlideNavigationController
###### - (void)switchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion;
This method is deprecated
###### - (void)popToRootAndSwitchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion;
Pops to root view controller and calls the completion.
###### - (void)popToRootAndSwitchToViewController:(UIViewController *)viewController withSlideOutAnimation:(BOOL)slideOutAnimation andCompletion:(void (^)())completion;
Similar to previous method, but allows turning on/off slide-out-animation during the switch
###### - (void)popAllAndSwitchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion;
Replaces the ViewController stack with a new stack that includes the new ViewController, and calls completion
###### - (void)popAllAndSwitchToViewController:(UIViewController *)viewController withSlideOutAnimation:(BOOL)slideOutAnimation andCompletion:(void (^)())completion;
Similar to previous method, but allows turning on/off slide-out-animation during the switch
###### - (void)openMenu:(Menu)menu withCompletion:(void (^)())completion;
Opens a given menu and calls the completion block oppon animation completion
###### - (void)closeMenuWithCompletion:(void (^)())completion;
Closes the menu and calls the completion block oppon animation completion
###### - (void)toggleLeftMenu;
Toggles the left menu open or close depending on the existing state. This was made public in order to pass the selector to a custom UIBarButtonItem (ex: UIBarButtonItem with a button as a custom view)
```
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
[button setImage:[UIImage imageNamed:@"menu-button"] forState:UIControlStateNormal];
[button addTarget:[SlideNavigationController sharedInstance] action:@selector(toggleRightMenu) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
[SlideNavigationController sharedInstance].rightBarButtonItem = rightBarButtonItem;
```
###### - (void)bounceMenu:(Menu)menu withCompletion:(void
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
iOS-Slide-Menu-2014-12-10.zip (72个子文件)
iOS-Slide-Menu
SlideMenuTests
SlideMenuTests.m 594B
SlideMenuTests.h 361B
SlideMenuTests-Info.plist 690B
en.lproj
InfoPlist.strings 45B
License.txt 1KB
.DS_Store 6KB
SlideMenu
main.m 472B
SlideMenu-Info.plist 2KB
Default.png 6KB
Images
gear.png 23KB
animation.png 81KB
rightMenu.jpg 121KB
flower.png 2KB
leftMenu.jpg 310KB
AppDelegate.h 531B
AppDelegate.m 5KB
Default-568h@2x.png 18KB
Helper 2KB
Helper Classes
FriendInfoViewController.h 287B
RightMenuViewController.m 4KB
SampleViewController.h 310B
LeftMenuViewController.h 483B
.DS_Store 8KB
SampleViewController.m 868B
NoMenuViewController.h 236B
FriendsViewController.h 317B
ProfileViewController.m 2KB
ProfileDetailViewController.h 317B
NoMenuViewController.m 1KB
HomeViewController.m 7KB
RightMenuViewController.h 674B
ProfileDetailViewController.m 589B
FriendsViewController.m 1KB
ProfileViewController.h 343B
LoginViewController.h 234B
LoginViewController.m 2KB
FriendInfoViewController.m 894B
LeftMenuViewController.m 4KB
HomeViewController.h 1KB
.DS_Store 8KB
Default@2x.png 16KB
Source
SlideNavigationController.h 4KB
Assets
menu-button@2x.png 1KB
menu-button.png 1KB
SlideNavigationController.m 25KB
Animations
SlideNavigationContorllerAnimatorSlideAndFade.m 3KB
SlideNavigationContorllerAnimatorSlideAndFade.h 2KB
SlideNavigationContorllerAnimatorScaleAndFade.h 2KB
SlideNavigationContorllerAnimatorScaleAndFade.m 3KB
SlideNavigationContorllerAnimatorScale.h 2KB
SlideNavigationContorllerAnimatorSlide.m 5KB
SlideNavigationContorllerAnimator.h 2KB
SlideNavigationContorllerAnimatorSlide.h 2KB
SlideNavigationContorllerAnimatorScale.m 3KB
SlideNavigationContorllerAnimatorFade.h 2KB
SlideNavigationContorllerAnimatorFade.m 3KB
SlideMenu-Prefix.pch 315B
en.lproj
MainStoryboard_iPad.storyboard 45KB
MainStoryboard_iPhone.storyboard 41KB
InfoPlist.strings 45B
iOS-Slide-Menu.podspec 690B
SlideMenu.xcodeproj
project.xcworkspace
contents.xcworkspacedata 154B
xcuserdata
dumbbellyang.xcuserdatad
UserInterfaceState.xcuserstate 30KB
donelaccount.xcuserdatad
UserInterfaceState.xcuserstate 10KB
project.pbxproj 37KB
xcuserdata
dumbbellyang.xcuserdatad
xcschemes
xcschememanagement.plist 571B
SlideMenu.xcscheme 4KB
xcdebugger
Breakpoints_v2.xcbkptlist 91B
donelaccount.xcuserdatad
xcschemes
xcschememanagement.plist 571B
SlideMenu.xcscheme 4KB
.gitignore 232B
README.md 10KB
共 72 条
- 1
dumbbellyang
- 粉丝: 62
- 资源: 106
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 传统网页UI设计在移动应用开发中的应用研究.pdf
- 基于pytorch实现BERT+BiLSTM+CRF实现中文命名实体识别源码.zip
- 校园帮项目,毕业设计/课程设计/javaWeb/SSM
- C++ plotting library,matplotlib-cpp-master.zip
- 案例源码matplotlib-examples-master.zip
- 基于JavaScript 实现的KMP 算法
- 基于C++实现二叉树的创建,遍历,添加,查找与删除
- 基于C语言实现二叉树的基本操作
- 毕业设计基于STM32的测量温度与压力的数据处理设计C语言完整源码+论文.zip
- 基于MATLAB的PCA算法人脸识别项目源码+GUI界面+说明文档.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页