Contents

Develop
2022.12.09 15:38

[swift] UIView에서 subview 찾기

조회 수 1806 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

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. Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

  2. [ios] @property의 속성 (strong, weak, copy) 사용 경우

  3. [c] 한글 문자열 출력

  4. [python][django] request.cookie 읽어오기 ㅋㅋㅋ (쓰기)

  5. [linux] CentOS 에 APM 설치하기

  6. [php] mysql_ 과 mysqli_ 의 차이

  7. CentOS 에서 Cacti 설치하기

  8. [ios] Xcode cannot run using the selected device

  9. [swift] UIView에서 subview 찾기

  10. 인증서 *.p12 파일을 *.pem 파일로 변환

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

  12. [mac] 맥에서 기본 실행 앱 변경하기

Board Pagination Prev 1 ... 13 14 15 16 17 18 19 20 21 22 ... 98 Next
/ 98