mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-09 04:46:35 +10:00
use requestImageDataForAsset in PickPhotos
This commit is contained in:
@@ -91,12 +91,13 @@ class PickPhotosViewController: UICollectionViewController, PHPhotoLibraryChange
|
||||
|
||||
//println("targetSize: \(targetSize)")
|
||||
|
||||
imageManager.requestImageForAsset(imageAsset, targetSize: targetSize, contentMode: .AspectFill, options: options) { image, info in
|
||||
if let image = image {
|
||||
//println("image.size: \(image.size)")
|
||||
images.append(image)
|
||||
imageManager.requestImageDataForAsset(imageAsset, options: options, resultHandler: { (data, String, imageOrientation, _) -> Void in
|
||||
if let data = data, image = UIImage(data: data) {
|
||||
if let image = image.resizeToSize(targetSize, withInterpolationQuality: .Medium) {
|
||||
images.append(image)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
completion?(images: images, imageAssets: pickedImageAssets)
|
||||
|
||||
@@ -305,7 +305,7 @@ extension MoreMessageTypesView: UITableViewDataSource, UITableViewDelegate {
|
||||
targetSize = CGSize(width: width, height: height)
|
||||
}
|
||||
|
||||
println("targetSize: \(targetSize)")
|
||||
//println("targetSize: \(targetSize)")
|
||||
|
||||
imageManager.requestImageDataForAsset(imageAsset, options: options, resultHandler: { (data, String, imageOrientation, _) -> Void in
|
||||
if let data = data, image = UIImage(data: data) {
|
||||
@@ -314,15 +314,6 @@ extension MoreMessageTypesView: UITableViewDataSource, UITableViewDelegate {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// imageManager.requestImageForAsset(imageAsset, targetSize: targetSize, contentMode: .AspectFill, options: options) { image, info in
|
||||
// if let image = image {
|
||||
// //if let image = image?.resizeToSize(targetSize, withInterpolationQuality: .Medium) {
|
||||
// println("image.size: \(image.size), scale: \(image.scale), \(image.imageOrientation.rawValue)")
|
||||
// println("info: \(info)")
|
||||
// images.append(image)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
for (index, image) in images.enumerate() {
|
||||
|
||||
Reference in New Issue
Block a user