Contents

Develop
2022.12.09 15:38

[swift] UIView에서 subview 찾기

조회 수 1825 댓글 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. 인증서 *.p12 파일을 *.pem 파일로 변환

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

  3. CentOS 에서 Cacti 설치하기

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

  5. [php] mysql_ 과 mysqli_ 의 차이

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

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

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

  9. Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

  10. [ios] 동영상 플레이어 샘플 (for Remote Url)

  11. [web] 더 빠른 웹을 위한 프로토콜, 'HTTP/2'

  12. [ios] Locale Identifiers

Board Pagination Prev 1 ... 76 77 78 79 80 81 82 83 84 85 ... 98 Next
/ 98