This is the simple circle countdown with a configurable timer for iOS.
Swift Ruby
Switch branches/tags
Nothing to show
Latest commit 3aa8bc8 May 25, 2017 @rsrbk updated PODSPEC
Permalink
Failed to load latest commit information.
SRCountdownTimer.xcodeproj Added tests May 25, 2017
SRCountdownTimer Added tests May 25, 2017
SRCountdownTimerExample init May 13, 2017
SRCountdownTimerTests Added tests May 25, 2017
LICENSE.txt init May 13, 2017
README.md updated README 2 May 25, 2017
SRCountdownTimer.podspec updated PODSPEC May 25, 2017
demo.gif Added tests May 25, 2017

README.md

SRCountdownTimer Pod status

This is the simple circle countdown with a configurable timer

Demo gif

Installation

The most preferable way to use this library is cocoapods. Add the following line to your Podfile:

pod `SRCountdownTimer`

and run pod install in your terminal.

Alternatively, you can manually add the files in the SRCountdownTimer directory to your project.

Usage

Create a custom instance of SRCountdownTimer(subclass of UIView) using the storyboard or directly in the code.

You can customize different properties:

public var lineWidth: CGFloat = 2.0
public var lineColor: UIColor = .black
public var trailLineColor: UIColor = UIColor.lightGray.withAlphaComponent(0.5)

public var isLabelHidden: Bool = false
public var labelFont: UIFont?
public var timerFinishingText: String?

The last(timerFinishingText) means the text that will be shown after timer expires. If nil - it'll show the current counter value(0).

Use this method to start the countdown:

public func start(beginingValue: Int, interval: TimeInterval = 1)

To pause:

public func pause()

To resume(will start from the current state of view)

public func resume()

SRCountdownTimerDelegate

@objc optional func timerDidUpdateCounterValue(newValue: Int)
@objc optional func timerDidStart()
@objc optional func timerDidPause()
@objc optional func timerDidResume()
@objc optional func timerDidEnd()

Shoutout

This was inspired by https://github.com/johngraham262/JWGCircleCounter

License

MIT License

Copyright (c) 2017 Ruslan Serebriakov rsrbk1@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.