Git Product home page Git Product logo

vksidemenu's Introduction

VKSideMenu

Description

VKSideMenu is a UITableView-like menu with blur effect and gestures.
Note: blur effect is availabe for iOS 8.0 and later only. You will get a simple UIView with half-transperent background for iOS 7.

VKSideMenu Demo

Installation

For now you can install VKSideMenu manually only. Just add VKSideMenu folder into your project and #import VKSideMenu.h in your parent class.

Example project

Example project shows how you can create both left-side and right-side VKSideMenu in one controller. To test it it, clone the repo and run it from the Example directory.

Usage

Work of VKSideMenu is similliar to UITableView. Here is an example of menu initialization:

// Add VKSideMenuDelegate and VKSideMenuDataSource in your parent class interface

@property (nonatomic, strong) VKSideMenu *menu;

self.menu = [[VKSideMenu alloc] initWithWidth:220 andDirection:VKSideMenuDirectionLeftToRight];
self.menu.dataSource = self;
self.menu.delegate   = self;

// And show it from somewhere in your code
[self.menu show];

After initialization you should assign data source and delegate to menu object and declare according methods. It's really easy to use:

-(NSInteger)numberOfSectionsInSideMenu:(VKSideMenu *)sideMenu
{
    return 1;
}

-(NSInteger)sideMenu:(VKSideMenu *)sideMenu numberOfRowsInSection:(NSInteger)section
{
	return 3;
}

-(VKSideMenuItem *)sideMenu:(VKSideMenu *)sideMenu itemForRowAtIndexPath:(NSIndexPath *)indexPath
{
	VKSideMenuItem *item = [VKSideMenuItem new];

	switch (indexPath.row)
	{
	case 0:
		item.title = @"Profile";
		item.icon  = [UIImage imageNamed:@"ic_option_1"];
		break;
                
	case 1:
		item.title = @"Messages";
		item.icon  = [UIImage imageNamed:@"ic_option_2"];
		break;
                
	case 2:
		item.title = @"Cart";
		item.icon  = [UIImage imageNamed:@"ic_option_3"];	
		break;
                
	case 3:
		item.title = @"Settings";
		item.icon  = [UIImage imageNamed:@"ic_option_4"];
        break;
                
	default:
		break;
	}
    
    return item;
}

This class is very flexible for customization. You can set text colors, text fonts, background etc. See more info in VKSideMenu.h file.

Gestures

You can add Swipe gesture recognition for a specific view. Just use method addSwipeGestureRecognition: to enable it.

Author

Vladislav Kovalyov, http://woopss.com/

License

VKSideMenu is available under the MIT License. See the LICENSE file for more info.

vksidemenu's People

Contributors

faker22 avatar

Stargazers

Vatsal Kelawala avatar  avatar SK avatar  avatar xiaolei avatar Vijay Kumar avatar Sahibuddin Ahmed avatar Mehdi Negahban avatar  avatar  avatar  avatar 禍小夜 avatar cymhl avatar Jhuang Dong Shuo avatar Roman Sorochak avatar redmac avatar Leanghong avatar  avatar  avatar Sebastian Barajas avatar Rene Skov avatar junhyi park avatar Jay Mayu avatar  avatar Mr.Meng avatar Jayesh Lathiya avatar  avatar Pawan Kumar Rai avatar Pranav Lathigara avatar woshizilong avatar Pratik Jamariya avatar Mehul Akoliya avatar Martin Michelini avatar Kishy Kumar avatar Patomphong Wongkalasin avatar Mehdi Badjian avatar  avatar gene avatar Shanti Rodríguez avatar  avatar sumengliu avatar Moonlight avatar José Sancho avatar Ash Richards avatar Maythee Anegboonlap avatar Carabineiro avatar  avatar Dimo Hamdy avatar Subhash kumar sharma avatar MohsinAli avatar James Rocco avatar LinkJin avatar

Watchers

MohsinAli avatar Carabineiro avatar Sun avatar Vladislav Kovalyov avatar  avatar

vksidemenu's Issues

xcode 9 / iOS 11 - crash when loading subview

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<UITableView: 0x7fa8e9860000; frame = (0 0; 220 568); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x60000005b990>; layer = <CALayer: 0x60000022be20>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 0, 0}> has been added as a subview to <UIVisualEffectView: 0x7fa8e9400e50; frame = (-220 0; 220 568); layer = <CALayer: 0x60000022af00>>. Do not add subviews directly to the visual effect view itself, instead add them to the -contentView.'

Line 133 of vkSideMenu: [self.view addSubview:self.tableView];

Not sure yet how to resolve it.

Vertical Slide Down

I would love to see a feature added to enable Vertical Side Down.

Thanks, great control.

Programmatic approach example

Hello,

Is there a chance you can give a programmatic approach instead of a story board on how to add the left/right buttons and link them to the menuLeft/menuRight objects?

Edwin

Strange Issue.....

Hi,

When I initiate a view controller from storyboard and into that new controller I create programmatically the vksidemenu..... nothing happens but strangely when I go back to previous controller (first controller which is the starting point of storyboard) there, the left and right side menu exist and working fine!
Why I have that strange behavior?
Can you take a look?

Thank you very much

George Gerardis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.