0

I do not use the storyboard. I write it with code only.

I would like to know how to tap collectionviewcell to make a transition.

Overlap of view of project is as follows.

/*Color of each view

VC (green)

baseTableV (red)

UItableViewCell

HogeUIView (gray)

tableV (blue)

UItableViewCell

orangeView(orange)

baseColle (purple)

Page0Cell (yellow)

tableV (gray)

UItableViewCell //I want to tap this cell to make a transition. But I can not.

*/

I will ask about that can not be transitioned by tapping.

I would like to see. Please. Thanks.

5
  • Can you show your VC code? Commented Nov 24, 2018 at 14:12
  • I'm sorry, since I have written the source code in various files, I can not put them all here. I'd like to ask if you can transition by using uiVC? .navigationController?
    – user9444799
    Commented Nov 25, 2018 at 6:01
  • Just copy the VC code here as well. My guess is that you are not creating the VC instance for the collectionView. But cannot help without seeing that chunk of code Commented Nov 25, 2018 at 11:48
  • Thank you you are very kind. I wrote the source code. I am in embarrassment for several months with this unresolved part. I want you to see it.
    – user9444799
    Commented Nov 25, 2018 at 15:36
  • Man that's a difficult code to read. Anyway. You have omitted all the dataSource code for the table views and the collection views. Please don't omit things so your code can be understood. Commented Nov 25, 2018 at 19:57

1 Answer 1

0

You are just missing one instance of the VC. In your OrangeView class add this:

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCell(withReuseIdentifier: ColleCellId0, for: indexPath) as? Page0Cell
    cell?.vc = vc
    return cell!
}

However, I wouldn't do it like this. I would prefer to use delegates. Here is and example of how you could it.

https://github.com/galots/test1126-master

I marked all the delegate code that you need to add with // HERE // so you can find them easily. Good luck

1
  • I was able to move. It solved it. Anyway I learned a lot. I am relieved to solve what I did not know for several months. Thank you very much Galo.
    – user9444799
    Commented Nov 27, 2018 at 1:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.