Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
rsrbk committed May 13, 2017
0 parents commit 2faed94
Show file tree
Hide file tree
Showing 23 changed files with 1,725 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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.
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
SRCountdownTimer
---
This is the simple circle countdown with a configurable timer

Installation
---
The most preferable way to use this library is cocoapods. Add the following line to your `Podfile`:
```sh
pod `JWGCircleCounter`
```
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:
```swift
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:
```swift
public func start(beginingValue: Int, interval: TimeInterval = 1)
```

To pause:
```swift
public func pause()
```

To resume(will start from the current state of view)
```swift
public func resume()
```

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.
18 changes: 18 additions & 0 deletions SRCountdownTimer.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Pod::Spec.new do |s|
s.name = 'SRCountdownTimer'
s.version = '1.0.0'
s.summary = 'This is the simple circle countdown with a configurable timer for iOS.'

s.description = <<-DESC
You can simply start your countdown, pause and resume in just one line of code. Highly customizable control.
DESC

s.homepage = 'https://github.com/rsrbk/SRCountdownTimer'
s.license = { :type => 'MIT', :file => 'LICENSE.txt' }
s.author = { 'Ruslan Serebriakov' => 'rsrbk1@gmail.com' }
s.source = { :git => 'https://github.com/rsrbk/SRCountdownTimer', :tag => s.version.to_s }

s.ios.deployment_target = '10.0'
s.source_files = 'SRCountdownTimer/*.swift'

end
Loading

0 comments on commit 2faed94

Please sign in to comment.