KWDeviceInfo.m 482 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // Licensed under the terms in License.txt
  3. //
  4. // Copyright 2010 Allen Ding. All rights reserved.
  5. //
  6. #import "KWDeviceInfo.h"
  7. #if TARGET_IPHONE_SIMULATOR
  8. #import <UIKit/UIKit.h>
  9. #endif // #if TARGET_IPHONE_SIMULATOR
  10. @implementation KWDeviceInfo
  11. #pragma mark - Getting the Device Type
  12. + (BOOL)isSimulator {
  13. #if TARGET_IPHONE_SIMULATOR
  14. return YES;
  15. #else
  16. return NO;
  17. #endif // #if TARGET_IPHONE_SIMULATOR
  18. }
  19. + (BOOL)isPhysical {
  20. return ![self isSimulator];
  21. }
  22. @end