Contents

Develop
2022.12.09 15:38

[swift] UIView에서 subview 찾기

Views 1743 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 }

    }

}






?

List of Articles
No. Category Subject Author Date Views
9 Develop [c#] Hashtable <-> Json (dll 포함) file hooni 2013.04.23 80652
8 Algorithm 디피헬만(Diffie-Hellman) 초간단 개념.. hooni 2013.04.23 81019
7 Develop 레고 마인드스톰 NXT 수도쿠, 큐브 소스코드.. 20 file hooni 2013.04.23 81408
6 Develop [android] 만화 어플 소스코드 file hooni 2013.04.23 92836
5 Develop [ios] Start developing your navigation app for CarPlay without enrollment file hooni 2020.02.22 124723
4 Etc 베지어 곡선 (Bezier curve) file hooni 2013.08.18 221099
3 Develop 자주 쓰는 Docker 명령어 alias hooni 2020.01.10 269326
2 Develop [ios] 언어, 지역, 국가 설정 가져오기 hooni 2014.05.12 269678
1 Develop [ios] 아이폰용 앱 오픈 소스들 hooni 2013.04.23 466763
Board Pagination Prev 1 ... 89 90 91 92 93 94 95 96 97 98 Next
/ 98