No, I want to know which device is being simulated using the existing device values.
Basically I want to write code for a specific device and see the results in the simulator. Getting a device type of simulator doesn't help me.
Thanks for your help.
No, I want to know which device is being simulated using the existing device values.
Basically I want to write code for a specific device and see the results in the simulator. Getting a device type of simulator doesn't help me.
Thanks for your help.
If you want to distinguish between different devices when you use simulator you can use UIDeviceModelInches enum to get different size of screen. There isn't a method to know perfectly which device the simulator run.
If you want to distinguish between different devices when you use simulator you can use UIDeviceModelInches enum to get different size of screen. There isn't a method to know perfectly which device the simulator run.
You might try something like this :
``` objc
switch ([[UIDevice currentDevice] deviceFamily]) {
case UIDeviceFamilyiPhone:
case UIDeviceFamilyiPod: {
switch ([[UIDevice currentDevice] deviceInches]) {
case UIDeviceModelInches35: {
break;
}
case UIDeviceModelInches4: {
break;
}
case UIDeviceModelInches47: {
break;
}
case UIDeviceModelInches55: {
break;
}
case UIDeviceModelInchesUnKnown:
default: {
break;
}
}
break;
}
case UIDeviceFamilyiPad: {
switch ([[UIDevice currentDevice] deviceInches]) {
case UIDeviceModelInches79: {
break;
}
case UIDeviceModelInches97: {
break;
}
case UIDeviceModelInches129: {
break;
}
case UIDeviceModelInchesUnKnown:
default: {
break;
}
}
break;
}
default: {
break;
}
}
```
If your using the simulator UIDeviceModelInches129 is never reached, UIDeviceModelInchesUnKnown is returned.
I can see that the x86_64 derived and condition is reached that determines if its a small screen or big screen.
Can this be improved in anyway?
I'm not likely to have any access to an iPad pro and I will have rely on the simulator.
Thanks in advance.
Hi,
If your using the simulator UIDeviceModelInches129 is never reached, UIDeviceModelInchesUnKnown is returned.
I can see that the x86_64 derived and condition is reached that determines if its a small screen or big screen.
Can this be improved in anyway?
I'm not likely to have any access to an iPad pro and I will have rely on the simulator.
Thanks in advance.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
It would be awesome the device model could be returned from the simulator rather that iPadSimulator etc.
You wish you could understand if the simulator is a specific device?
Thx
Giuseppe
No, I want to know which device is being simulated using the existing device values.
Basically I want to write code for a specific device and see the results in the simulator. Getting a device type of simulator doesn't help me.
Thanks for your help.
If you want to distinguish between different devices when you use simulator you can use UIDeviceModelInches enum to get different size of screen. There isn't a method to know perfectly which device the simulator run.
You might try something like this :
Oh right, is that part of your library?
Yes, you can copy and paste the code :)
Hi,
If your using the simulator UIDeviceModelInches129 is never reached, UIDeviceModelInchesUnKnown is returned.
I can see that the x86_64 derived and condition is reached that determines if its a small screen or big screen.
Can this be improved in anyway?
I'm not likely to have any access to an iPad pro and I will have rely on the simulator.
Thanks in advance.