diff options
Diffstat (limited to 'modules/expo-bluesky-gif-view/ios/GifView.swift')
-rw-r--r-- | modules/expo-bluesky-gif-view/ios/GifView.swift | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/modules/expo-bluesky-gif-view/ios/GifView.swift b/modules/expo-bluesky-gif-view/ios/GifView.swift index de722d7a6..b42a4735c 100644 --- a/modules/expo-bluesky-gif-view/ios/GifView.swift +++ b/modules/expo-bluesky-gif-view/ios/GifView.swift @@ -16,14 +16,14 @@ public class GifView: ExpoView, AVPlayerViewControllerDelegate { ) private var isPlaying = true private var isLoaded = false - + // Requests private var webpOperation: SDWebImageCombinedOperation? private var placeholderOperation: SDWebImageCombinedOperation? // Props - var source: String? = nil - var placeholderSource: String? = nil + var source: String? + var placeholderSource: String? var autoplay = true { didSet { if !autoplay { @@ -78,8 +78,7 @@ public class GifView: ExpoView, AVPlayerViewControllerDelegate { // See: // https://github.com/SDWebImage/SDWebImage/blob/master/Docs/HowToUse.md#using-asynchronous-image-caching-independently if !SDImageCache.shared.diskImageDataExists(withKey: source), - let url = URL(string: placeholderSource) - { + let url = URL(string: placeholderSource) { self.placeholderOperation = imageManager.loadImage( with: url, options: [.retryFailed], @@ -132,8 +131,7 @@ public class GifView: ExpoView, AVPlayerViewControllerDelegate { if let placeholderSource = self.placeholderSource, imageUrl?.absoluteString == placeholderSource, self.imageView.image == nil, - let image = image - { + let image = image { self.setImage(image) return } @@ -142,8 +140,7 @@ public class GifView: ExpoView, AVPlayerViewControllerDelegate { imageUrl?.absoluteString == source, // UIImage perf suckssss if the image is animated let data = data, - let animatedImage = SDAnimatedImage(data: data) - { + let animatedImage = SDAnimatedImage(data: data) { self.placeholderOperation?.cancel() self.isPlaying = self.autoplay self.isLoaded = true |