I'm using DateComponentsFormatter
to achieve something like that: "1 hour, 30 min". This is my code for that:
let formatter = DateComponentsFormatter()
formatter.unitsStyle = .short
formatter.allowedUnits = [.hour, .minute]
return formatter.string(from: 90)!
This should return 1 hour and 30 minutes but my output is "1 min". Is something wrong with my code or is it iOS bug?