##Planned improvements:
- adding and removing thumbs during runtime.
I'll be glad to hear your requests
-
CDCircle
- is aUIView
subclass. It's, let's say, the base of aCDPieMenu
. It's a circle drawn using CoreGraphics/QuartzCore. -
CDCircleThumb
-UIView
subclass, is a single segment in aCDPieMenu
. It's subview of aCDCircle
. Highly customisable. More information about modifying a thumb is listed below. -
CDIconView
-UIImageView
subclass, it handles colouring of an icon.CDIconView
is subview of aCDCircleThumb
. -
CDCircleOverlayView
- this is independent view outside of the main view hierarchy. It handles selection of a thumb. It cannot be subview of aCDCircle
because then, it would turn around with a circle.
#####CDCircle
-(id)initWithFrame:(CGRect) frame numberOfSegments:(NSUInteger) nSegments ringWidth:(CGFloat) ringWidth
#####Delegate:
-(void) circle:(CDCircle *)circle didMoveToSegment:(NSInteger)segment thumb:(CDCircleThumb *)thumb
#####Data source:
-(UIImage *) circle:(CDCircle *)circle iconForThumbAtRow:(NSInteger)row
#####CDCircleOverlayView
-(id) initWithCircle:(CDCircle) circle
#####CDCircle:
dataSource
- data source of CDPieMenu.delegate
- delegate of CDPieMenu(UIColor *) circleColor
- Set this property to change color of a circle. It may be usable when you want to achieve specyfic effect (e.g. semi transparent thumbs, and coloured circle will create some effect)(NSArray *) thumbs
- all thumbs.(CDCircleOverlayView *)
overlayView - a pointer to CDCircleOverlayView(BOOL) inertiaEffect
- it determines appearance of additional rotation after the last touch.
#####CDCircleThumb:
(CDIconView *)iconView
- a pointer to thumb's CDIconView(UIColor *)separatorColor
- color of a separatorseparatorStyle
- it can be CDCircleThumbsSeparatorNone or CDCircleThumbsSeparatorBasic. Style of a separator.(BOOL)gradientFill
- If gradientFill is set to NO, a thumb is coloured with solid color(NSArray *) gradientColors
- colors of thumb's gradient.(NSArray *) colorsLocations
- locations of colors in a gradient(UIColor *) arcColor
- if gradientFill is set to 'NO' we can set thumb's color using this property.
###CDIconView:
highlitedIconColor
- color of an image when a thumb is selected
###CDCircleOverlayView:
overlayThumb
- pointer to a thumb which is the selector (central thumb)
Use this code to implement standard CDPieMenu:
CDCircle *circle = [[CDCircle alloc] initWithFrame:CGRectMake(10 , 90, 300, 300) numberOfSegments:6 ringWidth:80.f];
circle.dataSource = self;
circle.delegate = self;
CDCircleOverlayView *overlay = [[CDCircleOverlayView alloc] initWithCircle:circle];
[self.view addSubview:circle];
//Overlay cannot be subview of a circle because then it would turn around with the circle
[self.view addSubview:overlay];
Code used to achieve effect shown above :
circle.overlayView.overlayThumb.arcColor = [UIColor colorWithRed:0.00f green:1.00f blue:0.25f alpha:0.4];
Code used to achieve effect shown above :
for (CDCircleThumb *thumb in circle.thumbs) {
[thumb.iconView setHighlitedIconColor:[UIColor redColor]];
thumb.separatorColor = [UIColor whiteColor];
thumb.separatorStyle = CDCircleThumbsSeparatorBasic;
thumb.gradientFill = NO;
thumb.arcColor = [UIColor greenColor];
}
In order to use CDPieMenu add following frameworks to your project:
- CoreGraphics
- QuartzCore
CDPieMenu is licensed under MIT license
Thank you guys for promotion
###About me:
If you have got any question, feel free to mail me at me@wczekalski.com