Contents

Develop
2022.12.09 15:38

[swift] UIView에서 subview 찾기

Views 5186 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

UIView에서 하위의 subviews 찾아서 배열을 리턴


import UIKit


extension UIView

{

    func findSubViews<T: UIView>(classOf: T.Type) -> [T] {

        return recursiveSubviews.compactMap { $0 as? T }

    }

    

    var recursiveSubviews: [UIView] {

        return subviews + subviews.flatMap { $0.recursiveSubviews }

    }

}






?

  1. [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Objective-C)

  2. 알고리즘 성능분석

  3. [c#]뉴 툴바 개인적으로 만든거.. (old)

  4. [ios] CoreData 사용하기 (튜토리얼)

  5. [java] netty (비동기 이벤트 방식 네트워크 프레임워크) 사용법 #1 (server)

  6. [swift] popToRoot 모달뷰, 네비게이션컨트롤러 한꺼번에 닫기

  7. [ios] Swift 4 String, Date, DateFormatter 예제

  8. [js] Click button copy to clipboard

  9. [iOS] Xcode 불필요한 캐시 삭제하기

  10. [ios] 유용한 매크로

  11. [ios] UIWebView 캐쉬 삭제

  12. [android] 딜레이를 구현하기 위한 꼼수

Board Pagination Prev 1 ... 7 8 9 10 11 12 13 14 15 16 ... 71 Next
/ 71