Question

I want to put If condition on UIView. If the subView appears the button should be disabled. but i done know the syntax of how to put condition on UIView. I would be really thankful if any one can guide me. Thanks in advance.

Was it helpful?

Solution

If your view is appear means, your view is in view's hierarchy, that means, your view's window property will be not nil, you can check with this condition.

if (view.window != nil)
{
    //button disable 
}

OTHER TIPS

i think you want your condition based on subview so you have to use subview property of view like this:

 if(yourView.subviews.count>0)

{

your code for disable button

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