Skip to content

RobinChin/Rotating-View

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synopsis

A simple and easy use rotatable view.

Code Example

var rotationView = RotationView()
    
override func viewDidLoad() {
   super.viewDidLoad()
        
   rotationView.frame = CGRect(x: 30, y: 30, width: 100, height: 100)
   rotationView.center = view.center
   rotationView.secondPerRevolution = 0.6
   rotationView.clockwise = true
        
   view.addSubview(rotationView)
        
}

Motivation

I need a rotatable view ,which can rotate colockwise/counterclockwise, and also set the speed. I creat it and share to anyone who needs it.

Installation

Just downlond the project and copy RotatingView.swift & RotatingAnimation.swift to your project.

API Reference

property description
secondPerRevolution how fast the view will rotate.
isRotating  get the rotating status.
rotationImage  the image you want to rotate.
method description
rotationBegin() make the view begin to rotate.
rotationStop() make the view stop roate.

License

MIT

About

A simple rotating view

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages