Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardwareDescription needs update for iPad Air and iPad mini retina #5

Closed
cliffjoyce opened this issue Dec 2, 2013 · 5 comments
Closed

Comments

@cliffjoyce
Copy link

As per the accompanying NSLog statement, I am posting this comment...

When run on an iPad Air (hardware 'iPad4,2'), the hardwareDescription method returns an empty string. I assume that this code does not yet support iPad Air or mini with retina.

Here's code to support the new devices:

// support for iPad Air and mini retina
if ([hardware isEqualToString:@"iPad4,1"]) return @"iPad Air (WiFi)";
if ([hardware isEqualToString:@"iPad4,2"]) return @"iPad Air (GSM)";
if ([hardware isEqualToString:@"iPad4,3"]) return @"iPad Air (CDMA)";
if ([hardware isEqualToString:@"iPad4,4"]) return @"iPad Mini Retina (WiFi)"; // unconfirmed
if ([hardware isEqualToString:@"iPad4,5"]) return @"iPad Mini Retina (Cellular)"; // unconfirmed

Suggestion: instead of just returning an empty string for unknown devices, would it make sense to at least return the generic device type? In other words, since we know that the hardware is "iPad4,2" couldn't the hardwareDescription method return "iPad" in this case?

// return generic strings for unknown devices
if ([hardware hasPrefix:@"iPhone"]) return @"iPhone";
if ([hardware hasPrefix:@"iPod"]) return @"iPod";
if ([hardware hasPrefix:@"iPad"]) return @"iPad";

@InderKumarRathore
Copy link
Owner

Good suggestion, I'll make changes tonight probably.

@cliffjoyce
Copy link
Author

Thanks for the update. However, you are missing iPad4,3 "iPad Air (CDMA)". And iPad4.2 is actually "iPad Air (GSM)".

@InderKumarRathore
Copy link
Owner

Changed the things.. Please review it and let me know.

@cliffjoyce
Copy link
Author

Looks good now. Thanks!

@InderKumarRathore
Copy link
Owner

Great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants