How can I determine if iPhone is set for 12 hour or 24 hour time display?
Here’s the best way to do it: NSString *formatStringForHours = [NSDateFormatter dateFormatFromTemplate:@”j” options:0 locale:[NSLocale currentLocale]]; NSRange containsA = [formatStringForHours rangeOfString:@”a”]; BOOL hasAMPM = containsA.location != NSNotFound; in Swift: let formatString: NSString = NSDateFormatter.dateFormatFromTemplate(“j”, options: 0, locale: NSLocale.currentLocale())! let hasAMPM = formatString.containsString(“a”) Swift 4: let formatString = DateFormatter.dateFormat(fromTemplate: “j”, options: 0, locale: Locale.current)! let hasAMPM = … Read more