I'm not sure why Apple designs so many things in blocks... At least the problem in "PHAsset to UIImage" was able to be resolved due to a provided option. However, some of the other things I need are not provided by options.
For example:
func getAssetUrl(asset: PHAsset) -> NSURL {
var option = PHContentEditingInputRequestOptions()
asset.requestContentEditingInputWithOptions(option, completionHandler: {(contentEditingInput, info) -> Void in
var imageURL = contentEditingInput.fullSizeImageURL
println(imageURL)
})
return NSURL()
}
In these cases, I just want functions that take a block (such as requestContentEditingInputWithOptions to synchronically execute so I can return the imageURL). Is there any way to do this? (I've tried using some dispatch commands, but have not reached success yet).
Please note that I NEED to return the imageURL. Do not attempt to give me a solution in which I write stuff inside the block and don't return the imageURL.