ios - cellForItemAtIndexPath of collectionView is not called when I reload the cells from a method of another class(navigationviewcontroller) -
i have viewcontroller in implementing collection view. have set delegate , datasource of collection view inside viewdidload of viewcontroller.the action trying implement if click button on navigationbar(which implemented programatically in navigationviewc) should reload collectionview cells in viewcontroller.but if add action selector navigation bar button function in navigationviewcontroller reloads data of collection view not calling cellforitematindexpath method.can me please
you should add barbuttonitem in regular viewcontroller:
override func viewdidload() { super.viewdidload() navigationitem.rightbarbuttonitem = uibarbuttonitem(title: "reload", style: .plain, target: self, action: "reloadbuttontapped") } func reloadbuttontapped() { println("reload") }