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
This is an update for
UIDeviceHardware.m
from the answer above.Adding to Arash's code, I don't care for my app what model I'm using, I just want to know what kind of device, so, I can test as follows:
You can use the
UIDevice
class like this:I know an answer has been ticked already, but for future reference, you could always use the device screen size to figure out which device it is like so:
How about this code, if new version was released, you will identifier with the last know device
Dutchie432
andBrian Robbins
have provided great solutions. But there's still one model missing, the Verizon iPhone 4. Here's the missing line.