Comments (3)
That's a really good thing, but user can use our project and make this a utility in the user's project. Let's keep this here and see if people love it and then I'll include it. Since this may be useful for you but for all the people we need to see.
P.S. Thanks for taking your time and creating this PR :)
from deviceutil.
Some improvements:
+ (BOOL)hasNativeGPS {
switch ([self hardware]) {
// iPhones
case IPHONE_3G:
case IPHONE_3GS:
case IPHONE_4:
case IPHONE_4_CDMA:
case IPHONE_4S:
case IPHONE_5:
case IPHONE_5_CDMA_GSM:
case IPHONE_5C:
case IPHONE_5C_CDMA_GSM:
case IPHONE_5S:
case IPHONE_5S_CDMA_GSM:
case IPHONE_6:
case IPHONE_6_PLUS:
case IPHONE_6S:
case IPHONE_6S_PLUS:
case IPHONE_SE:
case IPHONE_7:
case IPHONE_7_PLUS:
// iPads
case IPAD_2:
case IPAD_2_CDMA:
case IPAD_3:
case IPAD_3_WIFI_CDMA:
case IPAD_3G:
case IPAD_4:
case IPAD_4_GSM_CDMA:
case IPAD_MINI_RETINA_WIFI_CDMA:
case IPAD_MINI_RETINA_WIFI_CELLULAR_CN:
case IPAD_MINI:
case IPAD_MINI_WIFI_CDMA:
case IPAD_MINI_3_WIFI_CELLULAR:
case IPAD_MINI_3_WIFI_CELLULAR_CN:
case IPAD_MINI_4_WIFI_CELLULAR:
case IPAD_AIR_WIFI_GSM:
case IPAD_AIR_WIFI_CDMA:
case IPAD_AIR_2_WIFI_CELLULAR:
case IPAD_PRO_97_WIFI_CELLULAR:
case IPAD_PRO_WIFI_CELLULAR:
return YES;
break;
case IPHONE_2G:
case IPOD_TOUCH_1G:
case IPOD_TOUCH_2G:
case IPOD_TOUCH_3G:
case IPOD_TOUCH_4G:
case IPOD_TOUCH_5G:
case IPOD_TOUCH_6G:
case IPAD:
case IPAD_2_WIFI:
case IPAD_3_WIFI:
case IPAD_4_WIFI:
case IPAD_MINI_WIFI:
case IPAD_MINI_3_WIFI:
case IPAD_MINI_4_WIFI:
case IPAD_MINI_RETINA_WIFI:
case IPAD_AIR_WIFI:
case IPAD_AIR_2_WIFI:
case IPAD_PRO_97_WIFI:
case IPAD_PRO_WIFI:
case SIMULATOR:
return NO;
break;
default:
// this is tricky!
NSLog(@"We have no information for your device's GPS capabilities listed in this category.");
NSLog(@"Your device is: %@", [self hardwareDescription]);
}
return YES;
}
from deviceutil.
Another update
+ (BOOL)hasNativeGPS {
switch ([DeviceUtil hardware]) {
//////////////
// iPhones
case IPHONE_3G:
case IPHONE_3GS:
case IPHONE_4:
case IPHONE_4_CDMA:
case IPHONE_4S:
case IPHONE_5:
case IPHONE_5_CDMA_GSM:
case IPHONE_5C:
case IPHONE_5C_CDMA_GSM:
case IPHONE_5S:
case IPHONE_5S_CDMA_GSM:
case IPHONE_6:
case IPHONE_6_PLUS:
case IPHONE_6S:
case IPHONE_6S_PLUS:
case IPHONE_SE:
case IPHONE_7:
case IPHONE_7_GSM:
case IPHONE_7_PLUS:
case IPHONE_7_PLUS_GSM:
case IPHONE_8:
case IPHONE_8_CN:
case IPHONE_8_PLUS:
case IPHONE_8_PLUS_CN:
case IPHONE_X:
case IPHONE_X_CN:
//////////////
// iPads
case IPAD_2:
case IPAD_2_CDMA:
case IPAD_3:
case IPAD_3G:
case IPAD_3_WIFI_CDMA:
case IPAD_4:
case IPAD_4_GSM_CDMA:
case IPAD_MINI:
case IPAD_MINI_WIFI_CDMA:
case IPAD_MINI_RETINA_WIFI_CDMA:
case IPAD_MINI_RETINA_WIFI_CELLULAR_CN:
case IPAD_MINI_3_WIFI_CELLULAR:
case IPAD_MINI_3_WIFI_CELLULAR_CN:
case IPAD_MINI_4_WIFI_CELLULAR:
case IPAD_AIR_WIFI_GSM:
case IPAD_AIR_WIFI_CDMA:
case IPAD_AIR_2_WIFI_CELLULAR:
case IPAD_PRO_97_WIFI_CELLULAR:
case IPAD_PRO_WIFI_CELLULAR:
case IPAD_PRO_2G_WIFI_CELLULAR:
case IPAD_PRO_105_WIFI_CELLULAR:
case IPAD_5_WIFI_CELLULAR:
return YES;
break;
//////////////
// devices without native GPS
case IPHONE_2G:
case IPOD_TOUCH_1G:
case IPOD_TOUCH_2G:
case IPOD_TOUCH_3G:
case IPOD_TOUCH_4G:
case IPOD_TOUCH_5G:
case IPOD_TOUCH_6G:
case IPAD:
case IPAD_2_WIFI:
case IPAD_3_WIFI:
case IPAD_4_WIFI:
case IPAD_5_WIFI:
case IPAD_MINI_WIFI:
case IPAD_MINI_3_WIFI:
case IPAD_MINI_4_WIFI:
case IPAD_MINI_RETINA_WIFI:
case IPAD_AIR_WIFI:
case IPAD_AIR_2_WIFI:
case IPAD_PRO_97_WIFI:
case IPAD_PRO_WIFI:
case IPAD_PRO_2G_WIFI:
case IPAD_PRO_105_WIFI:
case SIMULATOR:
return NO;
break;
default:
// this is tricky!
NSLog(@"We have no information for your device's GPS capabilities listed in this category.");
NSLog(@"Your device is: %@", [DeviceUtil hardwareDescription]);
break;
}
return YES;
}
from deviceutil.
Related Issues (20)
- New iPads 2017 HOT 8
- Need to add 11,1/11,3/11,5/11,7 (iPhone XS, XS Max or XR) devices HOT 4
- Add 2018 iPad pros ids: 8,1/8,2/8,3/8,4/8,5/8,6/8,7/8,8
- README.md HOT 1
- support arc HOT 1
- DEviceUtil.h without iPhone11_6 const
- Crash bug HOT 1
- new 2019 devices HOT 3
- Harware will never resolve to simulator HOT 3
- Need to add iPod7,1 and iPod9,1 HOT 1
- hardware method disappeared HOT 3
- Version in DeviceList.plist HOT 1
- Missing ipad device? HOT 2
- Expected identifier HOT 2
- Will there be a Cocoapod update that includes iPhone 12? HOT 3
- Support Apple Silicon Mac device identifiers? HOT 3
- iPad Air 4 models not listed
- Swift Package Manager support HOT 1
- iPad Air 4 models was added 14 Dec 2020. But last release in November 2020. HOT 1
- Add Objective-C examples to DeviceGuru? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deviceutil.