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 |
Tags
- Human interface guide
- Observable
- UICollectionView
- 스위프트
- 클린 코드
- HIG
- RxCocoa
- rxswift
- Refactoring
- SWIFT
- MVVM
- map
- swiftUI
- ios
- 리펙터링
- 리팩토링
- collectionview
- clean architecture
- Xcode
- Clean Code
- UITextView
- Protocol
- 애니메이션
- combine
- ribs
- 리펙토링
- swift documentation
- uiscrollview
- uitableview
- tableView
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