Skip to content

Commit

Permalink
Added default request option.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangao0086 committed Dec 22, 2015
1 parent f4f9fa0 commit 328178e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion DKImageManager/DKImageManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,16 @@ public class DKImageManager: DKBaseManager {
}

public func fetchImageForAsset(asset: DKAsset, size: CGSize, completeBlock: (image: UIImage?) -> Void) {
let options = PHImageRequestOptions()
options.deliveryMode = .HighQualityFormat
self.fetchImageForAsset(asset, size: size, options: options, completeBlock: completeBlock)
}

public func fetchImageForAsset(asset: DKAsset, size: CGSize, options: PHImageRequestOptions, completeBlock: (image: UIImage?) -> Void) {
self.manager.requestImageForAsset(asset.originalAsset!,
targetSize: size,
contentMode: .AspectFill,
options: nil,
options: options,
resultHandler: { image, info in
completeBlock(image: image)
})
Expand Down

0 comments on commit 328178e

Please sign in to comment.