Coder Social home page Coder Social logo

srcountdowntimer's Introduction

Hi there ๐Ÿ‘‹

I'm Ruslan - iOS and Blockchain enthuziast, currently working on Trust Wallet.

srcountdowntimer's People

Contributors

ankurlahiry avatar ayumu838 avatar giaset avatar hamid1993 avatar nappannda avatar nudaya avatar prangbi avatar rsrbk avatar samir105 avatar sirwellington avatar zackb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

srcountdowntimer's Issues

how to draw gradient trail line?

i am trying to change the look of the trailing line from solid to gradient. (basically, it should start with green and end with red color in a 'gradient-ish' way when the timer is completed. any idea how i might accomplish that?

Countdown not starting again.

Hi,
I hope you are doing well in pandemic. I am using your SRCountdownTimer in my fitness app.
I am stating countdownTimer in the viewdidLoad. countdownTimer.start(beginingValue: 10, interval: 1) First time it's working perfectly. When timer reach to 0 then after I reset timer using your method. I implemented in the SRCountdownTimer.swift file as per your instruction (pull request). Now I am calling countdownTimer.start(beginingValue: 60, interval: 1) after reset then animation is not starting.

What is the problem ? Countdown is not again stating in your code. Please provide me solution as soon as possible.

Reset Trail Line

There is no reset property for circular progressView. How to achieve to reset trail line ?

Set Time Label without needing to start the timer

It will be useful have to have the possibility to display the inner label when initializing the Countdown timer without starting it. Something like this:

public func initialize(beginingValue: Int, interval: TimeInterval = 1) {
        self.beginingValue = beginingValue
        self.interval = interval
        totalTime = TimeInterval(beginingValue) * interval
        elapsedTime = 0
        timer?.invalidate()
        currentCounterValue = beginingValue
        setNeedsDisplay()
    }

Invalid `Podfile` file

Hi.

I'm getting the following error:
Invalid Podfile file: No such file or directory - SRCountdownTimer.
I tried with pod SRCountdownTimer`` and pod 'SRCountdownTimer'

Support for fractions of a second

Feature request

Fractions of a second displayed instead of just int

For example, 1.2, 1.3, etc

I may try and work on this if I have time but not sure if author better understood it

timerDidEnd Function not working

I added the timerDidEnd function to my Viewcontroller but it doesn't seem run.

    func timerDidEnd(sender: SRCountdownTimer, elapsedTime: TimeInterval) {
        print("ended")
    }
  

Timer Label not showing

Hi! First of all thanks sharing your pod to the open source community.

I was playing around with some Countdown Pods to integrate one into my app which Is already live in the stores.

Unfortunately im not able to see the timer label in the circle. Any help would be appreciated.
I can see the Label in the view hierarchy but it has no frame and so its not visible ..
Cheers.

`class CountdownViewController: UIViewController, SRCountdownTimerDelegate {

private var countdownView: CountdownView {
    return view as! CountdownView
}

// MARK: - View Lifecycle
override func loadView() {
    view = CountdownView()
}

override func viewDidLoad() {
    super.viewDidLoad()

    countdownView.countdownTimer.delegate = self
    countdownView.countdownTimer.start(beginingValue: 5, interval: 1)
}

// MARK: - SRCountdowntimer Delegate

func timerDidUpdateCounterValue(sender: SRCountdownTimer, newValue: Int) {
    print(newValue)
}

func timerDidStart(sender: SRCountdownTimer) {
    print("Start")
}

func timerDidEnd(sender: SRCountdownTimer, elapsedTime: TimeInterval) {
    print("End")
}

}`

`class CountdownView: UIView {

public let countdownTimer: SRCountdownTimer = {
    let timer = SRCountdownTimer()
    timer.translatesAutoresizingMaskIntoConstraints = false
    timer.backgroundColor = .white
    timer.lineColor = .systemGreen
    timer.labelTextColor = .black
    timer.isLabelHidden = false
    timer.labelFont = .systemFont(ofSize: 30)
    timer.timerFinishingText = "Finish"
    return timer
}()

// MARK: - Object Lifecycle

override init(frame: CGRect) {
    super.init(frame: frame)

    backgroundColor = .white
    addSubview(countdownTimer)

    setupConstraints()
}

required init?(coder: NSCoder) {
    fatalError("init(coder:) not supported!")
}

// MARK: - Layout

private func setupConstraints() {

    // Timer
    NSLayoutConstraint.activate([countdownTimer.centerYAnchor.constraint(equalTo: centerYAnchor),
                                 countdownTimer.centerXAnchor.constraint(equalTo: centerXAnchor),
                                 countdownTimer.heightAnchor.constraint(equalToConstant: 300),
                                 countdownTimer.widthAnchor.constraint(equalToConstant: 300)])

}

}`

not work on iOS 9

The start function does not work on iOS 9.
What would be the correct way to make it work in iOS 9 or higher?

ios9_
ios9

I need to show timer as rectangular

Hi team,
I need to show an rectangular timer with loading progress bar.

Where can I changed the code please help me, I have an requirement ASAP.

Circle Not completeing

Circle does not fill the ring in these scenarios

    countdownTimer.start(beginingValue: 2, interval: 1)

or
countdownTimer.start(beginingValue: 2, interval: 0.2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.