From eb172d4852bc55cc0176967d87050b61b7c353c6 Mon Sep 17 00:00:00 2001 From: Brendan Lee Date: Fri, 10 Mar 2017 19:56:19 -0500 Subject: [PATCH] Modify didSelectItem to prevent searchController deactivation from affecting selected gif --- Library/SwiftyGiphyViewController.swift | 4 +++- SwiftyGiphy.podspec | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/SwiftyGiphyViewController.swift b/Library/SwiftyGiphyViewController.swift index eae5078..5b194e3 100644 --- a/Library/SwiftyGiphyViewController.swift +++ b/Library/SwiftyGiphyViewController.swift @@ -357,8 +357,10 @@ extension SwiftyGiphyViewController: UICollectionViewDelegate { public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { collectionView.deselectItem(at: indexPath, animated: false) + let selectedGif = currentGifs![indexPath.row] + searchController.isActive = false - delegate?.giphyControllerDidSelectGif(controller: self, item: currentGifs![indexPath.row]) + delegate?.giphyControllerDidSelectGif(controller: self, item: selectedGif) } } diff --git a/SwiftyGiphy.podspec b/SwiftyGiphy.podspec index 2964149..f0bad4b 100644 --- a/SwiftyGiphy.podspec +++ b/SwiftyGiphy.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'SwiftyGiphy' - s.version = '1.0.3' + s.version = '1.0.4' s.summary = 'Provides a UI and API layer for Giphy discovery and integration.' # This description is used to generate tags and improve search results.