Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

count down timer swift stack overflow

var secondsRemaining = 60


Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(updateCounter), userInfo: nil, repeats: true)
}
@objc func updateCounter(){
    if secondsRemaining > 0 {
    print("(secondsRemaining) seconds.")
    secondsRemaining -= 1
            }
        }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #timer #swift #stack #overflow
ADD COMMENT
Topic
Name
3+8 =