On iOS there is this nice feature that an app developer can specify device-specific resources or keys in Info.plist by tacking on a device-specific suffix to the base name of the resource or key. Currently we have ~ipad and ~iphone.
I would like to use the same system for some of my app’s registration domain user defaults that should have different values on the various devices. Do you know of a function or method in iOS that I can call to get the current device suffix? Although it is simple to code this myself, I prefer to use the system API whenever that is possible.
I don’t really care whether the system gives me ~ipad and ~iphone, the strings just need to be unique for each device. I also prefer something that is human readable, which is why I am not enthusiastic about using UIDevice.userInterfaceIdiom (that’s just a number). I also looked at UIDevice.model but I am unsure if this would be suitable.
Just in case there is no positive answer, this is how my implementation of the desired function looks: