CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Apache 2 |
ReleasedLast Release | Jul 2015 |
Maintained by Natalia Osiecka.
Circle shaped control to select given number of values.
There are three kinds of objects:
[_circleSelector setNumberOfDots:4];
[_circleSelector setDotRadius:50.f];
[_circleSelector setLineWidth::2.f];
[_circleSelector setLineColor:[UIColor redColor]];
[_circleSelector setFillColor:[UIColor blueColor]];
[dot setLineWidth:2.f];
[dot setLineColor:[UIColor redColor]];
[dot setFillColor:[UIColor greenColor]];
[dot.textLabel setText@"Hello!"];
[dot.imageView setImage:[UIImage imageNamed:@"girl"]];
[dot setAngle:90.f];
[dot setMinAngle:0.f];
[dot setMaxAngle:360.f];
[dot shouldDrawConnectionBehind:YES];
[connection setConnectionColor:[UIColor redColor]];
[connection setLineWidth:3.f];
[dot setLineWidth:2.f];
In your projects git folder type:
git submodule init
git submodule add --copy link to the repo--
git submodule update
Copy all files from NOSELCircleSelector folder.
This is strongly misadvised as you won't be able to see code updates. Clone or download the source, copy all files from NOCircleSelector folder.
Clone and see the demo for more examples about implementation. You can add the view via Storyboard or using code:
// in your view.h download the library
#import <NOCircleSelector/NOSELCircleSelector.h>
// add a property
@property (nonatomic) NOSELCircleSelector *circleSelector;
// alloc & init the view or setup this via storyboard (eg in view's initWithFrame:)
_circleSelector = [[NOSELCircleSelector alloc] initWithFrame:frame];
[_circleSelector setBackgroundColor:[UIColor clearColor]];
[self addSubview:_circleSelector];
// update the frame (eg in view's layoutSubviews) or use constraints
[_circleSelector setFrame:self.bounds];
// in your controller setup basic view
- (void)viewDidLoad {
[super viewDidLoad];
// if you need you can subscribe to delegate to handle events
[_aView.circleSelector setDelegate:self];
[_aView.circleSelector setTag:ExampleCircleSelectorBig];
[_aView.circleSelector setNumberOfDots:3];
[_aView.circleSelector setDotRadius:30.f];
}
// and handle whichever delegate you need
- (void)circleSelector:(NOSELCircleSelector *)circleSelector changedDots:(NSArray *)dots {
NOSELCircleDot *dot1 = [dots objectAtIndex:0];
[dot1 setUserInteractionEnabled:NO];
[dot1 setAngle:270.f];
[dot1.imageView setImage:[UIImage imageNamed:@"girl"]];
}
- (void)circleSelector:(NOSELCircleSelector *)circleSelector changedDotConnections:(NSArray *)dotConnections {
for (NOSELCircleDotConnection *dotConnection in dotConnections) {
[dotConnection setConnectionColor:[UIColor blueColor]];
[dotConnection setLineWidth:2.f];
}
}
- (void)circleSelector:(NOSELCircleSelector *)circleSelector updatedDot:(NOSELCircleDot *)dot {
[dot.textLabel setText:[NSString stringWithFormat:@"%d", (int)dot.angle]];
}
- (void)circleSelector:(NOSELCircleSelector *)circleSelector beganUpdatingDotPosition:(NOSELCircleDot *)dot {
[_view.valueLabel setHidden:NO];
}
- (void)circleSelector:(NOSELCircleSelector *)circleSelector endedUpdatingDotPosition:(NOSELCircleDot *)dot {
[_view.valueLabel setHidden:YES];
}
- (Class)circleSelectorRequestsNOCircleDotClass:(NOSELCircleSelector *)circleSelector {
return [ExampleCircleDot class];
}
Contains 2 examples. The first one (on the left) is simple < 20 lines configuration. The second one handles minimum and maximum values, line colors, widths etc.
Natalia Osiecka, [email protected]
Available under the Apache 2.0 license. See the LICENSE file for more info.
Requires Xcode 6, targeting either iOS 5.1.1 or higher.