Coder Social home page Coder Social logo

eggsofangel / broptionsbutton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from basheersience/broptionsbutton

0.0 2.0 0.0 2.02 MB

Amazing options button for your UITabBar, with very beautiful dynamic animation. Pimp your tabBar

License: MIT License

Objective-C 100.00%

broptionsbutton's Introduction

The Library currently is not supported⛔️

BROptionsButton

Amazing options button for your UITabBar, with very beautiful dynamic animation. Pimp your tabBar with beautiful button.

  • You saw Yelp® app and impressed by the central button animtaion ?
  • Now you can have even better aniamation and feel by using BROptionsButton. BROptionsButton uses the power of UIDynamics to make animation very realastic and beautiful.

What's new in Version 1.3

  1. iOS 8 support
  2. iPhone 6 and 6+ support
  3. Less dependency on screen sizes, so now it works with all devices
  4. change damping and frequency of the animation on the go
  5. change the location of the button dynamically with/without animation

left

Specifications: =============== 1) You can add BrOptionsButton at any index in your tabBar

left

|

center

|

right


2) You can have from 1 option button up to 7 for iPhone

left

|

center

|

right


3) Choose your own custom images and colors
4) Dynamically change the number of items, background color, titles, and the location of the button

What will you need:

  1. iOS 7 or later
  2. instance of UItabBar (of course)

How to use it:

  • import BROptionsButton.h
#import "BROptionsButton.h"
  • Initialize new button
// the index 1 is the center for UITabBar with 3 buttons
// the delegate must be setted  
 BROptionsButton *brOption = [[BROptionsButton alloc] initForTabBar:self.tabBar forItemIndex:1 delegate:self];
  • Customize the button. Set images for different states
[brOption setImage:[UIImage imageNamed:@"Apple"] forBROptionsButtonState:BROptionsButtonStateNormal];
[brOption setImage:[UIImage imageNamed:@"close"] forBROptionsButtonState:BROptionsButtonStateOpened];
  • Respond to the formal protocol messages
// number of items 
- (NSInteger)brOptionsButtonNumberOfItems:(BROptionsButton *)brOptionsButton
{
    return 4;
}

// respond to selection (show viewController, animation, alert...)
- (void)brOptionsButton:(BROptionsButton *)brOptionsButton didSelectItem:(BROptionItem *)item
{
    [self setSelectedIndex:brOptionsButton.locationIndexInTabBar];
}
  • Respond to informal protocol messages to have more customizations
// custom image for this item.
// nil will make rounded button with default background color
- (UIImage*)brOptionsButton:(BROptionsButton *)brOptionsButton imageForItemAtIndex:(NSInteger)index
{
    UIImage *image = [UIImage imageNamed:@"Apple"];
    return image;
}

// do any setups before displaying the button
- (void)brOptionsButton:(BROptionsButton*)optionsButton willDisplayButtonItem:(BROptionItem*)button {
    button.backgroundColor = [UIColor blackColor];
}


- (NSString*)brOptionsButton:(BROptionsButton*)brOptionsButton titleForItemAtIndex:(NSInteger)index {
   return @"buttonTitle";
}

Next:

Stay tuned, more cool stuff and updates comming soon, click Watch to get the latest updates for this library

Lincense:

Copyright (c) 2013 Basheer Malaa

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

broptionsbutton's People

Contributors

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