Răsfoiți Sursa

Merge branch 'master' into 5.0

# Conflicts:
#	Kingfisher.xcodeproj/project.pbxproj
#	Sources/Image.swift
#	Sources/ImageCache.swift
#	Sources/Views/Indicator.swift
onevcat 7 ani în urmă
părinte
comite
c6ec05e724

+ 8 - 0
CHANGELOG.md

@@ -2,6 +2,14 @@
 
 -----
 
+## [4.10.1 - Time Machine](https://github.com/onevcat/Kingfisher/releases/tag/4.10.1) (2018-11-03)
+
+#### Fix
+* Add Swift 4 compatibility back.
+* Increase watchOS target to 3.0 in podspec.
+
+---
+
 ## [4.10.0 - Swift 4.2](https://github.com/onevcat/Kingfisher/releases/tag/4.10.0) (2018-09-20)
 
 #### Add

+ 1 - 1
Kingfisher.podspec

@@ -1,7 +1,7 @@
 Pod::Spec.new do |s|
 
   s.name         = "Kingfisher"
-  s.version      = "4.10.0"
+  s.version      = "4.10.1"
   s.summary      = "A lightweight and pure Swift implemented library for downloading and cacheing image from the web."
 
   s.description  = <<-DESC

+ 2 - 2
Sources/Info.plist

@@ -15,11 +15,11 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>4.10.0</string>
+	<string>4.10.1</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>1343</string>
+	<string>1354</string>
 	<key>NSPrincipalClass</key>
 	<string></string>
 </dict>

+ 15 - 0
Sources/Views/AnimatedImageView.swift

@@ -108,6 +108,7 @@ open class AnimatedImageView: UIImageView {
     public var needsPrescaling = true
     
     /// The animation timer's run loop mode. Default is `NSRunLoopCommonModes`. Set this property to `NSDefaultRunLoopMode` will make the animation pause during UIScrollView scrolling.
+    #if swift(>=4.2)
     public var runLoopMode = RunLoop.Mode.common {
         willSet {
             if runLoopMode == newValue {
@@ -120,6 +121,20 @@ open class AnimatedImageView: UIImageView {
             }
         }
     }
+    #else
+    public var runLoopMode = RunLoopMode.commonModes {
+        willSet {
+            if runLoopMode == newValue {
+                return
+            } else {
+                stopAnimating()
+                displayLink.remove(from: .main, forMode: runLoopMode)
+                displayLink.add(to: .main, forMode: newValue)
+                startAnimating()
+            }
+        }
+    }
+    #endif
 
     /// The repeat count.
     public var repeatCount = RepeatCount.infinite {

+ 2 - 2
Tests/KingfisherTests-macOS/Info.plist

@@ -15,10 +15,10 @@
 	<key>CFBundlePackageType</key>
 	<string>BNDL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>4.10.0</string>
+	<string>4.10.1</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>1343</string>
+	<string>1354</string>
 </dict>
 </plist>

+ 2 - 2
Tests/KingfisherTests-tvOS/Info.plist

@@ -15,10 +15,10 @@
 	<key>CFBundlePackageType</key>
 	<string>BNDL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>4.10.0</string>
+	<string>4.10.1</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>1343</string>
+	<string>1354</string>
 </dict>
 </plist>

+ 2 - 2
Tests/KingfisherTests/Info.plist

@@ -15,10 +15,10 @@
 	<key>CFBundlePackageType</key>
 	<string>BNDL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>4.10.0</string>
+	<string>4.10.1</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>1343</string>
+	<string>1354</string>
 </dict>
 </plist>