Arrows is an animated custom view, made with Core Graphics, to represent three different states: up/down/middle
Just need to set ArrowView
in the class you want to be painted with the arrow indicator in IB
In your ViewController, you can change the state of the arrow using update
function
class YourViewController: UIViewController {
@IBOutlet weak var arrow: ArrowPanel!
override func viewDidLoad() {
super.viewDidLoad()
// .up, .down, .middle
arrow.update(to: .middle, animated: true)
}
}
The perfect companion for Arrows
is Panels, take a look!
/// Get the current position, if you want to change
/// position use `update` function
fileprivate(set) var arrowPosition: Position = .middle
/// Animation duration between arrow states (accesible from IB)
@IBInspectable open var arrowAnimationDuration: Double = 0.30
/// Set arrow color (accesible from IB)
@IBInspectable open var arrowColor: UIColor = .black
Add the line pod "Arrows"
to your Podfile
Add the line github "antoniocasero/Arrows"
to your Cartfile
Project created by Antonio Casero (@acaserop on Twitter).