Skip to content

DavidKadlcek/Animate-circle-view

Repository files navigation

AnimateCircleView

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Screenshots

screenshot of circle view

Requirements

iOS 11.0 and above.

Installation

AnimateCircleView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'AnimateCircleView'

Usage

The graph with circle and label is named GraphView. In GraphView there is an access to AnimateLabel and CircleView . In CircleView there are two layers - staticLayer and shapeLayer. Only shapeLayer is animating.

I really recommend use this in ViewController to hide/show labels to smooth animation.

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
    super.viewWillTransition(to: size, with: coordinator)
    coordinator.animate(alongsideTransition: { [weak self] _ in
        self?.graphView.showHideViews(show: false)
    }) { [weak self] _ in
        self?.graphView.showHideViews(show: true)
    }
}

You need to set �maxValue and animationDuration. Then you can easily add value by method.

graphView.maxValue = 1600
graphView.animationDuration = 2.5
graphView.addValue(value: 200)

Author

DavidKadlcek, [email protected]

License

AnimateCircleView is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published