Skip to content

Commit

Permalink
Style protocol added to provide easier customization
Browse files Browse the repository at this point in the history
  • Loading branch information
will-tm committed Oct 25, 2015
1 parent 44b43ce commit f5c37d9
Show file tree
Hide file tree
Showing 7 changed files with 312 additions and 292 deletions.
33 changes: 5 additions & 28 deletions WMGaugeView/WMGaugeView.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/

#import <UIKit/UIKit.h>
#import "WMGaugeViewStyle.h"
#import "WMGaugeViewStyleFlatThin.h"
#import "WMGaugeViewStyle3D.h"

/**
* Styling enumerations
Expand All @@ -18,27 +21,6 @@ typedef enum
}
WMGaugeViewSubdivisionsAlignment;

typedef enum
{
WMGaugeViewNeedleStyle3D,
WMGaugeViewNeedleStyleFlatThin
}
WMGaugeViewNeedleStyle;

typedef enum
{
WMGaugeViewNeedleScrewStyleGradient,
WMGaugeViewNeedleScrewStylePlain
}
WMGaugeViewNeedleScrewStyle;

typedef enum
{
WMGaugeViewInnerBackgroundStyleGradient,
WMGaugeViewInnerBackgroundStyleFlat
}
WMGaugeViewInnerBackgroundStyle;

/**
* WMGaugeView class
*/
Expand All @@ -51,12 +33,6 @@ WMGaugeViewInnerBackgroundStyle;
@property (nonatomic, readwrite, assign) bool showInnerRim;
@property (nonatomic, readwrite, assign) CGFloat innerRimWidth;
@property (nonatomic, readwrite, assign) CGFloat innerRimBorderWidth;
@property (nonatomic, readwrite, assign) WMGaugeViewInnerBackgroundStyle innerBackgroundStyle;
@property (nonatomic, readwrite, assign) CGFloat needleWidth;
@property (nonatomic, readwrite, assign) CGFloat needleHeight;
@property (nonatomic, readwrite, assign) CGFloat needleScrewRadius;
@property (nonatomic, readwrite, assign) WMGaugeViewNeedleStyle needleStyle;
@property (nonatomic, readwrite, assign) WMGaugeViewNeedleScrewStyle needleScrewStyle;
@property (nonatomic, readwrite, assign) CGFloat scalePosition;
@property (nonatomic, readwrite, assign) CGFloat scaleStartAngle;
@property (nonatomic, readwrite, assign) CGFloat scaleEndAngle;
Expand Down Expand Up @@ -88,6 +64,7 @@ WMGaugeViewInnerBackgroundStyle;
@property (nonatomic, readwrite, strong) UIFont *unitOfMeasurementFont;
@property (nonatomic, readwrite, strong) NSString *unitOfMeasurement;
@property (nonatomic, readwrite, assign) bool showUnitOfMeasurement;
@property (nonatomic, readwrite, strong) id<WMGaugeViewStyle> style;

/**
* WMGaugeView public functions
Expand All @@ -97,4 +74,4 @@ WMGaugeViewInnerBackgroundStyle;
- (void)setValue:(float)value animated:(BOOL)animated duration:(NSTimeInterval)duration;
- (void)setValue:(float)value animated:(BOOL)animated duration:(NSTimeInterval)duration completion:(void (^)(BOOL finished))completion;

@end
@end
Loading

0 comments on commit f5c37d9

Please sign in to comment.