Get the model of your iOS device using Xamarin.iOS
On several Xamarin.iOS projects I needed a way to find the current iOS device model the app was running on so put together a handy class. I ended up pushing the code to GitHub and been updating it since 2014 as new devices become available. Jim Bennett mentioned a nuget package would be helpful and submitted a pull request. How cool is that! We pushed the package yesterday and it’s now available on nuget.
Using the package is quite simple, just run:
then call Xamarin.iOS.DeviceHardware.Version for the hardware version (ex. iPhone5,3) or Xamarin.iOS.DeviceHardware.Model to return the model name (ex. iPhone 5C GSM).
Once again, thanks for the PR Jim!