동적으로 버튼을 생성해야 할 경우, selector를 미리 선언해줘야 하기 때문에 이벤트를 추가하는데 어려움이 있을 수 있습니다. 이를 위해 AssociatedObject 를 이용하여 UIButton에 closure를 추가하는 방법에 대해 정리해 보았습니다. 아래는 AssociatedObject에 대해 간단히 정리한 내용입니다~ 👇👇👇 [swift] AssociatedObject AssociatedObject에 대해 간단히 정리해 보았습니다!! AssociatedObject는 런타임시 기존 클래스에 SubClassing 없이 사용자 정의 속성을 연결(추가) 할 수 있습니다. 아래는 AssociatedObject 관련 함수입니다. /.. jintaewoo.tistory.com 다음 예제는 UIButton을..
AssociatedObject에 대해 간단히 정리해 보았습니다!! AssociatedObject는 런타임시 기존 클래스에 SubClassing 없이 사용자 정의 속성을 연결(추가) 할 수 있습니다. 아래는 AssociatedObject 관련 함수입니다. // 객체에 속성 값을 연결 public func objc_setAssociatedObject(_ object: Any, _ key: UnsafeRawPointer, _ value: Any?, _ policy: objc_AssociationPolicy) // 연결된 속성 값을 반환 public func objc_getAssociatedObject(_ object: Any, _ key: UnsafeRawPointer) -> Any? // 객체에 연결된 모든..
- Total
- Today
- Yesterday
- UIBarButtonItem
- database
- UIControl
- customAlertView
- permission error
- RECORDING
- pagingView
- HLS
- m3u8
- Cleancode
- Realm
- TDD
- BaseViewController
- CollectionView
- AVKit
- Design Pattern
- xib
- Coordinator
- ssh
- AssociatedObject
- testing
- NIB
- Video
- IOS
- http live streaming
- Closure
- AVFoundation
- carousel
- UIButton
- Swift
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |