Skip to content

Commit

Permalink
Put iOS 13 specific APIs behind preprocessor checks
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasGessner committed Oct 12, 2019
1 parent 4bf2b29 commit 08d130d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@

#import "JGProgressHUDIndeterminateIndicatorView.h"

#ifndef __IPHONE_13_0
#define __IPHONE_13_0 130000
#endif

@implementation JGProgressHUDIndeterminateIndicatorView

- (instancetype)init {
UIActivityIndicatorView *activityIndicatorView;

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
if (@available(iOS 13, tvOS 13, *)) {
activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
}
Expand All @@ -22,6 +27,9 @@ - (instancetype)init {
activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
#pragma clang diagnostic pop
}
#else
activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
#endif

[activityIndicatorView startAnimating];

Expand Down

0 comments on commit 08d130d

Please sign in to comment.