From 5c6ef596b064dfed94aeda1308354ae1735a237b Mon Sep 17 00:00:00 2001 From: haranicle Date: Tue, 3 May 2016 12:01:50 +0900 Subject: [PATCH] fix Crash when tapped moment cell --- NohanaImagePicker/MomentViewController.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/NohanaImagePicker/MomentViewController.swift b/NohanaImagePicker/MomentViewController.swift index 44d872c..d9f8921 100644 --- a/NohanaImagePicker/MomentViewController.swift +++ b/NohanaImagePicker/MomentViewController.swift @@ -120,6 +120,15 @@ class MomentViewController: AssetListViewController, ActivityIndicatable { return isLoading } + // MARK: - UICollectionViewDelegate + + override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { + guard let nohanaImagePickerController = nohanaImagePickerController else { + return + } + nohanaImagePickerController.delegate?.nohanaImagePicker?(nohanaImagePickerController, didSelectPhotoKitAsset: momentAlbumList[indexPath.section][indexPath.row].originalAsset) + } + // MARK: - Storyboard override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {