iOS Format String into minutes and seconds

You should use DateComponentsFormatter if the duration is intended to be user-facing:

let formatter = DateComponentsFormatter()
formatter.allowedUnits = [ .minute, .second ]
formatter.zeroFormattingBehavior = [ .pad ]
let formattedDuration = formatter.string(from: duration)!

Assuming the duration value is really the duration in seconds, then you can calculate the number of minutes and seconds and then format those into a string.

int duration = ... // some duration from the JSON
int minutes = duration / 60;
int seconds = duration % 60;

NSString *time = [NSString stringWithFormat:@"%d:%02d", minutes, seconds];