Determine if UIView is visible to the user?

前端 未结 12 1805
不知归路
不知归路 2020-12-07 15:21

is it possible to determine whether my UIView is visible to the user or not?

My View is added as subview several times into a Tab Bar

12条回答
  •  爱一瞬间的悲伤
    2020-12-07 16:11

    In case you are using hidden property of view then :

    view.hidden (objective C) or view.isHidden(swift) is read/write property. So you can easily read or write

    For swift 3.0

    if(view.isHidden){
       print("Hidden")
    }else{
       print("visible")
    }
    

提交回复
热议问题