Kaynağa Gözat

Merge branch 'master' into swift3

# Conflicts:
#	Demo/Kingfisher-Demo/ViewController.swift
onevcat 9 yıl önce
ebeveyn
işleme
4f07b6ad0d

+ 0 - 10
.swiftlint.yml

@@ -1,10 +0,0 @@
-disabled_rules:
-  - trailing_whitespace
-  - line_length
-  - variable_name
-  - file_length
-  - function_body_length
-  - opening_brace
-  - type_body_length
-  - valid_docs
-  - function_parameter_count

+ 26 - 0
CHANGELOG.md

@@ -2,6 +2,32 @@
 
 -----
 
+## [2.4.2 - Optional Welcome](https://github.com/onevcat/Kingfisher/releases/tag/2.4.2) (2016-07-10)
+
+#### Add
+* Accept `nil` as valid URL parameter for image view's extension methods.
+
+#### Fix
+* The completion handler of image view setting method will not be called any more if `self` is released.
+* Improve empty task so some performance improvment could be achieved.
+* Remove SwiftLint since it keeps adding new rules but without a back compatible support. It makes the users confusing when using a different version of SwiftLint.
+* Removed Implicit Unwrapping of CacheType that caused crashes if the image is not cached.
+
+---
+
+## [2.4.2 - Optional Welcome](https://github.com/onevcat/Kingfisher/releases/tag/2.4.2) (2016-07-10)
+
+#### Add
+* Accept `nil` as valid URL parameter for image view's extension methods.
+
+#### Fix
+* The completion handler of image view setting method will not be called any more if `self` is released.
+* Improve empty task so some performance improvment could be achieved.
+* Remove SwiftLint since it keeps adding new rules but without a back compatible support. It makes the users confusing when using a different version of SwiftLint.
+* Removed Implicit Unwrapping of CacheType that caused crashes if the image is not cached.
+
+---
+
 ## [2.4.1 - Force Transition](https://github.com/onevcat/Kingfisher/releases/tag/2.4.1) (2016-05-10)
 
 #### Add

+ 2 - 2
Demo/Kingfisher-Demo/Info.plist

@@ -15,11 +15,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.4.1</string>
+	<string>2.4.2</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>635</string>
+	<string>655</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>UILaunchStoryboardName</key>

+ 0 - 2
Demo/Kingfisher-Demo/ViewController.swift

@@ -57,12 +57,10 @@ extension ViewController {
     
     override func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {        
         // This will cancel all unfinished downloading task when the cell disappearing.
-        // swiftlint:disable force_cast
         (cell as! CollectionViewCell).cellImageView.kf_cancelDownloadTask()
     }
     
     override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        // swiftlint:disable force_cast
         let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "collectionViewCell", for: indexPath) as! CollectionViewCell
         
         cell.cellImageView.kf_showIndicatorWhenLoading = true

+ 2 - 2
Demo/Kingfisher-OSX-Demo/Info.plist

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.4.1</string>
+	<string>2.4.2</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>635</string>
+	<string>655</string>
 	<key>LSMinimumSystemVersion</key>
 	<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
 	<key>NSHumanReadableCopyright</key>

+ 2 - 2
Demo/Kingfisher-tvOS-Demo/Info.plist

@@ -15,11 +15,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.4.1</string>
+	<string>2.4.2</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>635</string>
+	<string>655</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>UIMainStoryboardFile</key>

+ 2 - 2
Demo/Kingfisher-watchOS-Demo Extension/Info.plist

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.4.1</string>
+	<string>2.4.2</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>635</string>
+	<string>655</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionAttributes</key>

+ 2 - 2
Demo/Kingfisher-watchOS-Demo/Info.plist

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.4.1</string>
+	<string>2.4.2</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>635</string>
+	<string>655</string>
 	<key>UISupportedInterfaceOrientations</key>
 	<array>
 		<string>UIInterfaceOrientationPortrait</string>

+ 1 - 1
Kingfisher.podspec

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

+ 16 - 58
Kingfisher.xcodeproj/project.pbxproj

@@ -679,7 +679,6 @@
 				4B2944441C3D01B20088C3E7 /* Frameworks */,
 				4B2944451C3D01B20088C3E7 /* Headers */,
 				4B2944461C3D01B20088C3E7 /* Resources */,
-				4B37667A1C4789C50001443F /* ShellScript */,
 			);
 			buildRules = (
 			);
@@ -776,7 +775,6 @@
 				D13F49D21BEDA67C00CE335D /* Frameworks */,
 				D13F49D31BEDA67C00CE335D /* Headers */,
 				D13F49D41BEDA67C00CE335D /* Resources */,
-				4B3766791C4789BC0001443F /* ShellScript */,
 			);
 			buildRules = (
 			);
@@ -870,7 +868,6 @@
 				D1ED2D311AD2D09F00CFC3EB /* Frameworks */,
 				D1ED2D321AD2D09F00CFC3EB /* Headers */,
 				D1ED2D331AD2D09F00CFC3EB /* Resources */,
-				D1249CF91C12B01E002C62D8 /* ShellScript */,
 			);
 			buildRules = (
 			);
@@ -1131,32 +1128,6 @@
 			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-KingfisherTests-OSX/Pods-KingfisherTests-OSX-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		4B3766791C4789BC0001443F /* ShellScript */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"SwiftLint does not exist, download from https://github.com/realm/SwiftLint\"\nfi";
-		};
-		4B37667A1C4789C50001443F /* ShellScript */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"SwiftLint does not exist, download from https://github.com/realm/SwiftLint\"\nfi";
-		};
 		5A0400F84A1FF7DBA809925E /* Copy Pods Resources */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -1232,19 +1203,6 @@
 			shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n    cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n    exit 1\nfi\n";
 			showEnvVarsInLog = 0;
 		};
-		D1249CF91C12B01E002C62D8 /* ShellScript */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"SwiftLint does not exist, download from https://github.com/realm/SwiftLint\"\nfi";
-		};
 		EAAF497C7455E9C8698B3136 /* Copy Pods Resources */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -1520,11 +1478,11 @@
 				APPLICATION_EXTENSION_API_ONLY = YES;
 				CODE_SIGN_IDENTITY = "";
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 635;
+				CURRENT_PROJECT_VERSION = 655;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEFINES_MODULE = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 635;
+				DYLIB_CURRENT_VERSION = 655;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				FRAMEWORK_VERSION = A;
 				GCC_NO_COMMON_BLOCKS = YES;
@@ -1547,11 +1505,11 @@
 				APPLICATION_EXTENSION_API_ONLY = YES;
 				CODE_SIGN_IDENTITY = "";
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 635;
+				CURRENT_PROJECT_VERSION = 655;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEFINES_MODULE = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 635;
+				DYLIB_CURRENT_VERSION = 655;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				FRAMEWORK_VERSION = A;
 				GCC_NO_COMMON_BLOCKS = YES;
@@ -1719,11 +1677,11 @@
 				APPLICATION_EXTENSION_API_ONLY = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 635;
+				CURRENT_PROJECT_VERSION = 655;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEFINES_MODULE = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 635;
+				DYLIB_CURRENT_VERSION = 655;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				GCC_NO_COMMON_BLOCKS = YES;
 				INFOPLIST_FILE = Sources/Info.plist;
@@ -1747,11 +1705,11 @@
 				APPLICATION_EXTENSION_API_ONLY = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 635;
+				CURRENT_PROJECT_VERSION = 655;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEFINES_MODULE = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 635;
+				DYLIB_CURRENT_VERSION = 655;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				GCC_NO_COMMON_BLOCKS = YES;
 				INFOPLIST_FILE = Sources/Info.plist;
@@ -1773,11 +1731,11 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				APPLICATION_EXTENSION_API_ONLY = YES;
-				CURRENT_PROJECT_VERSION = 635;
+				CURRENT_PROJECT_VERSION = 655;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEFINES_MODULE = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 635;
+				DYLIB_CURRENT_VERSION = 655;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				GCC_NO_COMMON_BLOCKS = YES;
 				INFOPLIST_FILE = Sources/Info.plist;
@@ -1798,11 +1756,11 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				APPLICATION_EXTENSION_API_ONLY = YES;
-				CURRENT_PROJECT_VERSION = 635;
+				CURRENT_PROJECT_VERSION = 655;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEFINES_MODULE = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 635;
+				DYLIB_CURRENT_VERSION = 655;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				GCC_NO_COMMON_BLOCKS = YES;
 				INFOPLIST_FILE = Sources/Info.plist;
@@ -2011,10 +1969,10 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 635;
+				CURRENT_PROJECT_VERSION = 655;
 				DEFINES_MODULE = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 635;
+				DYLIB_CURRENT_VERSION = 655;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				INFOPLIST_FILE = Sources/Info.plist;
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -2037,10 +1995,10 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 635;
+				CURRENT_PROJECT_VERSION = 655;
 				DEFINES_MODULE = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 635;
+				DYLIB_CURRENT_VERSION = 655;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				INFOPLIST_FILE = Sources/Info.plist;
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";

+ 4 - 0
README.md

@@ -39,6 +39,7 @@ Kingfisher is a lightweight and pure Swift implemented library for downloading a
 * Options to decompress the image in background before rendering it, which could improve the UI performance.
 * Categories over `UIImageView`, `NSImage` and `UIButton` for setting image from a URL directly. Use the same code across all Apple platforms.
 * Support GIF seamlessly. You could just download and set your GIF images as the same as you do for PNG/JPEG format using `AnimatedImageView`.
+* You could set `Activity Indicator` for your UIImageView or NSImageView to enable the indicator during loading image from web.
 
 ## Requirements
 
@@ -49,6 +50,9 @@ If you are upgrading to Kingfisher 2.x from 1.x, please read the [Kingfisher 2.0
 
 Kingfisher is now supporting Swift 2.2. If you need to use Kingfisher in Swift 2.1, you need to pin the version to 2.1.0.
 
+### Swift 3
+
+Kingfisher is now supporting Swift 3 in the [swift3](https://github.com/onevcat/Kingfisher/tree/swift3) branch. It is now under development and not be officially released yet. You could specify to that branch if you are working in a Swift 3 project. However, please reconsider if you want to use it in a releasing orientation product, since more breaking change would be applied later.
 
 ## Installation
 

+ 2 - 2
Sources/Info.plist

@@ -15,11 +15,11 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.4.1</string>
+	<string>2.4.2</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>635</string>
+	<string>655</string>
 	<key>NSPrincipalClass</key>
 	<string></string>
 </dict>

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

@@ -15,10 +15,10 @@
 	<key>CFBundlePackageType</key>
 	<string>BNDL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.4.1</string>
+	<string>2.4.2</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>635</string>
+	<string>655</string>
 </dict>
 </plist>

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

@@ -15,10 +15,10 @@
 	<key>CFBundlePackageType</key>
 	<string>BNDL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.4.1</string>
+	<string>2.4.2</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>635</string>
+	<string>655</string>
 </dict>
 </plist>

+ 2 - 2
Tests/KingfisherTests/Info.plist

@@ -15,10 +15,10 @@
 	<key>CFBundlePackageType</key>
 	<string>BNDL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.4.1</string>
+	<string>2.4.2</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>635</string>
+	<string>655</string>
 </dict>
 </plist>

+ 0 - 9
fastlane/Fastfile

@@ -15,13 +15,6 @@ platform :ios do
     scan(scheme: "Kingfisher-tvOS", clean: true)
   end
   
-  desc "Swift Lint"
-  lane :upgrade_swift_lint do
-      Actions.sh("brew update")
-      Actions.sh("brew remove swiftlint")
-      Actions.sh("brew install swiftlint")
-  end
-  
   desc "Build for Carthage"
   lane :carthage_lint do
       Actions.sh("cd .. && carthage build --no-skip-current && cd fastlane")
@@ -43,8 +36,6 @@ platform :ios do
       target_version = options[:version]
       raise "The version is missed. Use `fastlane release version:{version_number}`.`" if target_version.nil?
 
-      upgrade_swift_lint
-
       ensure_git_branch
       ensure_git_status_clean