Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eejahromi/EEJSelectMenu
Single selection menu with cool animations
https://github.com/eejahromi/EEJSelectMenu
animation ios menu
Last synced: 7 days ago
JSON representation
Single selection menu with cool animations
- Host: GitHub
- URL: https://github.com/eejahromi/EEJSelectMenu
- Owner: eejahromi
- License: mit
- Created: 2016-02-16T05:56:42.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-13T06:00:30.000Z (about 8 years ago)
- Last Synced: 2024-11-07T22:32:29.441Z (about 1 month ago)
- Topics: animation, ios, menu
- Language: Objective-C
- Homepage:
- Size: 3.19 MB
- Stars: 23
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - EEJSelectMenu - Single selection menu with cool animations, responsive with all screen sizes. (UI / Menu)
- awesome-ios-star - EEJSelectMenu - Single selection menu with cool animations, responsive with all screen sizes. (UI / Menu)
README
# EEJSelectMenu
EEJSelectMenu is a responsive single selection menu for iOS.
Project allows for implementing a menu with different number of buttons and different animations for appearance.
It will adjust the button sizes based on the device screen size!
Just provide the names for the buttons and the menu will take care of the number and layout of the buttons!### Demo
###### Animation: FadeIn & Widen
![](first.gif)###### Animation: Scale & MoveInFromLeft
![](second.gif)###### Animation: MoveInFromRight & Alternate
![](third.gif)##### Version 1.1.1
## Installation
### Using CocoaPods
EEJSelectMenu is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'EEJSelectMenu'
```### Using Source Files
Add the files in the `Classes/` folder to your projectImport the header file to your source code
```objective-c
#import "EEJSelectMenu.h"
```Getting Started
==================
##### Note: 🔶 To use EEJSelectMenu in your Swift project add `use_frameworks!` to your Podfile or checkout [these](https://github.com/eejahromi/EEJSelectMenu/blob/master/swiftInstructions.md) simple steps to create a bridging header and get you started. 🔶* `Initializers`
- `-initWithButtons:animationStyle:color:andDelegate:`
- `-initWithButtons:animationStyle:colors:`Create an instance of EEJSelectMenu and provide button names and color
```objective-c
NSArray *buttonNames = @[@"ONE",@"TWO",@"THREE",@"FOUR"];
EEJSelectMenu *menu = [[EEJSelectMenu alloc]initWithButtons:buttonNames
animationStyle:EEJAnimationStyleFadeIn
color:[UIColor darkGrayColor]
andDelegate:self];
[self presentViewController:menu animated:NO completion:nil];
```
For Multi-Color menu use this initializer
```objective-c
NSArray *buttonNames = @[@"ONE",@"TWO",@"THREE",@"FOUR"];
EEJSelectMenu *menu = [[EEJSelectMenu alloc]initWithButtons:buttonNames
animationStyle:EEJAnimationStyleFadeIn
colors:@[[UIColor redColor],[UIColor greenColor]
[UIColor blueColor],[UIColor orangeColor]] ];
menu.delegate = self;
[self presentViewController:menu animated:NO completion:nil];
```
Or simple initializer with the default color
```objective-c
EEJSelectMenu *menu = [[EEJSelectMenu alloc]init];
menu.buttonNames = @[@"ONE",@"TWO",@"THREE",@"FOUR"];
menu.animationStyle = EJAnimationStyleAlternate;
menu.delegate = self;
// default color is light blue
[self presentViewController:menu animated:NO completion:nil];
```
###### Note: for smoother animation set the animated property to "NO" when presenting the menu as shown above.#### AnimationStyle
```objective-c
menu.animationStyle = EJAnimationStyleFadeIn; // default
```* `Other AnimationStyles Available:`
- `EJAnimationStyleWiden`
- `EJAnimationStyleScale`
- `EJAnimationStyleMoveInFromLeft`
- `EJAnimationStyleMoveInFromRight`
- `EJAnimationStyleAlternate`#### Delegate Methods
EEJSelectMenu provides two delegate methods
```objective-c
-(void)EJSelectMenuButtonWasPressedWithTitle:(NSString *)title;
-(void)EJSelectMenuButtonWasPressedWithTag:(long)tag;
// button tags start at 100 and increment by one for each
```##### Other configurations:
Change selected button color (default: Purple)
```objective-c
menu.selectedButtonColor = [UIColor blueColor];
```
Change menu background color (default: White)
```objective-c
menu.menuBackgroundColor = [UIColor redColor];
```#### License:
EEJSelectMenu is released under the MIT license. See LICENSE for details.