mirror of
https://github.com/ReactiveX/RxSwift.git
synced 2024-10-05 06:27:29 +03:00
49 lines
756 B
Swift
49 lines
756 B
Swift
//
|
|
// UIButton+Rx.swift
|
|
// RxCocoa
|
|
//
|
|
// Created by Krunoslav Zaher on 3/28/15.
|
|
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
|
//
|
|
|
|
#if os(iOS)
|
|
|
|
import Foundation
|
|
#if !RX_NO_MODULE
|
|
import RxSwift
|
|
#endif
|
|
import UIKit
|
|
|
|
extension UIButton {
|
|
|
|
/**
|
|
Reactive wrapper for `TouchUpInside` control event.
|
|
*/
|
|
public var rx_tap: ControlEvent<Void> {
|
|
return rx_controlEvent(.TouchUpInside)
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#if os(tvOS)
|
|
|
|
import Foundation
|
|
#if !RX_NO_MODULE
|
|
import RxSwift
|
|
#endif
|
|
import UIKit
|
|
|
|
extension UIButton {
|
|
|
|
/**
|
|
Reactive wrapper for `PrimaryActionTriggered` control event.
|
|
*/
|
|
public var rx_primaryAction: ControlEvent<Void> {
|
|
return rx_controlEvent(.PrimaryActionTriggered)
|
|
}
|
|
}
|
|
|
|
#endif
|