• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mikefrederick/MFSideMenu: Facebook-like side menu for iOS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

mikefrederick/MFSideMenu

开源软件地址:

https://github.com/mikefrederick/MFSideMenu

开源编程语言:

Objective-C 99.4%

开源软件介绍:

#MFSideMenu

This project was inspired by the side-menu functionality seen in the Facebook iOS app. MFSideMenu utilizes view controller containment and gives you a simple API for implementing side-menu functionality. It integrates with storyboard-based apps as well as traditional setups.

=======

 

##Features

  • Universal device support (iPhone + iPad)
  • Universal orientation support (Portrait + Landscape)
  • Menus on the left and right side of the screen.
  • Storyboard support
  • View controller containment
  • Works with UINavigationController, UITabBarController, and other types of view controllers
  • Nice set of configuration options
  • Lightweight, simple and readable code.

##Installation

####CocoaPods Add pod 'MFSideMenu' to your Podfile.

####Manually Add the MFSideMenu folder to your project. Add QuartzCore to your project. MFSideMenu uses ARC. If you have a project that doesn't use ARC, just add the -fobjc-arc compiler flag to the MFSideMenu files.

##Usage

###Basic Setup

In your app delegate:

#import "MFSideMenu.h"

MFSideMenuContainerViewController *container = [MFSideMenuContainerViewController
                                                containerWithCenterViewController:centerViewController
                                                leftMenuViewController:leftMenuViewController
                                                rightMenuViewController:rightMenuViewController];
self.window.rootViewController = container;
[self.window makeKeyAndVisible];

###Opening & Closing Menus

// toggle the left side menu
[self.menuContainerViewController toggleLeftSideMenuCompletion:^{}];
// toggle the right side menu
[self.menuContainerViewController toggleRightSideMenuCompletion:^{}];
// close the side menu
[self.menuContainerViewController setMenuState:MFSideMenuStateClosed completion:^{}];
// open the left side menu
[self.menuContainerViewController setMenuState:MFSideMenuStateLeftMenuOpen completion:^{}];
// open the right side menu
[self.menuContainerViewController setMenuState:MFSideMenuStateRightMenuOpen completion:^{}];

###Pan Modes

You can specify which areas you want to allow pan gestures on:

// enable panning on the center view controllers & the side menus (this is the default behavior):
menuContainerViewController.panMode = MFSideMenuPanModeCenterViewController | MFSideMenuPanModeSideMenu;

// disable panning on the side menus, only allow panning on the center view controller:
menuContainerViewController.panMode = MFSideMenuPanModeCenterViewController;

// disable all panning
menuContainerViewController.panMode = MFSideMenuPanModeNone;

###Panning Custom Views

You can add panning to any view like so:

[panView addGestureRecognizer:[self.menuContainerViewController panGestureRecognizer]];

###Listening for Menu Events

You can listen for menu state event changes (i.e. menu will open, menu did open, etc.). See MFSideMenuContainerViewController.h for the different types of events.

[[NSNotificationCenter defaultCenter] addObserver:self
                                            selector:@selector(menuStateEventOccurred:)
                                                name:MFSideMenuStateNotificationEvent
                                              object:nil];
- (void)menuStateEventOccurred:(NSNotification *)notification {
    MFSideMenuStateEvent event = [[[notification userInfo] objectForKey:@"eventType"] intValue];
    MFSideMenuContainerViewController *containerViewController = notification.object;
    // ...
}

###Menu Slide Animation

With this option enabled, the side menus will slide in & out with the center view controller. This effect is similar to the Wunderlist side menu.

// enable the menu slide animation
[menuContainerViewController setMenuSlideAnimationEnabled:YES];

// control the exaggeration of the menu slide animation
[menuContainerViewController setMenuSlideAnimationFactor:3.0f];

###Shadow

MFSideMenu gives you the option to show a shadow between the center view controller & the side menus.

// enable/disable the shadow
[menuContainerViewController.shadow setEnabled:YES];

// set the radius of the shadow
[menuContainerViewController.shadow setRadius:10.0f];

// set the color of the shadow
[menuContainerViewController.shadow setColor:[UIColor blackColor]];

// set the opacity of the shadow
[menuContainerViewController.shadow setOpacity:0.75f];

##Contact

@mike_frederick




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
libimobiledevice/idevicerestore: Restore/upgrade firmware of iOS devices发布时间:2022-06-21
下一篇:
ios7hash/ios7hash发布时间:2022-06-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap