2015-04-08 01:28:38 +03:00
|
|
|
//
|
|
|
|
// UIButton+Rx.swift
|
|
|
|
// RxCocoa
|
|
|
|
//
|
|
|
|
// Created by Krunoslav Zaher on 3/28/15.
|
2015-12-29 18:56:21 +03:00
|
|
|
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
2015-04-08 01:28:38 +03:00
|
|
|
//
|
|
|
|
|
2015-11-08 17:29:49 +03:00
|
|
|
#if os(iOS)
|
2015-09-30 15:02:41 +03:00
|
|
|
|
2015-04-08 01:28:38 +03:00
|
|
|
import Foundation
|
2015-08-01 16:13:26 +03:00
|
|
|
#if !RX_NO_MODULE
|
2015-04-10 02:52:51 +03:00
|
|
|
import RxSwift
|
2015-08-01 16:13:26 +03:00
|
|
|
#endif
|
2015-05-17 20:07:24 +03:00
|
|
|
import UIKit
|
2015-04-08 01:28:38 +03:00
|
|
|
|
|
|
|
extension UIButton {
|
2015-08-29 22:20:44 +03:00
|
|
|
|
2015-09-09 12:29:39 +03:00
|
|
|
/**
|
|
|
|
Reactive wrapper for `TouchUpInside` control event.
|
|
|
|
*/
|
2015-08-29 22:20:44 +03:00
|
|
|
public var rx_tap: ControlEvent<Void> {
|
2015-12-21 05:02:24 +03:00
|
|
|
return rx_controlEvent(.TouchUpInside)
|
2015-04-08 01:28:38 +03:00
|
|
|
}
|
2015-08-29 22:20:44 +03:00
|
|
|
|
2015-09-30 15:02:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2015-11-08 17:29:49 +03:00
|
|
|
|
|
|
|
#if os(tvOS)
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
#if !RX_NO_MODULE
|
|
|
|
import RxSwift
|
|
|
|
#endif
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
extension UIButton {
|
|
|
|
|
|
|
|
/**
|
|
|
|
Reactive wrapper for `PrimaryActionTriggered` control event.
|
|
|
|
*/
|
2015-11-10 01:06:37 +03:00
|
|
|
public var rx_primaryAction: ControlEvent<Void> {
|
2015-12-21 05:02:24 +03:00
|
|
|
return rx_controlEvent(.PrimaryActionTriggered)
|
2015-11-08 17:29:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|