I've come across a bit of peculiarity, and I'm not sure why it's happening or how to deal with it.
let formatter = DateFormatter()
formatter.dateFormat = "h:mma"
let timeString = "8:00am"
let date = formatter.date(from: timeString)!
This code works if the user has their time set to use a 12 hour clock. If they have their device set to a 24 hour clock, it crashes.
How do I make make it work independent of the user's settings?