EMLMenuBar 1.1

EMLMenuBar 1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Sep 2015

Maintained by Enric Macias Lopez.




  • By
  • enric.macias.lopez

Description

Implements a scrollable view with buttons in it. Offers different delegate methods to use it as a menu bar and some design and animation customization.

alt tag

Requirements

  • iOS 7.0
  • ARC

Usage

Check the example project in the "Example" folder.

Quick setup

  1. Create a UIView in Interface Builder with EMLMenuBar as a class. (The buttons will have the height of this view)

    alt tag

  2. Adopt EMLMenuBarDataSource and EMLMEnuBarDelegate into your UIViewController.

    @interface EMLMainViewController : UIViewController <EMLMenuBarDelegate, EMLMenuBarDataSource>
  3. Assign the delegate and datasource to your UIViewController.

    alt tag

  4. Implement the EMLMenuBarDataSource and its required methods:

    - (NSUInteger)itemCountInMenuBar:(EMLMenuBar *)menuBar;
    - (NSString *)itemTitleAtIndex:(NSUInteger)index inMenuBar:(EMLMenuBar *)menuBar;
  5. Implement the EMLMEnuBarDelegate and its required method:

    - (void)itemSelectedAtIndex:(NSUInteger)index inMenuBar:(EMLMenuBar *)menuBar;

Customization

  • Choose one of the three types of button alineation:

    EMLMenuBarStyleNone (Default). The width is the one set in EMLMenuBarDataSource. alt tag

    EMLMenuBarStyleFitText alt tag

    EMLMenuBarStyleFillMenu alt tag

  • Modify the button design through interface builder with EMLMenuBarButton xib file:

EMLMenuBarButton.xib
  • Create your own animation with:
- (void)appearanceForNormalStateMenuBarButton:(EMLMenuBarButton *)barButton;
- (void)appearanceForSelectedStateMenuBarButton:(EMLMenuBarButton *)barButton;

Installation

Manually

Import the following files into your project:

EMLMenuBar/Pod/Classes folder:

EMLMenuBar.h
EMLMenuBar.m
EMLMenuBarButton.h
EMLMenuBarButton.m
EMLMenuBarDataSource.h
EMLMenuBarDelegate.h

EMLMenuBar/Pod/Resources folder:

EMLMenuBarButton.xib

Author

enric.macias.lopez, [email protected]

License

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