错误消息"'字符串?'不能转换为' String'"
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
**if(segue.identifier as String == "viewLargePhoto")**{
let controller:ViewPhoto = segue.destinationViewController as ViewPhoto
let indexPath: NSIndexPath = self.collectionView.indexPathForCell(sender as UICollectionViewCell)
controller.photoAsset = self.photoAsset
controller.assetCollection = self.assetCollection
错误消息:无法找到成员' AspectFill'
let asset: PHAsset = self.photoAsset[indexPath.item] as! PHAsset
PHImageManager.defaultManager().requestImageForAsset(asset, targetSize: PHImageManagerMaximumSize, contentMode: .AspectFill, options: nil,
resultHandler: {(result:UIImage!, info:NSDictionary!)in
cell.setThumbnailImage(result)
})
return cell
请帮助并谢谢
答案 0 :(得分:1)
尝试在info
函数中省略resultHandler
的显式类型声明。
为我工作。