Giter Site home page Giter Site logo

fcverticalmenu's Introduction

FCVerticalMenu

A vertical menu animated and fully customizable.

FCVerticalMenu Screenshot FCVerticalMenu Demo

Requirements

Xcode 6 or higher Apple LLVM compiler iOS 7.0 or higher ARC

Demo

Build the demo project with Xcode 6+. Take a look at the FCNavigatorViewController in which everything is configured.

Installation

FCVerticalMenu is available through CocoaPods.

Install CocoaPods if you don't:

$ [sudo] gem install cocoapods
$ pod setup

Change to the directory of your Xcode project:

$ cd /path/to/YourProject
$ touch Podfile
$ edit Podfile

To install FCVerticalMenu, simply add the following line to your Podfile:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '7.0'
pod "FCVerticalMenu"

Install for your project as usual:

$ pod install

Finally start working with the .xcworkspace file instead of .xcproject as usual

$ open YourProject.xcworkspace

Example Usage

FCVerticalMenuItem *item1 = [[FCVerticalMenuItem alloc] initWithTitle:@"First Menu" andIconImage:[UIImage imageNamed:@"settings-icon"]];

item1.actionBlock = ^{
    NSLog(@"test element 1");
};


self.verticalMenu = [[FCVerticalMenu alloc] initWithItems:@[item1]];
self.verticalMenu.appearsBehindNavigationBar = YES;

[self.verticalMenu showFromNavigationBar:self.navigationBar inView:self.view];

Fully customizable

You can customize the appearance of the menu:

@property (strong, readwrite, nonatomic) UICollectionViewFlowLayout *menuLayout;

@property (strong, readwrite, nonatomic) UIColor *shadowColor;
@property (assign, readwrite, nonatomic) CGSize shadowOffset;
@property (assign, readwrite, nonatomic) CGFloat shadowOpacity;
@property (assign, readwrite, nonatomic) CGFloat shadowRadius;
@property (assign, readwrite, nonatomic) CGFloat backgroundAlpha;
@property (strong, readwrite, nonatomic) UIColor *backgroundColor;

@property (strong, readwrite, nonatomic) UIFont *font;
@property (strong, readwrite, nonatomic) UIColor *textColor;
@property (strong, readwrite, nonatomic) UIColor *textShadowColor;
@property (strong, readwrite, nonatomic) UIColor *imageTintColor;
@property (strong, readwrite, nonatomic) UIColor *highlightedBackgroundColor;
@property (strong, readwrite, nonatomic) UIColor *highlightedTextColor;
@property (strong, readwrite, nonatomic) UIColor *highlightedTextShadowColor;
@property (strong, readwrite, nonatomic) UIColor *highlightedImageTintColor;
@property (assign, readwrite, nonatomic) CGFloat borderWidth;
@property (strong, readwrite, nonatomic) UIColor *borderColor;
@property (assign, readwrite, nonatomic) NSTextAlignment textAlignment;

@property (assign, readwrite, nonatomic) NSTimeInterval animationDuration;
@property (assign, readwrite, nonatomic) NSTimeInterval closeAnimationDuration;
@property (assign, readwrite, nonatomic) NSTimeInterval bounceAnimationDuration;
@property (assign, readwrite, nonatomic) BOOL appearsBehindNavigationBar;
@property (assign, readwrite, nonatomic) BOOL bounce;

// only iOS 7+
// liveBlur is automatically activated
//
@property (assign, readwrite, nonatomic) BOOL liveBlur;
@property (strong, readwrite, nonatomic) UIColor *liveBlurTintColor;
@property (assign, readwrite, nonatomic) UIBarStyle liveBlurBackgroundStyle;

Delegate Methods

You can also take advantage of the delegate methods just implementing it.

Remember to adopt the delegate in your controller and set the delegate with self.verticalMenu.delegate = self;

@protocol FCVerticalMenuDelegate <NSObject>
@optional
-(void)menuWillOpen:(FCVerticalMenu *)menu;
-(void)menuDidOpen:(FCVerticalMenu *)menu;
-(void)menuWillClose:(FCVerticalMenu *)menu;
-(void)menuDidClose:(FCVerticalMenu *)menu;
@end

Author

Filippo Camillo

License

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

Version License Platform

fcverticalmenu's People

Contributors

filippocamillo avatar

Watchers

 avatar  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.