How to determine the current iPhone/device model?

I made this “pure Swift” extension on UIDevice. If you are looking for a more elegant solution you can use my ยต-framework DeviceKit published on GitHub (also available via CocoaPods, Carthage and Swift Package Manager). Here’s the code: import UIKit public extension UIDevice { static let modelName: String = { var systemInfo = utsname() uname(&systemInfo) … Read more

What is the best way to deal with the NSDateFormatter locale “feechur”?

Duh!! Sometimes you have an “Aha!!” moment, sometimes it’s more of a “Duh!!” This is the latter. In the category for initWithSafeLocale the “super” init was coded as self = [super init];. This inits the SUPERCLASS of NSDateFormatter but does not init the NSDateFormatter object itself. Apparently when this initialization is skipped, setLocale “bounces off”, … Read more

Tableview to Tableview

You’ll want to embed these two TableViewControllers in a Navigation controller. You can do this in storyboard: Select the TableViewController with the first table in it In Xcode’s menu bar: Editor > Embed In > Navigation controller Create another TableViewController in the storyboard. Ctrl+Drag a storyboard segue from a TableViewCell on the first TableViewController to … Read more