What does “% is unavailable: Use truncatingRemainder instead” mean?

后端 未结 5 594
Happy的楠姐
Happy的楠姐 2020-12-12 18:44

I get the following error when using code for an extension, I\'m not sure if they\'re asking to just use a different operator or modify the values in the expression based on

5条回答
  •  遥遥无期
    2020-12-12 19:15

    I found that the following works in Swift 3:

        let minutes = Int(floor(totalSeconds / 60))
        let seconds = Int(totalSeconds) % 60
    

    where totalSeconds is a TimeInterval (Double).

提交回复
热议问题