Pergunta

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.

Foi útil?

Solução

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 
}

Outras dicas

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

}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top