NHArrowView Class Reference

Inherits from UIView
Declared in NHArrowView.h

Overview

NHArrowView is a simple directional arrow with animated rotation. Rotation is achieved with the publically availbale methods and by passing in either the desired degrees or radians with optional animation details. Note that the arrow is originally drawn horizontally in the view’s frame with a small margin on the x-coordinates.

Some style aspects of the arrow are customizable, but the arrow itself is drawn as a typical block arrow with filled head. If one would like to adjust the bezier path of the arrow, please refer to UIBezierPath+Arrow category. As well, one could override the draw method of NHArrowView to achieve additional customization.

Other Methods

  strokeColor

The stroke color used when drawing the arrow. Can be dynamically updated. Default color is red

@property (nonatomic, strong) UIColor *strokeColor

Declared In

NHArrowView.h

  fillColor

The fill color used when drawing the arrow. Can be dynamically updated. Default color is red

@property (nonatomic, strong) UIColor *fillColor

Declared In

NHArrowView.h

  strokeWidth

The stroke width used when drawing the arrow. Can be dynamically updated. Default value is 2

@property (nonatomic, assign) CGFloat strokeWidth

Declared In

NHArrowView.h

  headWidth

The head width of the arrow. Can be dynamically updated. Default value is 14

@property (nonatomic, assign) CGFloat headWidth

Declared In

NHArrowView.h

  headLength

The head length of the arrow. Can be dynamically updated. Default value is 14

@property (nonatomic, assign) CGFloat headLength

Declared In

NHArrowView.h

  tailWidth

The tail width of the arrow. Can be dynamically updated. Default value is 7

@property (nonatomic, assign) CGFloat tailWidth

Declared In

NHArrowView.h

Rotation Methods

– animatedRotateToDegree:

Rotates the arrow to provided degree with default animation

- (void)animatedRotateToDegree:(CGFloat)degree

Parameters

degree

The degree to which the arrow should point

Declared In

NHArrowView.h

– animatedRotateToRadian:

Rotates the arrow to provided radians with default animation

- (void)animatedRotateToRadian:(CGFloat)rad

Parameters

rad

The radian to which the arrow should point

Declared In

NHArrowView.h

– rotateToRadian:animated:duration:

Rotates the arrow to provided radians with animation as specified

- (void)rotateToRadian:(CGFloat)rad animated:(BOOL)animated duration:(CGFloat)duration

Parameters

rad

The radian to which the arrow should point

animated

Indicates where the rotation should be animated

duration

Indicated the duration of the animation

Declared In

NHArrowView.h

– reset

Resets the arrow to its default size and shape. Does not reset the stroke and fill colour of the arrow

- (void)reset

Declared In

NHArrowView.h