How to add minutes to current time in swift

前端 未结 10 1363
天涯浪人
天涯浪人 2020-11-27 03:10

I am new to Swift and am trying a scheduler. I have the start time selected and I need to add 5 minutes (or multiples of it) to the start time and display it in an UILabel?<

10条回答
  •  醉话见心
    2020-11-27 03:31

    NSDate.init with timeIntervalSinceNow:
    Ex:

     let dateAfterMin = NSDate.init(timeIntervalSinceNow: (minutes * 60.0))
    

提交回复
热议问题