I am trying to request the full image from a PHAsset.
My code is as follows
@IBAction func nextTap(sender: AnyObject)
{
for asset in _selectedAssets
{
PHImageManager.defaultManager().requestImageDataForAsset(asset, options: nil)
{
imageData,dataUTI,orientation,info in
{
println("worked")
}
}
}
}
I am getting this error though:
I have read the documentation on this call (https://developer.apple.com/library/IOs/documentation/Photos/Reference/PHImageManager_Class/index.html#//apple_ref/occ/instm/PHImageManager/requestImageDataForAsset:options:resultHandler:)
And I have, I think, followed the trailing syntax closure required, and put in the appropriate parameters.
I watched the WWDC 2014 video on this as well.
Cannot seem to get this to work for the full image.
If I want a smaller sized image, I used this code:
PHImageManager.defaultManager().requestImageForAsset(asset, targetSize:_cellSize, contentMode: .AspectFill, options: nil)
{
result, info in
if reuseCount == cell.reuseCount
{
cell.imageView.image = result
cell.imageView.frame = CGRectMake(0, 0,self._cellSize.width,self._cellSize.height)
}
}
And this works.
So Im not sure what I am doing wrong in my fist call but would love some insight in to how to request a full size image from a PHAsset and/or whats wrong with my syntax in the first code block.
Thanks
Update: Here is the error message
"Cannot invoke 'println()' with an argument list type of '(PHAsset, options:NilLiteralConvertible, (($T6, ($T6,$T7,$T8,($T6,$T7,$T8)...."
It turns out the brackets after the 'in' screw everything up.
Removing those brackets fixed the problem
for asset in _selectedAssets
{
PHImageManager.defaultManager().requestImageDataForAsset(asset, options: nil)
{
imageData,dataUTI,orientation,info in
println("worked")
}
}