質問

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.

役に立ちましたか?

解決

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 
}

他のヒント

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

}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top