- Notifications
You must be signed in to change notification settings - Fork40
🔘 Multi choice circle button with cool 3d parallax effect, but seriously don't use this in production now, I will rewrite it to a delegate based UIControl when I am available.
License
JustinFincher/JZMultiChoicesCircleButton
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
[](https://travis-ci.org/Fincher Justin/JZMultiChoicesCircleButton)
#IntroductionJZMultiChoicesCircleButton is a Multi-choices button.
Just tap it and hold to your choice! yeah ,so cool, such easy.
It's inspired by Nicola Felasquez Felaco'swork
And This is myimplementation using ObjC, demo gif:
To run the example project, clone the repo, and runpod install
from the Example directory first.
#import "JZMultiChoicesCircleButton.h"- (void)viewDidLoad { [super viewDidLoad]; NSArray *IconArray = [NSArray arrayWithObjects: [UIImage imageNamed:@"SendRound"],[UIImage imageNamed:@"CompleteRound"],[UIImage imageNamed:@"CalenderRound"],[UIImage imageNamed:@"MarkRound"],nil]; NSArray *TextArray = [NSArray arrayWithObjects: [NSString stringWithFormat:@"Send"],[NSString stringWithFormat:@"Complete"],[NSString stringWithFormat:@"Calender"],[NSString stringWithFormat:@"Mark"], nil]; NSArray *TargetArray = [NSArray arrayWithObjects:[NSString stringWithFormat:@"ButtonOne"],[NSString stringWithFormat:@"ButtonTwo"],[NSString stringWithFormat:@"ButtonThree"],[NSString stringWithFormat:@"ButtonFour"] ,nil]; NewBTN = [[JZMultiChoicesCircleButton alloc] initWithCenterPoint:CGPointMake(self.view.frame.size.width / 2 , self.view.frame.size.height / 2 ) ButtonIcon:[UIImage imageNamed:@"send"] SmallRadius:30.0f BigRadius:120.0f ButtonNumber:4 ButtonIcon:IconArray ButtonText:TextArray ButtonTarget:TargetArray UseParallex:YES ParallaxParameter:300 RespondViewController:self]; [self.view addSubview:NewBTN]; }
ButtonIcon: UIImage,the icon in the small button
SmallRadius and BigRadius: CGFloat, Small button radius and the size when it's animated
ButtonNumber: int, how many buttons
ButtonIcon: NSArray of UIImage
ButtonText: NSArray of NSString
ButtonTarget : NSArray of NSString,just String of selector and JZMultiChoicesCircleButton will use NSSelectorFromString to transform it to SEL
UseParallex : BOOL, if YES will be 3D-like, or just 2D with no Parallex effect.
ParallaxParameter: CGFloat,bigger than 0, the smaller the cooler Parallex effect will be
RespondViewController: should be UIViewcontroller,the responder, simply 'self' will be ok.
- (void)SuccessLoadData{ [NewBTN SuccessCallBackWithMessage:@"YES!"];}- (void)ErrorLoadData{ [NewBTN FailedCallBackWithMessage:@"NO..."];}
Use SuccessCallBackWithMessage and FailedCallBackWithMessage to show the animated infomation , or button will befull screen and don't disappear!!!!
JZMultiChoicesCircleButton is available throughCocoaPods. To installit, simply add the following line to your Podfile:
pod"JZMultiChoicesCircleButton"
Or just grab JZMultiChoicesCircleButton.h and .m from github,
Edit
[UIImage imageNamed:@"CallbackSuccess" inBundle:bundle compatibleWithTraitCollection:nil];
With
[UIImage imageNamed:@"CallbackSuccess"];
and grab CallbackSuccess.png and CallbackWrong.png.
##TO-DO
1.Rewrite using scale down animation to prevent the blur CATextlayer
Fincher Justin,zhtsu47@me.com
JZMultiChoicesCircleButton is available under the MIT license. See the LICENSE file for more info.
About
🔘 Multi choice circle button with cool 3d parallax effect, but seriously don't use this in production now, I will rewrite it to a delegate based UIControl when I am available.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.