SKPhotoBrowser-Kingfisher
Usage
Example project
To run the example project, clone the repo, and run pod install
from the Example directory first. It includes sample code and unit tests.
Just like use SKPhoto
, we use KFPhoto
. Because SKPhotoBrowser use var photos: [SKPhotoProtocol]
, we can switch to KFPhoto
easily. Of course you can use your custom photo that comfirm SKPhotoProtocol
too.
// 1. default use SKPhoto
var images = [SKPhoto]()
for url in urls {
let photo = SKPhoto.photoWithImageURL(url)
photo.shouldCachePhotoURLImage = true // you can use image cache by true(NSCache)
images.append(photo)
}
// 2. use KFPhoto by SKPhotoBrowser-Kingfisher
var images = [KFPhoto]()
for (index, url) in urls.enumerated() {
let holder = ImageCache.default.retrieveImageInDiskCache(forKey: middlePics[index])
let photo = KFPhoto(url: url, holder: holder)
images.append(photo)
}
Installation
CocoaPods
SKPhotoBrowser-Kingfisher is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SKPhotoBrowser-Kingfisher"
Author
Ge Will
Mail: [email protected]
Home: https://gewill.org/
Twitter: @gewill_org
License
SKPhotoBrowser-Kingfisher is available under the MIT license. See the LICENSE file for more info.