Parsing command line arguments using UserDefaults
A really cool "hidden" feature of UserDefaults is that it contains any arguments that were passed to the app at launch!
Super useful both in Swift command line tools and scripts, but also to temporarily override a value when debugging iOS apps.
let defaults = UserDefaults.standard let query = defaults.string(forKey: "query") let resultCount = defaults.integer(forKey: "results")
Enter Manning’s September Showdown — a 30-day challenge that gives developers a chance to test their knowledge against their peers. A new trivia question, and a brand new prize to win, is published every day throughout September.