Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- Refactoring
- ribs
- rxswift
- MVVM
- 스위프트
- uiscrollview
- 리펙토링
- collectionview
- Protocol
- HIG
- Human interface guide
- 클린 코드
- RxCocoa
- tableView
- swift documentation
- Clean Code
- Observable
- UICollectionView
- combine
- SWIFT
- 애니메이션
- Xcode
- 리팩토링
- map
- swiftUI
- ios
- uitableview
- clean architecture
- 리펙터링
- UITextView
Archives
- Today
- Total
김종권의 iOS 앱 개발 알아가기
[iOS - swift] throttle tap 커스텀 본문
커스텀 방법
- RxCocoa를 사용할 때 button.rx.tap -> button.rx.throttleTap으로 사용
// 상수 정의
struct Constants {
static let throttleDurationMilliseconds = 500
}
// 커스텀 throttle 정의
extension Reactive where Base: UIButton {
public var throttleTap: ControlEvent<Void> {
return ControlEvent(events: tap.throttle(.milliseconds(Constants.throttleDurationMilliseconds), latest: false, scheduler: MainScheduler.instance))
}
}
'iOS 응용 (swift)' 카테고리의 다른 글
Comments