0

I have a tableView didSelectRowAt method which I want to set a boolean variable with when a certain row is tapped. However the variable (showNext) is in a separate .h view controller. What would be the correct way of accessing this variable? And what imports do I need? Presumably the header itself?

Thanks!

EDIT: I don't think this is a duplicate as I am importing a .h file to a Swift file, however the other examples are obj-c only. I am unable to import the .h file as I have dependencies that must be compiled in C++, meaning putting them in the bridging header triggers compile time errors.

  • Is that Objective C ViewController whose property you want to changed, is it already loaded in your app? – Nirav D Feb 03 '17 at 12:33
  • Yes (I think). The table is in a popover table view controller from the main CameraViewController.mm screen. –  Feb 03 '17 at 12:36

1 Answers1

0

I think the correct way to solve your problem is using the delegate method. When your user taps the cell, you can delegate a function passing a parameter or whatever you want to your other class. If you don't know how to do that, here is an answer very well explained

Community
  • 1
  • 1
Ostanik
  • 104
  • 1
  • 5