Is there a way to determine the device running an application. I want to distinguish between iPhone
and iPod Touch
, if possible.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
I like Erica Sadun's stuff. She includes AppleTV devices and others you might not think of.
https://github.com/erica/uidevice-extension/blob/master/UIDevice-Hardware.h
The possible vales of
are
iPod touch
,iPhone
,iPhone Simulator
,iPad
,iPad Simulator
If you want to know which hardware
iOS
is ruining on likeiPhone3
,iPhone4
,iPhone5
etc below is the code for thatNOTE: The below code may not contain all device's string, I'm with other guys are maintaining the same code on GitHub so please take the latest code from there
Objective-C : GitHub/DeviceUtil
Swift : GitHub/DeviceGuru
To identifiy iPhone 4S, simply check the following:
Here's a minor update with new models: