Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Change UI, Add present animation
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Wang committed Mar 16, 2016
1 parent 3f84b70 commit 407e5b3
Show file tree
Hide file tree
Showing 37 changed files with 1,302 additions and 200 deletions.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "onevcat/Kingfisher" "2.0.4"
github "onevcat/Kingfisher" "2.1.0"
13 changes: 13 additions & 0 deletions Carthage/Checkouts/Kingfisher/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

-----

## [2.1.0 - Prefetching](https://github.com/onevcat/Kingfisher/releases/tag/2.1.0) (2016-03-10)

#### Add
* Add `ImagePrefetcher` and related prefetching methods to allow downloading and caching images before you need to display them. [#249](https://github.com/onevcat/Kingfisher/pull/249)
* A protocol (`AuthenticationChallengeResponable`) for responsing authentication challenge. You can now set `authenticationChallengeResponder` of `ImageDownloader` and use your own authentication policy. [#226](https://github.com/onevcat/Kingfisher/issues/226)
* An API (`cachePathForKey(:)`) to get real path for a specified key in a cache. [#256](https://github.com/onevcat/Kingfisher/pull/256)

#### Fix
* Disable background decoding for images from memory cache. This improves the performance of image loading for in-memory cached images and fix a flicker when you try to load image with background decoding. [#257](https://github.com/onevcat/Kingfisher/pull/257)
* A potential crash in `ImageCache` when an empty image is passed into.

---

## [2.0.4 - Sorry Pipelining](https://github.com/onevcat/Kingfisher/releases/tag/2.0.4) (2016-02-27)

#### Fix
Expand Down
4 changes: 2 additions & 2 deletions Carthage/Checkouts/Kingfisher/Demo/Kingfisher-Demo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.4</string>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>543</string>
<string>567</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.4</string>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>543</string>
<string>567</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.4</string>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>543</string>
<string>567</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>2.0.4</string>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>543</string>
<string>567</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.4</string>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>543</string>
<string>567</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Kingfisher/Kingfisher.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "Kingfisher"
s.version = "2.0.4"
s.version = "2.1.0"
s.summary = "A lightweight and pure Swift implemented library for downloading and cacheing image from the web."

s.description = <<-DESC
Expand Down
50 changes: 34 additions & 16 deletions Carthage/Checkouts/Kingfisher/Kingfisher.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@
D1ED2D401AD2D09F00CFC3EB /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */; };
D1ED2D4C1AD2D09F00CFC3EB /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */; };
D1ED2D4D1AD2D09F00CFC3EB /* Kingfisher.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D9638BA01C7DBA660046523D /* ImagePrefetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9638B9F1C7DBA660046523D /* ImagePrefetcher.swift */; };
D9638BA11C7DBA660046523D /* ImagePrefetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9638B9F1C7DBA660046523D /* ImagePrefetcher.swift */; };
D9638BA21C7DBA660046523D /* ImagePrefetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9638B9F1C7DBA660046523D /* ImagePrefetcher.swift */; };
D9638BA31C7DBA660046523D /* ImagePrefetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9638B9F1C7DBA660046523D /* ImagePrefetcher.swift */; };
D9638BA61C7DC71F0046523D /* ImagePrefetcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9638BA41C7DC71F0046523D /* ImagePrefetcherTests.swift */; };
D9638BA71C7DCF560046523D /* ImagePrefetcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9638BA41C7DC71F0046523D /* ImagePrefetcherTests.swift */; };
D9638BA81C7DCF570046523D /* ImagePrefetcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9638BA41C7DC71F0046523D /* ImagePrefetcherTests.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -314,6 +321,8 @@
D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Kingfisher.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D1ED2D3F1AD2D09F00CFC3EB /* KingfisherTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KingfisherTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
D809C0611AAB7CA1AE240862 /* Pods-KingfisherTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KingfisherTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-KingfisherTests/Pods-KingfisherTests.debug.xcconfig"; sourceTree = "<group>"; };
D9638B9F1C7DBA660046523D /* ImagePrefetcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImagePrefetcher.swift; path = Sources/ImagePrefetcher.swift; sourceTree = "<group>"; };
D9638BA41C7DC71F0046523D /* ImagePrefetcherTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImagePrefetcherTests.swift; sourceTree = "<group>"; };
FE96DF45BEE5F8EBB01C7956 /* Pods-KingfisherTests-OSX.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KingfisherTests-OSX.release.xcconfig"; path = "Pods/Target Support Files/Pods-KingfisherTests-OSX/Pods-KingfisherTests-OSX.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -430,6 +439,7 @@
D10945EA1C526B6C001408EB /* Image.swift */,
D10945EB1C526B6C001408EB /* ImageCache.swift */,
D10945EC1C526B6C001408EB /* ImageDownloader.swift */,
D9638B9F1C7DBA660046523D /* ImagePrefetcher.swift */,
D10945ED1C526B6C001408EB /* ImageTransition.swift */,
D10945EE1C526B6C001408EB /* ImageView+Kingfisher.swift */,
D10945EF1C526B6C001408EB /* Info.plist */,
Expand Down Expand Up @@ -475,6 +485,7 @@
D12E0C451C47F23500AC98AD /* ImageCacheTests.swift */,
D12E0C461C47F23500AC98AD /* ImageDownloaderTests.swift */,
D12E0C471C47F23500AC98AD /* ImageExtensionTests.swift */,
D9638BA41C7DC71F0046523D /* ImagePrefetcherTests.swift */,
D12E0C481C47F23500AC98AD /* ImageViewExtensionTests.swift */,
D12E0C4A1C47F23500AC98AD /* KingfisherManagerTests.swift */,
D12E0C4B1C47F23500AC98AD /* KingfisherOptionsInfoTests.swift */,
Expand Down Expand Up @@ -1252,6 +1263,7 @@
D109461F1C526C61001408EB /* KingfisherManager.swift in Sources */,
D10946201C526C61001408EB /* KingfisherOptionsInfo.swift in Sources */,
D10946211C526C61001408EB /* Resource.swift in Sources */,
D9638BA21C7DBA660046523D /* ImagePrefetcher.swift in Sources */,
D10946221C526C61001408EB /* String+MD5.swift in Sources */,
D10946231C526C61001408EB /* ThreadHelper.swift in Sources */,
);
Expand All @@ -1273,6 +1285,7 @@
D12E0C761C47F71700AC98AD /* KingfisherTestHelper.swift in Sources */,
D12E0C6E1C47F6FE00AC98AD /* ImageCacheTests.swift in Sources */,
D12E0C6F1C47F6FE00AC98AD /* ImageDownloaderTests.swift in Sources */,
D9638BA71C7DCF560046523D /* ImagePrefetcherTests.swift in Sources */,
D12E0C701C47F6FE00AC98AD /* ImageExtensionTests.swift in Sources */,
D12E0C711C47F6FE00AC98AD /* ImageViewExtensionTests.swift in Sources */,
D12E0C721C47F6FE00AC98AD /* KingfisherManagerTests.swift in Sources */,
Expand All @@ -1288,6 +1301,7 @@
D12E0C891C47F7B700AC98AD /* KingfisherTestHelper.swift in Sources */,
D12E0C821C47F7AF00AC98AD /* ImageCacheTests.swift in Sources */,
D12E0C831C47F7AF00AC98AD /* ImageDownloaderTests.swift in Sources */,
D9638BA81C7DCF570046523D /* ImagePrefetcherTests.swift in Sources */,
D12E0C841C47F7AF00AC98AD /* ImageExtensionTests.swift in Sources */,
D12E0C851C47F7AF00AC98AD /* ImageViewExtensionTests.swift in Sources */,
D12E0C861C47F7AF00AC98AD /* KingfisherManagerTests.swift in Sources */,
Expand Down Expand Up @@ -1316,6 +1330,7 @@
D10946121C526C0D001408EB /* ImageView+Kingfisher.swift in Sources */,
D10946131C526C0D001408EB /* KingfisherManager.swift in Sources */,
D10946141C526C0D001408EB /* KingfisherOptionsInfo.swift in Sources */,
D9638BA11C7DBA660046523D /* ImagePrefetcher.swift in Sources */,
D10946151C526C0D001408EB /* Resource.swift in Sources */,
D10946161C526C0D001408EB /* String+MD5.swift in Sources */,
D10946171C526C0D001408EB /* ThreadHelper.swift in Sources */,
Expand All @@ -1330,6 +1345,7 @@
D109462D1C526CF5001408EB /* ImageTransition.swift in Sources */,
D10946251C526CE8001408EB /* Image.swift in Sources */,
D10946261C526CE8001408EB /* ImageCache.swift in Sources */,
D9638BA31C7DBA660046523D /* ImagePrefetcher.swift in Sources */,
D10946271C526CE8001408EB /* ImageDownloader.swift in Sources */,
D10946281C526CE8001408EB /* KingfisherManager.swift in Sources */,
D10946291C526CE8001408EB /* KingfisherOptionsInfo.swift in Sources */,
Expand Down Expand Up @@ -1369,6 +1385,7 @@
D10945FB1C526B86001408EB /* ImageView+Kingfisher.swift in Sources */,
D10945FC1C526B86001408EB /* KingfisherManager.swift in Sources */,
D10945FD1C526B86001408EB /* KingfisherOptionsInfo.swift in Sources */,
D9638BA01C7DBA660046523D /* ImagePrefetcher.swift in Sources */,
D10945FE1C526B86001408EB /* Resource.swift in Sources */,
D10945FF1C526B86001408EB /* String+MD5.swift in Sources */,
D10946001C526B86001408EB /* ThreadHelper.swift in Sources */,
Expand All @@ -1383,6 +1400,7 @@
D12E0C571C47F23500AC98AD /* KingfisherTestHelper.swift in Sources */,
D12E0C581C47F23500AC98AD /* UIButtonExtensionTests.swift in Sources */,
D12E0C561C47F23500AC98AD /* KingfisherOptionsInfoTests.swift in Sources */,
D9638BA61C7DC71F0046523D /* ImagePrefetcherTests.swift in Sources */,
D12E0C551C47F23500AC98AD /* KingfisherManagerTests.swift in Sources */,
D12E0C511C47F23500AC98AD /* ImageDownloaderTests.swift in Sources */,
D12E0C521C47F23500AC98AD /* ImageExtensionTests.swift in Sources */,
Expand Down Expand Up @@ -1485,11 +1503,11 @@
buildSettings = {
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 543;
CURRENT_PROJECT_VERSION = 567;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 543;
DYLIB_CURRENT_VERSION = 567;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -1511,11 +1529,11 @@
buildSettings = {
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 543;
CURRENT_PROJECT_VERSION = 567;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 543;
DYLIB_CURRENT_VERSION = 567;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -1677,11 +1695,11 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 543;
CURRENT_PROJECT_VERSION = 567;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 543;
DYLIB_CURRENT_VERSION = 567;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Sources/Info.plist;
Expand All @@ -1704,11 +1722,11 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 543;
CURRENT_PROJECT_VERSION = 567;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 543;
DYLIB_CURRENT_VERSION = 567;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Sources/Info.plist;
Expand All @@ -1729,11 +1747,11 @@
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CURRENT_PROJECT_VERSION = 543;
CURRENT_PROJECT_VERSION = 567;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 543;
DYLIB_CURRENT_VERSION = 567;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Sources/Info.plist;
Expand All @@ -1754,11 +1772,11 @@
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CURRENT_PROJECT_VERSION = 543;
CURRENT_PROJECT_VERSION = 567;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 543;
DYLIB_CURRENT_VERSION = 567;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Sources/Info.plist;
Expand Down Expand Up @@ -1961,10 +1979,10 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 543;
CURRENT_PROJECT_VERSION = 567;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 543;
DYLIB_CURRENT_VERSION = 567;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Sources/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -1985,10 +2003,10 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 543;
CURRENT_PROJECT_VERSION = 567;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 543;
DYLIB_CURRENT_VERSION = 567;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Sources/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down
33 changes: 29 additions & 4 deletions Carthage/Checkouts/Kingfisher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@

<a href="http://cocoadocs.org/docsets/Kingfisher"><img src="https://img.shields.io/cocoapods/p/Kingfisher.svg?style=flat"></a>

<a href="https://codebeat.co/projects/github-com-onevcat-kingfisher"><img alt="codebeat" src="https://codebeat.co/badges/30b4386d-46e5-46ee-bcc6-251158bb5ef7" /></a>

<img src="https://img.shields.io/badge/made%20with-%3C3-orange.svg">


</p>

Kingfisher is a lightweight and pure Swift implemented library for downloading and caching image from the web. This project is heavily inspired by the popular [SDWebImage](https://github.com/rs/SDWebImage). And it provides you a chance to use pure Swift alternative in your next app.
Expand All @@ -31,6 +34,7 @@ Kingfisher is a lightweight and pure Swift implemented library for downloading a
* Cache management. You can set the max duration or size the cache takes. From this, the cache will be cleaned automatically to prevent taking too many resources.
* Modern framework. Kingfisher uses `NSURLSession` and the latest technology of GCD, which makes it a strong and swift framework. It also provides you easy APIs to use.
* Cancelable processing task. You can cancel the downloading process if it is not needed anymore.
* Prefetching. You can prefetch and cache the images which might soon appear in the page. It will bring your users great experience.
* Independent components. You can use the downloader or caching system separately. Or even create your own cache based on Kingfisher's code.
* 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 an URL directly. Use the same code across all Apple platforms.
Expand Down Expand Up @@ -61,7 +65,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Kingfisher', '~> 2.0'
pod 'Kingfisher', '~> 2.1'
```

Then, run the following command:
Expand All @@ -86,7 +90,7 @@ $ brew install carthage
To integrate Kingfisher into your Xcode project using Carthage, specify it in your `Cartfile`:

``` ogdl
github "onevcat/Kingfisher" ~> 2.0
github "onevcat/Kingfisher" ~> 2.1
```

Then, run the following command to build the Kingfisher framework:
Expand Down Expand Up @@ -302,6 +306,29 @@ cache.clearDiskCache()
cache.cleanExpiredDiskCache()
```

### Prefetching

You could prefetch some images and cache them before you display them on the screen. This is useful when you know a list of image resources you know they would probably be shown later. Since the prefetched images are already in the cache system, there is no need to request them again when you really need to display them in a image view. It will boost your UI and bring your users great experience.

To prefetch some images, you could use the `ImagePrefetcher`:

```swift
let urls = ["http://example.com/image1.jpg", "http://example.com/image2.jpg"].map { NSURL(string: $0)! }
let prefetcher = ImagePrefetcher(urls: urls, optionsInfo: nil, progressBlock: nil, completionHandler: {
(skippedResources, failedResources, completedResources) -> () in
print("These resources are prefetched: \(completedResources)")
})
prefetcher.start()
```

You can also stop a prefetch whenever you need:

```swift
prefetcher.stop()
```

After prefetching, you could retrieve image or set the image view with other Kingfisher's methods, with the same `ImageCache` object you used for the prefetching.

## Future of Kingfisher

I want to keep Kingfisher slim. This framework will focus on providing a simple solution for image downloading and caching. But that does not mean the framework will not be improved. Kingfisher is far away from perfect, and necessary and useful features will be added later to make it better.
Expand All @@ -317,5 +344,3 @@ Follow and contact me on [Twitter](http://twitter.com/onevcat) or [Sina Weibo](h
## License

Kingfisher is released under the MIT license. See LICENSE for details.


7 changes: 5 additions & 2 deletions Carthage/Checkouts/Kingfisher/Sources/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,11 @@ extension Image {
// MARK: - PNG
func ImagePNGRepresentation(image: Image) -> NSData? {
#if os(OSX)
let rep = NSBitmapImageRep(CGImage: image.CGImage)
return rep.representationUsingType(.NSPNGFileType, properties:[:])
if let cgimage = image.CGImage {
let rep = NSBitmapImageRep(CGImage: cgimage)
return rep.representationUsingType(.NSPNGFileType, properties:[:])
}
return nil
#else
return UIImagePNGRepresentation(image)
#endif
Expand Down
Loading

0 comments on commit 407e5b3

Please sign in to comment.