You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
629 B

5 years ago
  1. //
  2. // UIApplication+M13ProgressSuite.m
  3. // M13ProgressView
  4. //
  5. #import "UIApplication+M13ProgressSuite.h"
  6. @implementation UIApplication (M13ProgressSuite)
  7. + (BOOL)isM13AppExtension
  8. {
  9. return [[self class] safeM13SharedApplication] == nil;
  10. }
  11. + (UIApplication *)safeM13SharedApplication
  12. {
  13. UIApplication *safeSharedApplication = nil;
  14. if ([UIApplication respondsToSelector:@selector(sharedApplication)]) {
  15. safeSharedApplication = [UIApplication performSelector:@selector(sharedApplication)];
  16. }
  17. if (!safeSharedApplication.delegate) {
  18. safeSharedApplication = nil;
  19. }
  20. return safeSharedApplication;
  21. }
  22. @end