RepositorySwift
RX

RxSwiftCommunity/RxGesture

RxSwift reactive wrapper for view gestures

1.4kstars
180forks
3issues
1views

🖱️ RxGesture: Gesture recognizer thành luồng RxSwift

RxGesture biến gesture recognizer thành Observable, subscribe như các sự kiện thường ngày.

RxGesture là thư viện RxSwift cộng đồng cung cấp wrapper reactive cho gesture recognizers trên iOS và macOS. Thay vì bắt sự kiện delegate phức tạp, bạn subscribe trựctiếp vào tap, swipe, pan, pinch, rotation... và nhận recognizer đã đầy đủ thông tin vị trí, dịch chuyển.

✨ Điểm nổi bật

  • Single gesture API: view.rx.tapGesture(), .panGesture(), .swipeGesture(.left)... trả về ControlEvent kiểu subclass tương ứng.
  • Multi-gesture API: view.rx.anyGesture(.tap(), .swipe([.up, .down])) gộp nhiều recognizer thành một stream.
  • Tuple filtering: anyGesture((.tap(), when: .recognized), (.pan(), when: .ended)) lọc state riêng cho từng recognizer.
  • State filtering: .when(.recognized), .when(.began, .changed, .ended) lọc theo trạng thái gesture.
  • Concrete type: rx.fooGesture() trả về subclass cụ thể, tránh cast trong subscribe.
  • Cross-platform: hỗ trợ gesture recognizers riêng cho iOS (UI*GestureRecognizer) và macOS (NS*GestureRecognizer).
  • Delegate policy: tùy chỉnh delegate method qua policy .always, .never, .custom.

💡 Vì sao đáng chú ý

RxGesture giải quyết pain point delegate-based gesture recognizers: boilerplate delegate code, state management thủ công, khó kết hợp nhiều gesture. Với RxSwift, mọi gesture trở thành Observable — dễ filter, combine, dispose. Phù hợp project đang dùng RxSwift cần xử lý gesture phức tạp như photo preview dismiss bằng tap hoặc swipe.


#RxSwift #Gesture #iOS #macOS #Swift #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositorySwift
aheze/SwipeActions

Add customizable swipe actions to any view.

1.3k
Dec 22, 2025
RepositoryRuby
iberianpig/fusuma

Multitouch gestures with libinput driver on Linux

3.9k
Jul 10, 2026
RepositoryTypeScript
BetterTyped/react-zoom-pan-pinch

🖼 React library to support easy zoom, pan, pinch on various html dom elements like <img> and <div>

2.0k
Oct 30, 2026
RepositorySwift
ReactiveX/RxSwift

Reactive Programming in Swift

24.6k
Nov 13, 2026
RepositorySwift
Moya/Moya

Network abstraction layer written in Swift.

15.4k
Jul 14, 2026
RepositorySwift
Finb/Bark

Bark is an iOS App which allows you to push custom notifications to your iPhone

9.6k
Nov 13, 2026
RepositorySwift
SwipeCellKit/SwipeCellKit

Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift.

6.3k
May 19, 2024
RepositorySwift
lanceylai/TSWeChat

A WeChat alternative. Written in Swift 5.

3.7k
Jul 28, 2019
RepositorySwift
khoren93/SwiftHub

GitHub iOS client in RxSwift and MVVM-C clean architecture

3.1k
Nov 13, 2026