Sunday 15 May 2011

ios - requestImageDataForAsset result handler improperly formatted -



ios - requestImageDataForAsset result handler improperly formatted -

i trying request total image phasset.

my code follows

@ibaction func nexttap(sender: anyobject) { asset in _selectedassets { phimagemanager.defaultmanager().requestimagedataforasset(asset, options: nil) { imagedata,datauti,orientation,info in { println("worked") } } } }

i getting error though:

i have read documentation on phone call (https://developer.apple.com/library/ios/documentation/photos/reference/phimagemanager_class/index.html#//apple_ref/occ/instm/phimagemanager/requestimagedataforasset:options:resulthandler:)

and have, think, followed trailing syntax closure required, , set in appropriate parameters.

i watched wwdc 2014 video on well.

cannot seem work total image.

if want smaller sized image, used 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 works.

so im not sure doing wrong in fist phone call love insight in how request total size image phasset and/or whats wrong syntax in first code block.

thanks

update: here error message

"cannot invoke 'println()' argument list type of '(phasset, options:nilliteralconvertible, (($t6, ($t6,$t7,$t8,($t6,$t7,$t8)...."

it turns out brackets after 'in' screw up.

removing brackets fixed problem

for asset in _selectedassets { phimagemanager.defaultmanager().requestimagedataforasset(asset, options: nil) { imagedata,datauti,orientation,info in println("worked") } }

ios xcode swift uiimage phasset

No comments:

Post a Comment