I am aware (and have found several posts here on SO) that one cannot pass along any additional parameters for a selector. For example whenever someone taps on my image view, I have the following taking place:
imageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action:Selector("tapImage:")))
This works correctly, and many solutions say that if you wish to pass a parameter, simply assign the tag of the view to something, and then reference that as the sender within the tapImage function. The thing is i'm actually using the tag value for something else, so would need to somehow store another value somewhere else.
What are some recommended ways I can pass a true/false (or 0/1) value into my TapGestureRecognizer action "tapImage" such that I can evaluate an expression? I also need to pass a collection of classes as well.
I think the only solution is to use a different selector in this case (for example "tapImageFunctionA" vs. "tapImageFunctionB" which is fine, but before I go this route is there another way? Even with this way, I would need to access a collection of objects. Maybe I set a global variable in the view controller and access it that way?
Thanks so much!