AERightMenuWindow 0.1.0

AERightMenuWindow 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Nov 2016

Maintained by William Wang.



  • By
  • William Wang

A generic approach for iOS to show view controller as side right menu and inspired by 唐巧 who is the author of the book <iOS进阶开发>. You can find some usable knowledge about UIWindow from chapter 12 of the book.

Implementation

Utilize UIWindow to show a view controller as a right side menu. You can specify the width percentage of menu view related to the full screen. Also, you can set the dropback color(normally it's a semi-transparent color) and the animation duration for showing the side menu.

Setup

Usage

Sample Code (Objective-C)

AERightMenuWindow simplifies writing right side menu layout in you app. Let's take a quick look at an example,

Here's a view controller loaded from storyboard and it utilizes AERightMenuWindow to display itself as a right side menu in a designated window.

// Step 1: Create your controllers.
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
MenuViewController *frontController = [mainStoryboard instantiateViewControllerWithIdentifier:@"MenuViewController"];

// Step2: Customize by define your own options
AERightMenuWindowOptions* options = [[AERightMenuWindowOptions alloc] init];
[options setDropBackColor:kAERightMenuWindowDropBackColor];
[options setAnimationInterval:kAERightMenuWindowAnimationInterval];
[options setMenuViewWidthPercentageOfFullScreen:0.80f];
[[AERightMenuWindow instance] setOptions:options];

// Step3: Show side menu
[[AERightMenuWindow instance] showMenu:frontController];

Meta

Originally designed & built by William (@canicelebrate). Distributed with the MIT license.