From 77a6f815c84075bb78c03c1ccd7b0f9fd2df3cca Mon Sep 17 00:00:00 2001 From: Raphael Schaad Date: Sun, 28 Feb 2021 15:19:50 +0100 Subject: [PATCH] Change property from NSString to NSRunLoop "This should render the module compatible with Swift3.0, as well as improving the Objc type checking." https://github.com/Flipboard/FLAnimatedImage/pull/147 --- FLAnimatedImage/FLAnimatedImageView.m | 4 ++-- FLAnimatedImage/include/FLAnimatedImageView.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FLAnimatedImage/FLAnimatedImageView.m b/FLAnimatedImage/FLAnimatedImageView.m index f9102354..7a163c76 100755 --- a/FLAnimatedImage/FLAnimatedImageView.m +++ b/FLAnimatedImage/FLAnimatedImageView.m @@ -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); @@ -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; diff --git a/FLAnimatedImage/include/FLAnimatedImageView.h b/FLAnimatedImage/include/FLAnimatedImageView.h index 6c8dbaeb..8884e534 100644 --- a/FLAnimatedImage/include/FLAnimatedImageView.h +++ b/FLAnimatedImage/include/FLAnimatedImageView.h @@ -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