Question

I try to access to the text of my UILabels in subviews

for (UIView *myView in recognizer.view.subviews) {
     ...
            }

How can I check the text of my UILabels found in this research?

Thanks

Was it helpful?

Solution

Try:

for (UIView *myView in recognizer.view.subviews) {
    if([myView isKindOfClass: [UILabel class]]){
        //check ur Label text here
        UILabel * myLabel = (UILabel *) myView;
        if ([myLabel.text isEqualToString: @"Your String"])
        {
            //GO For Ur Logic Here
        }
    } 
}

Hope it helps you.. happy coding :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top