Develop
2022.12.09 15:38
[swift] UIView에서 subview 찾기
조회 수 5186 댓글 0
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 }
}
}
-
[ios] Objective-C 프로퍼티의 ATOMIC / NONATOMIC 속성
-
알고리즘 성능 분석 기준
-
[ios] Objective-C Types & Storage Capacity
-
[php] mysql_ 과 mysqli_ 의 차이
-
[ios] TextField 특정 문자만 사용하도록 하기
-
[ios] Xcode cannot run using the selected device
-
[coding] Find all anagrams in a string
-
[ubuntu] 우분투 18.04에 PHP5 설치하기
-
[c] 셀프 넘버(Self Number) 구하기
-
[ios] iOS앱의 Xcode 빌드 과정
-
[js] jQuery, Javascript 모바일(스마트폰) 판단하는 방법
-
[펌] 게임 엔진 만든거 공개합니다.