Procházet zdrojové kódy

Merge branch 'master' of github.com:xspyhack/Kingfisher

alex.huo před 7 roky
rodič
revize
085f23245b

+ 2 - 0
Sources/Image/ImageDrawing.swift

@@ -539,6 +539,7 @@ extension KingfisherWrapper where Base: CGImage {
     ///   - targetSize: The target size in point.
     ///   - targetSize: The target size in point.
     ///   - contentMode: Content mode of output image should be.
     ///   - contentMode: Content mode of output image should be.
     /// - Returns: A CGImage with new size.
     /// - Returns: A CGImage with new size.
+    #if os(iOS) || os(tvOS)
     public func resize(to size: CGSize, for contentMode: UIView.ContentMode) -> CGImage {
     public func resize(to size: CGSize, for contentMode: UIView.ContentMode) -> CGImage {
         switch contentMode {
         switch contentMode {
         case .scaleAspectFit:
         case .scaleAspectFit:
@@ -549,6 +550,7 @@ extension KingfisherWrapper where Base: CGImage {
             return resize(to: size)
             return resize(to: size)
         }
         }
     }
     }
+    #endif
 
 
     // MARK: - Resize
     // MARK: - Resize
     /// Resizes `base` CGImage to a CGImage with new size.
     /// Resizes `base` CGImage to a CGImage with new size.

+ 4 - 4
Sources/Views/AnimatedImageView.swift

@@ -335,8 +335,8 @@ extension AnimatedImageView {
         //
         //
         // - parameter image: An optional `UIImage` instance to be assigned to the new frame.
         // - parameter image: An optional `UIImage` instance to be assigned to the new frame.
         // - returns: An `AnimatedFrame` instance.
         // - returns: An `AnimatedFrame` instance.
-        func makeAnimatedFrame(with newImage: UIImage?) -> AnimatedFrame {
-            return AnimatedFrame(image: newImage, duration: duration)
+        func makeAnimatedFrame(image: UIImage?) -> AnimatedFrame {
+            return AnimatedFrame(image: image, duration: duration)
         }
         }
     }
     }
 }
 }
@@ -475,7 +475,7 @@ extension AnimatedImageView {
                 animatedFrames += [AnimatedFrame(image: nil, duration: frameDuration)]
                 animatedFrames += [AnimatedFrame(image: nil, duration: frameDuration)]
 
 
                 if index > maxFrameCount { return }
                 if index > maxFrameCount { return }
-                animatedFrames[index] = animatedFrames[index].makeAnimatedFrame(with: loadFrame(at: index))
+                animatedFrames[index] = animatedFrames[index].makeAnimatedFrame(image: loadFrame(at: index))
             }
             }
 
 
             self.loopDuration = duration
             self.loopDuration = duration
@@ -510,7 +510,7 @@ extension AnimatedImageView {
             preloadIndexes(start: currentFrameIndex).forEach { index in
             preloadIndexes(start: currentFrameIndex).forEach { index in
                 let currentAnimatedFrame = animatedFrames[index]
                 let currentAnimatedFrame = animatedFrames[index]
                 if !currentAnimatedFrame.isPlaceholder { return }
                 if !currentAnimatedFrame.isPlaceholder { return }
-                animatedFrames[index] = currentAnimatedFrame.makeAnimatedFrame(with: loadFrame(at: index))
+                animatedFrames[index] = currentAnimatedFrame.makeAnimatedFrame(image: loadFrame(at: index))
             }
             }
         }
         }