So I got a NSLog, which gets location of touch in view
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
for (UITouch *touch in touches)
{
CGPoint location=CGPointMake([touch locationInView:self.view].x,fabs(height-[touch locationInView:self.view].y));
NSLog(@"Touched:%f %f",location.x,location.y);
After That I check if the touch is in labels
if ([upgradeLabel containsPoint:location])
{ [self checkAvailable];
countUpgrade+=1;
if (countUpgrade%2==1)
{
upgradeLabel.fontColor=[SKColor greenColor];
[self upgradeButton:true];
}
else
{
upgradeLabel.fontColor=[SKColor redColor];
[self upgradeButton:false];
}
}
//-upgradeLabel
if ([dollarPerSecUp containsPoint:location])
{
up1=true;
up2=false;
up3=false;
up4=false;
up5=false;
[self checkUpgrades];
}
It got an output when I touch on upgradeLabel, but when I touch on dollarPerSecUp label there is no output and the code isn't working. User interaction enabled in both labels