I have created a subclass of UIView in order to handle hitTest and Touches actions, as the UIView is a subview of a UIScrollview and I needed both the UIView and UIScrollView to be draggable.
I have got it 95% working - the subclassed UIView works perfectly if I jsut set a background colour - but if I set a subview with an image with transparanecy it doesn't always respond. I have some ideas on this so thats not the question.
My question is that as I have multiple instances of the subclassed UIView on the UIScrollview, how can i tell which one is dragged.
In a previous app I simply used;
if ([touch view] == blah) {
do something;
}
else if ([touch view] == fred) {
do nothing;
}
but as this sits in my main application .m file this was ok as blah and fred were both created there in viewdidload, but as the touch events in my code are captured in the subclass they don't know about blah and fred.
so 1) how do i let the subclass know about the items i've added - or -
2) how do i pass the name of the item through to the subclass in either hitTest or TouchesBegan - or -
3) is there a line of code to get the name of the current item
Any help much appreciated.
I have got it 95% working - the subclassed UIView works perfectly if I jsut set a background colour - but if I set a subview with an image with transparanecy it doesn't always respond. I have some ideas on this so thats not the question.
My question is that as I have multiple instances of the subclassed UIView on the UIScrollview, how can i tell which one is dragged.
In a previous app I simply used;
if ([touch view] == blah) {
do something;
}
else if ([touch view] == fred) {
do nothing;
}
but as this sits in my main application .m file this was ok as blah and fred were both created there in viewdidload, but as the touch events in my code are captured in the subclass they don't know about blah and fred.
so 1) how do i let the subclass know about the items i've added - or -
2) how do i pass the name of the item through to the subclass in either hitTest or TouchesBegan - or -
3) is there a line of code to get the name of the current item
Any help much appreciated.