GithubHelp home page GithubHelp logo

carabina / dscircularmenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from doddasrinivasan/dscircularmenu

0.0 1.0 0.0 57 KB

iOS Circular Wheel Menu

License: MIT License

Ruby 2.92% Objective-C 74.56% Shell 22.52%

dscircularmenu's Introduction

DSCircularMenu

DSCircularMenu is a custom container view controller to provide a circular menu based navigation. It Comes with a simple set up and delegate methods similar to collection or table view.


Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

DSCircularMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DSCircularMenu"

##Setup

  1. Create a ViewController and subclass it with DSCircularMenuRevealController.
  2. Create an subclass of UICollectionViewCell for menuItem. Make sure you generate an XIB too. And design the MenuItem as you wish
  3. In the ViewController's view did load method configure the menu and register MenuItem
    CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
    CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height;

    [self setMenuWithCentre:CGPointMake(screenWidth/2, screenHeight-40)
          radius:screenWidth/2 - 40
          andItemSize:CGSizeMake(50, 50)];
    
    [self registerNib:[UINib nibWithNibName:@"MenuCell" bundle:[NSBundle mainBundle]] forReuseIdentifier:@"MenuCell"];

4 . Now Over ride the following methods in the ViewController

-(NSInteger)noOfMenuItems{
    return 10;
}

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView menuItemAt:(NSInteger)index{
    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MenuCell" forIndexPath:[NSIndexPath indexPathForItem:index inSection:0]];
    
    // Customize the menu item
    
    return cell;
}

-(UIViewController *)viewControllerForMenuItemAt:(NSUInteger)index{
    //Add your custom logic to return the corresponding view controller for that MenuItem
    UIViewController *ctrl = [UIViewController alloc] init];
    
    return ctrl;
}

Author

Dodda Srinivasan, [email protected]

License

DSCircularMenu is available under the MIT license. See the LICENSE file for more info.

dscircularmenu's People

Contributors

doddasrinivasan avatar

Watchers

Carabineiro avatar

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.