swift - Altering Stepper values to work as time values? -


i want have stepper used add minutes timer. stepper outputs + or - 1 default, using *60 make minute, makes timer display total number of seconds in timer rather minutes. e.g. pressing twice reads 120 in time rather 02:00, how convert this?

@ibaction func reststeppervaluechanged(_ sender: uistepper) {     numberofrestlabel.text = int(sender.value).description     restcount = int(sender.value)*60     restremainingcountdownlabel.text = string(restcount) } 

this?

let seconds = restcount % 60 let minutes = (restcount / 60) % 60 let result = "\(minutes):\(seconds)" print(result) 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -