swift - IOS Collection view cell first time click and removing selection when view appears -


i using collection view, after collection view loaded if click on cell first time, click not working.. if click on cell click working.. happening when collection loaded freshly.

i using navigation controller , loading anther view using following code:

let storyboard = uistoryboard(name: "storyboard", bundle: nil) let controller = storyboard.instantiateviewcontrollerwithidentifier("controllerid") as! uiviewcontroller self.navigationcontroller?.pushviewcontroller(controller, animated: true) 

if selected 1 cell , navigate next view, when coming collection view, selected element not getting deselect.. click not working on cell. working if click on cell , come , click on that.

once load data data source, should reloaddata of uicollectionview, first problem, couldn't select cell on first click.

for second problem, while came next view, item gets selected can not select again item, solution can deselect item while move first screen next view.

like this,

[collectionview deselectitematindexpath:indexpath animated:yes]; 

i happy if can more if required.

hope you.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -