CLTimer
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Swift 2.2
Installation
CLTimer provides you a circular timer to integrate in your ios app with multiple designs and time format options. Intead of writing complicated code with complex calculations you can simply integrate Timer in your app with a single line of code.
CLTimer is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CLTimer"
Step 1 - From identity inspector replace UIView class of your UIView with CLTimer class in your xib or StoryBoard.
Step 2 - Create its Outlet.
@IBOutlet weak var timer: CLTimer!
To start Timer
timer.startTimer(withSeconds: 100, format:.Minutes , mode: .Reverse)
Change countDown circle and Timer circle color by selecting CLTimer View from your StoryBoard or xib.
To Reset Timer
timer.resetTimer()
To Stop Timer
timer.stopTimer()
To Hide Default CountDown
timer.showDefaultCountDown=false
To Show CountDown time on your Own Label
- Apply cltimerDelegate
class ViewController: UIViewController,cltimerDelegate
- use its Delegate Function
func timerDidUpdate(time:Int){
print("updated Time : ",time)
myLabel.text = "\(time) Seconds"
}
You can also checkout some other CLTimer Delegate functions
YouTube Link
https://www.youtube.com/channel/UCwYjZ3vXQYhJaRwUm6u9-bA
Author
Dewanshu Sharma, sdivyanshu23@gmail.com
License
CLTimer is available under the MIT license. See the LICENSE file for more info.