https://developer.apple.com/documentation/uikit/uiview/1622541-bringsubviewtofront

 

Apple Developer Documentation

 

developer.apple.com

 

쓰다보면 항상 헷갈려서 검색하게되어 글을 남겨본다

swift로 앱을 만들다보면 하나의 부모뷰에 여러 자식들이 들어가게 되는데

겹쳐있는 자식들중 하나를 맨앞으로 끌어오고싶을때 쓰는 메소드이다.

쓰는 방법은

부모뷰.bringSubviewToFront(맨앞으로 당길 자식뷰)

ex: https://www.hackingwithswift.com/example-code/uikit/how-to-bring-a-subview-to-the-front-of-a-uiview )

parentView.bringSubviewToFront(childView)

다음엔 잊지않기를 바란다

+ Recent posts