Skip to content

Commit

Permalink
Change property from NSString to NSRunLoop
Browse files Browse the repository at this point in the history
"This should render the module compatible with Swift3.0, as well as improving the Objc type checking."

#147
  • Loading branch information
raphaelschaad committed Feb 28, 2021
1 parent 2708366 commit 77a6f81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions FLAnimatedImage/FLAnimatedImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ - (void)startAnimating
}
}

- (void)setRunLoopMode:(NSString *)runLoopMode
- (void)setRunLoopMode:(NSRunLoopMode)runLoopMode
{
if (![@[NSDefaultRunLoopMode, NSRunLoopCommonModes] containsObject:runLoopMode]) {
NSAssert(NO, @"Invalid run loop mode: %@", runLoopMode);
Expand Down Expand Up @@ -431,7 +431,7 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink
}
}

+ (NSString *)defaultRunLoopMode
+ (NSRunLoopMode)defaultRunLoopMode
{
// Key off `activeProcessorCount` (as opposed to `processorCount`) since the system could shut down cores in certain situations.
return [NSProcessInfo processInfo].activeProcessorCount > 1 ? NSRunLoopCommonModes : NSDefaultRunLoopMode;
Expand Down
2 changes: 1 addition & 1 deletion FLAnimatedImage/include/FLAnimatedImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@

// The animation runloop mode. Enables playback during scrolling by allowing timer events (i.e. animation) with NSRunLoopCommonModes.
// To keep scrolling smooth on single-core devices such as iPhone 3GS/4 and iPod Touch 4th gen, the default run loop mode is NSDefaultRunLoopMode. Otherwise, the default is NSDefaultRunLoopMode.
@property (nonatomic, copy) NSString *runLoopMode;
@property (nonatomic, copy) NSRunLoopMode runLoopMode;

@end

0 comments on commit 77a6f81

Please sign in to comment.