Skip to content

Commit

Permalink
Fixed TVOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Jun 21, 2016
1 parent a9f6c24 commit a3bdfc3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
7 changes: 3 additions & 4 deletions AsyncImageView/AsyncImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,12 @@ extern NSString *const AsyncImageErrorKey;
* that this value should bet set *before* setting the imageURL. Setting this
* value when loading is already in progress will cause the spinner to disappear.
*/
@property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorStyle;
@property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorStyle __TVOS_PROHIBITED;

/**
* The tint color for the UIActivityIndicator. Defaults to nil (no tint).
* The color for the UIActivityIndicator. Defaults to light grey.
*/
@property (nonatomic, strong, nullable) UIColor *activityIndicatorTintColor;

@property (nonatomic, strong, nullable) UIColor *activityIndicatorColor;

/**
* The crossfade animation duration, in seconds. If value is greater than 0, the
Expand Down
12 changes: 6 additions & 6 deletions AsyncImageView/AsyncImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,8 @@ @implementation AsyncImageView
- (void)setUp
{
self.showActivityIndicator = (self.image == nil);
self.activityIndicatorStyle = UIActivityIndicatorViewStyleGray;
self.activityIndicatorTintColor = nil;
self.activityIndicatorStyle = UIActivityIndicatorViewStyleWhite;
self.activityIndicatorColor = [UIColor lightGrayColor];
self.crossfadeDuration = 0.4;
}

Expand Down Expand Up @@ -640,7 +640,7 @@ - (void)setImageURL:(NSURL *)imageURL
if (self.activityView == nil)
{
self.activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorStyle];
self.activityView.tintColor = self.activityIndicatorTintColor;
self.activityView.color = self.activityIndicatorColor;
self.activityView.hidesWhenStopped = YES;
self.activityView.center = CGPointMake(self.bounds.size.width / 2.0, self.bounds.size.height / 2.0);
self.activityView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
Expand All @@ -657,10 +657,10 @@ - (void)setActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style
self.activityView = nil;
}

- (void)setActivityIndicatorTintColor:(UIColor *)activityIndicatorTintColor
- (void)setActivityIndicatorColor:(UIColor *)activityIndicatorColor
{
_activityIndicatorTintColor = activityIndicatorTintColor;
self.activityView.tintColor = activityIndicatorTintColor;
_activityIndicatorColor = activityIndicatorColor;
self.activityView.color = activityIndicatorColor;
}

- (void)setImage:(UIImage *)image
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Version 1.6
- Fixed warnings on latest Xcode
- Moved documentation into the header file
- Added nullability annotations
- Added activityIndicatorTintColor
- Added activityIndicatorColor
- Now supports loading @3x images

Version 1.5.1
Expand Down

0 comments on commit a3bdfc3

Please sign in to comment.