Replaces `open` with `public`.

This commit is contained in:
Krunoslav Zaher 2016-08-16 22:10:41 +02:00
parent d43e717415
commit 6763f1a4b7
31 changed files with 133 additions and 126 deletions

View File

@ -1460,7 +1460,7 @@
C8093C701B8A72BE0088E94D /* CombineLatest+arity.tt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "CombineLatest+arity.tt"; sourceTree = "<group>"; };
C8093C711B8A72BE0088E94D /* CombineLatest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CombineLatest.swift; sourceTree = "<group>"; };
C8093C721B8A72BE0088E94D /* Concat.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Concat.swift; sourceTree = "<group>"; };
C8093C741B8A72BE0088E94D /* ConnectableObservable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectableObservable.swift; sourceTree = "<group>"; };
C8093C741B8A72BE0088E94D /* ConnectableObservable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ConnectableObservable.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
C8093C751B8A72BE0088E94D /* Debug.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Debug.swift; sourceTree = "<group>"; };
C8093C761B8A72BE0088E94D /* Deferred.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Deferred.swift; sourceTree = "<group>"; };
C8093C771B8A72BE0088E94D /* DelaySubscription.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DelaySubscription.swift; sourceTree = "<group>"; };
@ -1508,7 +1508,7 @@
C8093CAF1B8A72BE0088E94D /* Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Rx.swift; sourceTree = "<group>"; };
C8093CB01B8A72BE0088E94D /* RxMutableBox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxMutableBox.swift; sourceTree = "<group>"; };
C8093CB31B8A72BE0088E94D /* SchedulerType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SchedulerType.swift; sourceTree = "<group>"; };
C8093CB51B8A72BE0088E94D /* ConcurrentDispatchQueueScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConcurrentDispatchQueueScheduler.swift; sourceTree = "<group>"; };
C8093CB51B8A72BE0088E94D /* ConcurrentDispatchQueueScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ConcurrentDispatchQueueScheduler.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
C8093CB71B8A72BE0088E94D /* MainScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainScheduler.swift; sourceTree = "<group>"; };
C8093CB81B8A72BE0088E94D /* OperationQueueScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OperationQueueScheduler.swift; sourceTree = "<group>"; };
C8093CB91B8A72BE0088E94D /* RecursiveScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecursiveScheduler.swift; sourceTree = "<group>"; };
@ -1526,7 +1526,7 @@
C8093E861B8A732E0088E94D /* _RXKVOObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _RXKVOObserver.h; sourceTree = "<group>"; };
C8093E871B8A732E0088E94D /* _RXKVOObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _RXKVOObserver.m; sourceTree = "<group>"; };
C8093E8A1B8A732E0088E94D /* CLLocationManager+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CLLocationManager+Rx.swift"; sourceTree = "<group>"; };
C8093E8B1B8A732E0088E94D /* DelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DelegateProxy.swift; sourceTree = "<group>"; };
C8093E8B1B8A732E0088E94D /* DelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = DelegateProxy.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
C8093E8C1B8A732E0088E94D /* DelegateProxyType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DelegateProxyType.swift; sourceTree = "<group>"; };
C8093E8D1B8A732E0088E94D /* Logging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = "<group>"; };
C8093E901B8A732E0088E94D /* ControlTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlTarget.swift; sourceTree = "<group>"; };
@ -1718,7 +1718,7 @@
C8C3DA051B9393AC004D233E /* Empty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Empty.swift; sourceTree = "<group>"; };
C8C3DA081B93941E004D233E /* Error.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Error.swift; sourceTree = "<group>"; };
C8C3DA0B1B93959F004D233E /* Never.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Never.swift; sourceTree = "<group>"; };
C8C3DA0E1B939767004D233E /* CurrentThreadScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CurrentThreadScheduler.swift; sourceTree = "<group>"; };
C8C3DA0E1B939767004D233E /* CurrentThreadScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CurrentThreadScheduler.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
C8C3DA111B93A3EA004D233E /* AnonymousObservable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AnonymousObservable.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
C8C4B4A71C17722400828BD5 /* _RXObjCRuntime.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _RXObjCRuntime.m; sourceTree = "<group>"; };
C8C4B4A81C17722400828BD5 /* _RXObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _RXObjCRuntime.h; sourceTree = "<group>"; };

View File

@ -18,7 +18,7 @@ Observer that enforces interface binding rules:
`UIBindingObserver` doesn't retain target interface and in case owned interface element is released, element isn't bound.
*/
open class UIBindingObserver<UIElementType, Value> : ObserverType where UIElementType: AnyObject {
public class UIBindingObserver<UIElementType, Value> : ObserverType where UIElementType: AnyObject {
public typealias E = Value
weak var UIElement: UIElementType?
@ -36,7 +36,7 @@ open class UIBindingObserver<UIElementType, Value> : ObserverType where UIElemen
/**
Binds next element to owner view as described in `binding`.
*/
open func on(_ event: Event<Value>) {
public func on(_ event: Event<Value>) {
MainScheduler.ensureExecutingOnScheduler(errorMessage: "Element can be bound to user interface only on MainThread.")
switch event {
@ -56,7 +56,7 @@ open class UIBindingObserver<UIElementType, Value> : ObserverType where UIElemen
- returns: type erased observer.
*/
open func asObserver() -> AnyObserver<Value> {
public func asObserver() -> AnyObserver<Value> {
return AnyObserver(eventHandler: on)
}
}

View File

@ -85,7 +85,7 @@ open class DelegateProxy : _RXDelegateProxy {
- parameter selector: Selector used to filter observed invocations of delegate methods.
- returns: Observable sequence of arguments passed to `selector` method.
*/
open func observe(_ selector: Selector) -> Observable<[AnyObject]> {
public func observe(_ selector: Selector) -> Observable<[AnyObject]> {
if hasWiredImplementation(for: selector) {
print("Delegate proxy is already implementing `\(selector)`, a more performant way of registering might exist.")
}
@ -117,7 +117,7 @@ open class DelegateProxy : _RXDelegateProxy {
- returns: Associated object tag.
*/
open class func delegateAssociatedObjectTag() -> UnsafeRawPointer {
public class func delegateAssociatedObjectTag() -> UnsafeRawPointer {
return _pointer(&delegateAssociatedTag)
}
@ -126,7 +126,7 @@ open class DelegateProxy : _RXDelegateProxy {
- returns: Initialized instance of `self`.
*/
open class func createProxyForObject(_ object: AnyObject) -> AnyObject {
public class func createProxyForObject(_ object: AnyObject) -> AnyObject {
return self.init(parentObject: object)
}
@ -136,7 +136,7 @@ open class DelegateProxy : _RXDelegateProxy {
- parameter object: Object that can have assigned delegate proxy.
- returns: Assigned delegate proxy or `nil` if no delegate proxy is assigned.
*/
open class func assignedProxyFor(_ object: AnyObject) -> AnyObject? {
public class func assignedProxyFor(_ object: AnyObject) -> AnyObject? {
let maybeDelegate = objc_getAssociatedObject(object, self.delegateAssociatedObjectTag())
return castOptionalOrFatalError(maybeDelegate.map { $0 as AnyObject })
}
@ -147,7 +147,7 @@ open class DelegateProxy : _RXDelegateProxy {
- parameter object: Object that can have assigned delegate proxy.
- parameter proxy: Delegate proxy object to assign to `object`.
*/
open class func assignProxy(_ proxy: AnyObject, toObject object: AnyObject) {
public class func assignProxy(_ proxy: AnyObject, toObject object: AnyObject) {
precondition(proxy.isKind(of: self.classForCoder()))
objc_setAssociatedObject(object, self.delegateAssociatedObjectTag(), proxy, .OBJC_ASSOCIATION_RETAIN)
@ -160,7 +160,7 @@ open class DelegateProxy : _RXDelegateProxy {
- parameter forwardToDelegate: Reference of delegate that receives all messages through `self`.
- parameter retainDelegate: Should `self` retain `forwardToDelegate`.
*/
open func setForwardToDelegate(_ delegate: AnyObject?, retainDelegate: Bool) {
public func setForwardToDelegate(_ delegate: AnyObject?, retainDelegate: Bool) {
self._setForward(toDelegate: delegate, retainDelegate: retainDelegate)
}
@ -170,7 +170,7 @@ open class DelegateProxy : _RXDelegateProxy {
- returns: Value of reference if set or nil.
*/
open func forwardToDelegate() -> AnyObject? {
public func forwardToDelegate() -> AnyObject? {
return self._forwardToDelegate
}

View File

@ -191,6 +191,7 @@ extension DelegateProxyType {
if currentDelegate !== proxy {
proxy.setForwardToDelegate(currentDelegate, retainDelegate: false)
assert(proxy.forwardToDelegate() === currentDelegate)
Self.setCurrentDelegate(proxy, toObject: object)
assert(Self.currentDelegateFor(object) === proxy)
assert(proxy.forwardToDelegate() === currentDelegate)
@ -226,7 +227,7 @@ extension DelegateProxyType {
Self.setCurrentDelegate(nil, toObject: object)
Self.setCurrentDelegate(proxy, toObject: object)
assert(proxy.forwardToDelegate() === forwardDelegate, "Setting of delegate failed")
assert(proxy.forwardToDelegate() === forwardDelegate, "Setting of delegate failed:\ncurrent:\n\(proxy.forwardToDelegate())\nexpected:\n\(forwardDelegate)")
return Disposables.create {
MainScheduler.ensureExecutingOnScheduler()

View File

@ -10,7 +10,9 @@
#import "_RX.h"
#import "_RXObjCRuntime.h"
@interface _RXDelegateProxy ()
@interface _RXDelegateProxy () {
id __weak __forwardToDelegate;
}
@property (nonatomic, strong) id strongForwardDelegate;
@ -90,6 +92,10 @@ static NSMutableDictionary *forwardableSelectorsPerClass = nil;
}
-(id)_forwardToDelegate {
return __forwardToDelegate;
}
-(void)_setForwardToDelegate:(id)forwardToDelegate retainDelegate:(BOOL)retainDelegate {
__forwardToDelegate = forwardToDelegate;
if (retainDelegate) {

View File

@ -35,7 +35,7 @@ class CollectionViewDataSourceNotSet
/**
For more information take a look at `DelegateProxyType`.
*/
open class RxCollectionViewDataSourceProxy
public class RxCollectionViewDataSourceProxy
: DelegateProxy
, UICollectionViewDataSource
, DelegateProxyType {
@ -43,7 +43,7 @@ open class RxCollectionViewDataSourceProxy
/**
Typed parent object.
*/
open weak private(set) var collectionView: UICollectionView?
public weak private(set) var collectionView: UICollectionView?
private weak var _requiredMethodsDataSource: UICollectionViewDataSource? = collectionViewDataSourceNotSet
@ -62,14 +62,14 @@ open class RxCollectionViewDataSourceProxy
/**
Required delegate method implementation.
*/
open func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return (_requiredMethodsDataSource ?? collectionViewDataSourceNotSet).collectionView(collectionView, numberOfItemsInSection: section)
}
/**
Required delegate method implementation.
*/
open func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
return (_requiredMethodsDataSource ?? collectionViewDataSourceNotSet).collectionView(collectionView, cellForItemAt: indexPath)
}
@ -78,7 +78,7 @@ open class RxCollectionViewDataSourceProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
public override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
let collectionView = (object as! UICollectionView)
return castOrFatalError(collectionView.rx_createDataSourceProxy())
@ -87,14 +87,14 @@ open class RxCollectionViewDataSourceProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open override class func delegateAssociatedObjectTag() -> UnsafeRawPointer {
public override class func delegateAssociatedObjectTag() -> UnsafeRawPointer {
return _pointer(&dataSourceAssociatedTag)
}
/**
For more information take a look at `DelegateProxyType`.
*/
open class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
let collectionView: UICollectionView = castOrFatalError(object)
collectionView.dataSource = castOptionalOrFatalError(delegate)
}
@ -102,7 +102,7 @@ open class RxCollectionViewDataSourceProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
let collectionView: UICollectionView = castOrFatalError(object)
return collectionView.dataSource
}
@ -110,7 +110,7 @@ open class RxCollectionViewDataSourceProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open override func setForwardToDelegate(_ forwardToDelegate: AnyObject?, retainDelegate: Bool) {
public override func setForwardToDelegate(_ forwardToDelegate: AnyObject?, retainDelegate: Bool) {
let requiredMethodsDataSource: UICollectionViewDataSource? = castOptionalOrFatalError(forwardToDelegate)
_requiredMethodsDataSource = requiredMethodsDataSource ?? collectionViewDataSourceNotSet
super.setForwardToDelegate(forwardToDelegate, retainDelegate: retainDelegate)

View File

@ -17,7 +17,7 @@ import RxSwift
/**
For more information take a look at `DelegateProxyType`.
*/
open class RxCollectionViewDelegateProxy
public class RxCollectionViewDelegateProxy
: RxScrollViewDelegateProxy
, UICollectionViewDelegate
, UICollectionViewDelegateFlowLayout {
@ -25,7 +25,7 @@ open class RxCollectionViewDelegateProxy
/**
Typed parent object.
*/
open weak private(set) var collectionView: UICollectionView?
public weak private(set) var collectionView: UICollectionView?
/**
Initializes `RxCollectionViewDelegateProxy`

View File

@ -14,7 +14,7 @@
#endif
import UIKit
open class RxImagePickerDelegateProxy
public class RxImagePickerDelegateProxy
: DelegateProxy
, DelegateProxyType
, UIImagePickerControllerDelegate
@ -23,7 +23,7 @@ open class RxImagePickerDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
let imagePickerController: UIImagePickerController = castOrFatalError(object)
imagePickerController.delegate = castOptionalOrFatalError(delegate)
}
@ -31,7 +31,7 @@ open class RxImagePickerDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
let imagePickerController: UIImagePickerController = castOrFatalError(object)
return imagePickerController.delegate
}

View File

@ -14,7 +14,7 @@
#endif
import UIKit
open class RxPickerViewDelegateProxy
public class RxPickerViewDelegateProxy
: DelegateProxy
, DelegateProxyType
, UIPickerViewDelegate {
@ -22,7 +22,7 @@ open class RxPickerViewDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
let pickerView: UIPickerView = castOrFatalError(object)
pickerView.delegate = castOptionalOrFatalError(delegate)
}
@ -30,7 +30,7 @@ open class RxPickerViewDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
let pickerView: UIPickerView = castOrFatalError(object)
return pickerView.delegate
}

View File

@ -17,7 +17,7 @@ import UIKit
/**
For more information take a look at `DelegateProxyType`.
*/
open class RxScrollViewDelegateProxy
public class RxScrollViewDelegateProxy
: DelegateProxy
, UIScrollViewDelegate
, DelegateProxyType {
@ -27,7 +27,7 @@ open class RxScrollViewDelegateProxy
/**
Typed parent object.
*/
open weak fileprivate(set) var scrollView: UIScrollView?
public weak fileprivate(set) var scrollView: UIScrollView?
/**
Optimized version used for observing content offset changes.
@ -57,7 +57,7 @@ open class RxScrollViewDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open func scrollViewDidScroll(_ scrollView: UIScrollView) {
public func scrollViewDidScroll(_ scrollView: UIScrollView) {
if let contentOffset = _contentOffsetSubject {
contentOffset.on(.next(scrollView.contentOffset))
}
@ -69,7 +69,7 @@ open class RxScrollViewDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
public override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
let scrollView = (object as! UIScrollView)
return castOrFatalError(scrollView.rx_createDelegateProxy())
@ -78,7 +78,7 @@ open class RxScrollViewDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
let scrollView: UIScrollView = castOrFatalError(object)
scrollView.delegate = castOptionalOrFatalError(delegate)
}
@ -86,7 +86,7 @@ open class RxScrollViewDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
let scrollView: UIScrollView = castOrFatalError(object)
return scrollView.delegate
}

View File

@ -17,7 +17,7 @@ import RxSwift
/**
For more information take a look at `DelegateProxyType`.
*/
open class RxSearchBarDelegateProxy
public class RxSearchBarDelegateProxy
: DelegateProxy
, UISearchBarDelegate
, DelegateProxyType {
@ -25,7 +25,7 @@ open class RxSearchBarDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
let searchBar: UISearchBar = castOrFatalError(object)
return searchBar.delegate
}
@ -33,7 +33,7 @@ open class RxSearchBarDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
let searchBar: UISearchBar = castOrFatalError(object)
searchBar.delegate = castOptionalOrFatalError(delegate)
}
@ -44,7 +44,7 @@ open class RxSearchBarDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
public override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
let searchBar = (object as! UISearchBar)
return castOrFatalError(searchBar.rx_createDelegateProxy())

View File

@ -18,7 +18,7 @@
For more information take a look at `DelegateProxyType`.
*/
@available(iOS 8.0, *)
open class RxSearchControllerDelegateProxy
public class RxSearchControllerDelegateProxy
: DelegateProxy
, DelegateProxyType
, UISearchControllerDelegate {
@ -26,7 +26,7 @@ open class RxSearchControllerDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
let searchController: UISearchController = castOrFatalError(object)
searchController.delegate = castOptionalOrFatalError(delegate)
}
@ -34,7 +34,7 @@ open class RxSearchControllerDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
let searchController: UISearchController = castOrFatalError(object)
return searchController.delegate
}

View File

@ -17,7 +17,7 @@ import RxSwift
/**
For more information take a look at `DelegateProxyType`.
*/
open class RxTabBarDelegateProxy
public class RxTabBarDelegateProxy
: DelegateProxy
, UITabBarDelegate
, DelegateProxyType {
@ -25,7 +25,7 @@ open class RxTabBarDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
let tabBar: UITabBar = castOrFatalError(object)
return tabBar.delegate
}
@ -33,7 +33,7 @@ open class RxTabBarDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
let tabBar: UITabBar = castOrFatalError(object)
tabBar.delegate = castOptionalOrFatalError(delegate)
}
@ -41,7 +41,7 @@ open class RxTabBarDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
public override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
let tabBar = (object as! UITabBar)
return castOrFatalError(tabBar.rx_createDelegateProxy())

View File

@ -32,7 +32,7 @@ class TableViewDataSourceNotSet
/**
For more information take a look at `DelegateProxyType`.
*/
open class RxTableViewDataSourceProxy
public class RxTableViewDataSourceProxy
: DelegateProxy
, UITableViewDataSource
, DelegateProxyType {
@ -40,7 +40,7 @@ open class RxTableViewDataSourceProxy
/**
Typed parent object.
*/
open weak fileprivate(set) var tableView: UITableView?
public weak fileprivate(set) var tableView: UITableView?
fileprivate weak var _requiredMethodsDataSource: UITableViewDataSource? = tableViewDataSourceNotSet
@ -59,14 +59,14 @@ open class RxTableViewDataSourceProxy
/**
Required delegate method implementation.
*/
open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return (_requiredMethodsDataSource ?? tableViewDataSourceNotSet).tableView(tableView, numberOfRowsInSection: section)
}
/**
Required delegate method implementation.
*/
open func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return (_requiredMethodsDataSource ?? tableViewDataSourceNotSet).tableView(tableView, cellForRowAt: indexPath)
}
@ -75,7 +75,7 @@ open class RxTableViewDataSourceProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
public override class func createProxyForObject(_ object: AnyObject) -> AnyObject {
let tableView = (object as! UITableView)
return castOrFatalError(tableView.rx_createDataSourceProxy())
@ -84,14 +84,14 @@ open class RxTableViewDataSourceProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open override class func delegateAssociatedObjectTag() -> UnsafeRawPointer {
public override class func delegateAssociatedObjectTag() -> UnsafeRawPointer {
return _pointer(&dataSourceAssociatedTag)
}
/**
For more information take a look at `DelegateProxyType`.
*/
open class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
let tableView: UITableView = castOrFatalError(object)
tableView.dataSource = castOptionalOrFatalError(delegate)
}
@ -99,7 +99,7 @@ open class RxTableViewDataSourceProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
let tableView: UITableView = castOrFatalError(object)
return tableView.dataSource
}
@ -107,7 +107,7 @@ open class RxTableViewDataSourceProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open override func setForwardToDelegate(_ forwardToDelegate: AnyObject?, retainDelegate: Bool) {
public override func setForwardToDelegate(_ forwardToDelegate: AnyObject?, retainDelegate: Bool) {
let requiredMethodsDataSource: UITableViewDataSource? = castOptionalOrFatalError(forwardToDelegate)
_requiredMethodsDataSource = requiredMethodsDataSource ?? tableViewDataSourceNotSet
super.setForwardToDelegate(forwardToDelegate, retainDelegate: retainDelegate)

View File

@ -17,7 +17,7 @@ import RxSwift
/**
For more information take a look at `DelegateProxyType`.
*/
open class RxTableViewDelegateProxy
public class RxTableViewDelegateProxy
: RxScrollViewDelegateProxy
, UITableViewDelegate {
@ -25,7 +25,7 @@ open class RxTableViewDelegateProxy
/**
Typed parent object.
*/
open weak private(set) var tableView: UITableView?
public weak private(set) var tableView: UITableView?
/**
Initializes `RxTableViewDelegateProxy`

View File

@ -14,7 +14,7 @@
#endif
import UIKit
open class RxTextStorageDelegateProxy
public class RxTextStorageDelegateProxy
: DelegateProxy
, DelegateProxyType
, NSTextStorageDelegate {
@ -23,7 +23,7 @@ open class RxTextStorageDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
let textStorage: NSTextStorage = castOrFatalError(object)
textStorage.delegate = castOptionalOrFatalError(delegate)
}
@ -31,7 +31,7 @@ open class RxTextStorageDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
open class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
let textStorage: NSTextStorage = castOrFatalError(object)
return textStorage.delegate
}

View File

@ -17,14 +17,14 @@ import RxSwift
/**
For more information take a look at `DelegateProxyType`.
*/
open class RxTextViewDelegateProxy
public class RxTextViewDelegateProxy
: RxScrollViewDelegateProxy
, UITextViewDelegate {
/**
Typed parent object.
*/
open weak private(set) var textView: UITextView?
public weak private(set) var textView: UITextView?
/**
Initializes `RxTextViewDelegateProxy`
@ -41,7 +41,7 @@ open class RxTextViewDelegateProxy
/**
For more information take a look at `DelegateProxyType`.
*/
@objc open func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
@objc public func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
/**
We've had some issues with observing text changes. This is here just in case we need the same hack in future and that
we wouldn't need to change the public interface.

View File

@ -11,7 +11,7 @@ import Foundation
/**
Base class for all disposables.
*/
open class DisposeBase {
public class DisposeBase {
init() {
#if TRACE_RESOURCES
let _ = AtomicIncrement(&resourceCount)

View File

@ -13,7 +13,7 @@ Represents a disposable resource which only allows a single assignment of its un
If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an exception.
*/
open class SingleAssignmentDisposable : DisposeBase, Disposable, Cancelable {
public class SingleAssignmentDisposable : DisposeBase, Disposable, Cancelable {
private var _lock = SpinLock()
// state
@ -24,7 +24,7 @@ open class SingleAssignmentDisposable : DisposeBase, Disposable, Cancelable {
/**
- returns: A value that indicates whether the object is disposed.
*/
open var isDisposed: Bool {
public var isDisposed: Bool {
return _isDisposed
}
@ -40,7 +40,7 @@ open class SingleAssignmentDisposable : DisposeBase, Disposable, Cancelable {
**Throws exception if the `SingleAssignmentDisposable` has already been assigned to.**
*/
open var disposable: Disposable {
public var disposable: Disposable {
get {
_lock.lock(); defer { _lock.unlock() }
return _disposable ?? Disposables.create()
@ -70,7 +70,7 @@ open class SingleAssignmentDisposable : DisposeBase, Disposable, Cancelable {
/**
Disposes the underlying disposable.
*/
open func dispose() {
public func dispose() {
if _isDisposed {
return
}

View File

@ -13,7 +13,7 @@ A type-erased `ObservableType`.
It represents a push style sequence.
*/
open class Observable<Element> : ObservableType {
public class Observable<Element> : ObservableType {
/**
Type of elements in sequence.
*/
@ -25,11 +25,11 @@ open class Observable<Element> : ObservableType {
#endif
}
open func subscribe<O: ObserverType>(_ observer: O) -> Disposable where O.E == E {
public func subscribe<O: ObserverType>(_ observer: O) -> Disposable where O.E == E {
abstractMethod()
}
open func asObservable() -> Observable<E> {
public func asObservable() -> Observable<E> {
return self
}

View File

@ -11,7 +11,7 @@ import Foundation
/**
Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence.
*/
open class ConnectableObservable<Element>
public class ConnectableObservable<Element>
: Observable<Element>
, ConnectableObservableType {
@ -20,7 +20,7 @@ open class ConnectableObservable<Element>
- returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.
*/
open func connect() -> Disposable {
public func connect() -> Disposable {
abstractMethod()
}
}

View File

@ -13,11 +13,11 @@ Abstracts the work that needs to be performed on a specific `dispatch_queue_t`.
This scheduler is suitable when some work needs to be performed in background.
*/
open class ConcurrentDispatchQueueScheduler: SchedulerType {
public class ConcurrentDispatchQueueScheduler: SchedulerType {
public typealias TimeInterval = Foundation.TimeInterval
public typealias Time = Date
open var now : Date {
public var now : Date {
return Date()
}
@ -81,7 +81,7 @@ open class ConcurrentDispatchQueueScheduler: SchedulerType {
- parameter action: Action to be executed.
- returns: The disposable object used to cancel the scheduled action (best effort).
*/
open func schedulePeriodic<StateType>(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable {
public func schedulePeriodic<StateType>(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable {
return self.configuration.schedulePeriodic(state, startAfter: startAfter, period: period, action: action)
}
}

View File

@ -64,13 +64,13 @@ This is the default scheduler for operators that generate elements.
This scheduler is also sometimes called `trampoline scheduler`.
*/
open class CurrentThreadScheduler : ImmediateSchedulerType {
public class CurrentThreadScheduler : ImmediateSchedulerType {
typealias ScheduleQueue = RxMutableBox<Queue<ScheduledItemType>>
/**
The singleton instance of the current thread scheduler.
*/
open static let instance = CurrentThreadScheduler()
public static let instance = CurrentThreadScheduler()
static var queue : ScheduleQueue? {
get {
@ -84,7 +84,7 @@ open class CurrentThreadScheduler : ImmediateSchedulerType {
/**
Gets a value that indicates whether the caller must call a `schedule` method.
*/
open static fileprivate(set) var isScheduleRequired: Bool {
public static fileprivate(set) var isScheduleRequired: Bool {
get {
let value: CurrentThreadSchedulerValue? = Thread.getThreadLocalStorageValueForKey(CurrentThreadSchedulerKeyInstance as NSString)
return value == nil
@ -104,7 +104,7 @@ open class CurrentThreadScheduler : ImmediateSchedulerType {
- parameter action: Action to be executed.
- returns: The disposable object used to cancel the scheduled action (best effort).
*/
open func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable {
public func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable {
if CurrentThreadScheduler.isScheduleRequired {
CurrentThreadScheduler.isScheduleRequired = false

View File

@ -13,8 +13,8 @@ Abstracts the work that needs to be performed on a specific `NSOperationQueue`.
This scheduler is suitable for cases when there is some bigger chunk of work that needs to be performed in background and you want to fine tune concurrent processing using `maxConcurrentOperationCount`.
*/
open class OperationQueueScheduler: ImmediateSchedulerType {
open let operationQueue: OperationQueue
public class OperationQueueScheduler: ImmediateSchedulerType {
public let operationQueue: OperationQueue
/**
Constructs new instance of `OperationQueueScheduler` that performs work on `operationQueue`.
@ -32,7 +32,7 @@ open class OperationQueueScheduler: ImmediateSchedulerType {
- parameter action: Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
- returns: The disposable object used to cancel the scheduled action (best effort).
*/
open func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable {
public func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable {
let compositeDisposable = CompositeDisposable()

View File

@ -25,14 +25,14 @@ In case some customization need to be made on it before usage,
internal serial queue can be customized using `serialQueueConfiguration`
callback.
*/
open class SerialDispatchQueueScheduler : SchedulerType {
public class SerialDispatchQueueScheduler : SchedulerType {
public typealias TimeInterval = Foundation.TimeInterval
public typealias Time = Date
/**
- returns: Current time.
*/
open var now : Date {
public var now : Date {
return Date()
}
@ -118,7 +118,7 @@ open class SerialDispatchQueueScheduler : SchedulerType {
- parameter action: Action to be executed.
- returns: The disposable object used to cancel the scheduled action (best effort).
*/
open func schedulePeriodic<StateType>(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable {
public func schedulePeriodic<StateType>(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable {
return self.configuration.schedulePeriodic(state, startAfter: startAfter, period: period, action: action)
}
}

View File

@ -30,14 +30,14 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
/**
- returns: Current time.
*/
open var now: RxTime {
public var now: RxTime {
return _converter.convertFromVirtualTime(clock)
}
/**
- returns: Scheduler's absolute time clock value.
*/
open var clock: VirtualTime {
public var clock: VirtualTime {
return _clock
}
@ -72,7 +72,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
- parameter action: Action to be executed.
- returns: The disposable object used to cancel the scheduled action (best effort).
*/
open func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable {
public func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable {
return self.scheduleRelative(state, dueTime: 0.0) { a in
return action(a)
}
@ -86,7 +86,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
- parameter action: Action to be executed.
- returns: The disposable object used to cancel the scheduled action (best effort).
*/
open func scheduleRelative<StateType>(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable {
public func scheduleRelative<StateType>(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable {
let time = self.now.addingTimeInterval(dueTime)
let absoluteTime = _converter.convertToVirtualTime(time)
let adjustedTime = self.adjustScheduledTime(absoluteTime)
@ -101,7 +101,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
- parameter action: Action to be executed.
- returns: The disposable object used to cancel the scheduled action (best effort).
*/
open func scheduleRelativeVirtual<StateType>(_ state: StateType, dueTime: VirtualTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable {
public func scheduleRelativeVirtual<StateType>(_ state: StateType, dueTime: VirtualTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable {
let time = _converter.offsetVirtualTime(self.clock, offset: dueTime)
return scheduleAbsoluteVirtual(state, time: time, action: action)
}
@ -114,7 +114,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
- parameter action: Action to be executed.
- returns: The disposable object used to cancel the scheduled action (best effort).
*/
open func scheduleAbsoluteVirtual<StateType>(_ state: StateType, time: Converter.VirtualTimeUnit, action: @escaping (StateType) -> Disposable) -> Disposable {
public func scheduleAbsoluteVirtual<StateType>(_ state: StateType, time: Converter.VirtualTimeUnit, action: @escaping (StateType) -> Disposable) -> Disposable {
MainScheduler.ensureExecutingOnScheduler()
let compositeDisposable = CompositeDisposable()
@ -143,7 +143,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
/**
Starts the virtual time scheduler.
*/
open func start() {
public func start() {
MainScheduler.ensureExecutingOnScheduler()
if _running {
@ -185,7 +185,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
- parameter virtualTime: Absolute time to advance the scheduler's clock to.
*/
open func advanceTo(_ virtualTime: VirtualTime) {
public func advanceTo(_ virtualTime: VirtualTime) {
MainScheduler.ensureExecutingOnScheduler()
if _running {
@ -217,7 +217,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
/**
Advances the scheduler's clock by the specified relative time.
*/
open func sleep(_ virtualInterval: VirtualTimeInterval) {
public func sleep(_ virtualInterval: VirtualTimeInterval) {
MainScheduler.ensureExecutingOnScheduler()
let sleepTo = _converter.offsetVirtualTime(clock, offset: virtualInterval)
@ -231,7 +231,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
/**
Stops the virtual time scheduler.
*/
open func stop() {
public func stop() {
MainScheduler.ensureExecutingOnScheduler()
_running = false

View File

@ -13,7 +13,7 @@ Represents an object that is both an observable sequence as well as an observer.
Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
*/
open class ReplaySubject<Element>
public class ReplaySubject<Element>
: Observable<Element>
, SubjectType
, ObserverType
@ -23,7 +23,7 @@ open class ReplaySubject<Element>
/**
Indicates whether the subject has any observers
*/
open var hasObservers: Bool {
public var hasObservers: Bool {
_lock.lock(); defer { _lock.unlock() }
return _observers.count > 0
}
@ -46,21 +46,21 @@ open class ReplaySubject<Element>
- parameter event: Event to send to the observers.
*/
open func on(_ event: Event<E>) {
public func on(_ event: Event<E>) {
abstractMethod()
}
/**
Returns observer interface for subject.
*/
open func asObserver() -> SubjectObserverType {
public func asObserver() -> SubjectObserverType {
return self
}
/**
Unsubscribe all observers and release resources.
*/
open func dispose() {
public func dispose() {
}
/**
@ -69,7 +69,7 @@ open class ReplaySubject<Element>
- parameter bufferSize: Maximal number of elements to replay to observer after subscription.
- returns: New instance of replay subject.
*/
open static func create(bufferSize: Int) -> ReplaySubject<Element> {
public static func create(bufferSize: Int) -> ReplaySubject<Element> {
if bufferSize == 1 {
return ReplayOne()
}
@ -83,7 +83,7 @@ open class ReplaySubject<Element>
To avoid filling up memory, developer needs to make sure that the use case will only ever store a 'reasonable'
number of elements.
*/
open static func createUnbounded() -> ReplaySubject<Element> {
public static func createUnbounded() -> ReplaySubject<Element> {
return ReplayAll()
}
}

View File

@ -14,7 +14,7 @@ Variable is a wrapper for `BehaviorSubject`.
Unlike `BehaviorSubject` it can't terminate with error, and when variable is deallocated
it will complete it's observable sequence (`asObservable`).
*/
open class Variable<Element> {
public class Variable<Element> {
public typealias E = Element
@ -32,7 +32,7 @@ open class Variable<Element> {
Even if the newly set value is same as the old value, observers are still notified for change.
*/
open var value: E {
public var value: E {
get {
_lock.lock(); defer { _lock.unlock() }
return _value
@ -59,7 +59,7 @@ open class Variable<Element> {
/**
- returns: Canonical interface for push style sequence
*/
open func asObservable() -> Observable<E> {
public func asObservable() -> Observable<E> {
return _subject
}

View File

@ -12,7 +12,7 @@ import RxSwift
/**
Virtual time scheduler used for testing applications and libraries built using RxSwift.
*/
open class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverter> {
public class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverter> {
/**
Default values of scheduler times.
*/
@ -52,7 +52,7 @@ open class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverte
- parameter events: Events to surface through the created sequence at their specified absolute virtual times.
- returns: Hot observable sequence that can be used to assert the timing of subscriptions and events.
*/
open func createHotObservable<Element>(_ events: [Recorded<Event<Element>>]) -> TestableObservable<Element> {
public func createHotObservable<Element>(_ events: [Recorded<Event<Element>>]) -> TestableObservable<Element> {
return HotObservable(testScheduler: self as AnyObject as! TestScheduler, recordedEvents: events)
}
@ -62,7 +62,7 @@ open class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverte
- parameter events: Events to surface through the created sequence at their specified virtual time offsets from the sequence subscription time.
- returns: Cold observable sequence that can be used to assert the timing of subscriptions and events.
*/
open func createColdObservable<Element>(_ events: [Recorded<Event<Element>>]) -> TestableObservable<Element> {
public func createColdObservable<Element>(_ events: [Recorded<Event<Element>>]) -> TestableObservable<Element> {
return ColdObservable(testScheduler: self as AnyObject as! TestScheduler, recordedEvents: events)
}
@ -72,7 +72,7 @@ open class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverte
- parameter type: Optional type hint of the observed sequence elements.
- returns: Observer that can be used to assert the timing of events.
*/
open func createObserver<E>(_ type: E.Type) -> TestableObserver<E> {
public func createObserver<E>(_ type: E.Type) -> TestableObserver<E> {
return TestableObserver(scheduler: self as AnyObject as! TestScheduler)
}
@ -81,7 +81,7 @@ open class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverte
- parameter time: Absolute virtual time at which to execute the action.
*/
open func scheduleAt(_ time: TestTime, action: @escaping () -> Void) {
public func scheduleAt(_ time: TestTime, action: @escaping () -> Void) {
_ = self.scheduleAbsoluteVirtual((), time: time, action: { () -> Disposable in
action()
return Disposables.create()
@ -91,7 +91,7 @@ open class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverte
/**
Adjusts time of scheduling before adding item to schedule queue. If scheduled time is `<= clock`, then it is scheduled at `clock + 1`
*/
override open func adjustScheduledTime(_ time: VirtualTime) -> VirtualTime {
override public func adjustScheduledTime(_ time: VirtualTime) -> VirtualTime {
return time <= clock ? clock + (_simulateProcessingDelay ? 1 : 0) : time
}
@ -104,7 +104,7 @@ open class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverte
- parameter disposed: Virtual time at which to dispose the subscription.
- returns: Observer with timestamped recordings of events that were received during the virtual time window when the subscription to the source sequence was active.
*/
open func start<Element>(_ created: TestTime, subscribed: TestTime, disposed: TestTime, create: @escaping () -> Observable<Element>) -> TestableObserver<Element> {
public func start<Element>(_ created: TestTime, subscribed: TestTime, disposed: TestTime, create: @escaping () -> Observable<Element>) -> TestableObserver<Element> {
var source : Observable<Element>? = nil
var subscription : Disposable? = nil
let observer = createObserver(Element.self)
@ -140,7 +140,7 @@ open class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverte
- parameter disposed: Virtual time at which to dispose the subscription.
- returns: Observer with timestamped recordings of events that were received during the virtual time window when the subscription to the source sequence was active.
*/
open func start<Element>(_ disposed: TestTime, create: @escaping () -> Observable<Element>) -> TestableObserver<Element> {
public func start<Element>(_ disposed: TestTime, create: @escaping () -> Observable<Element>) -> TestableObserver<Element> {
return start(Defaults.created, subscribed: Defaults.subscribed, disposed: disposed, create: create)
}
@ -155,7 +155,7 @@ open class TestScheduler : VirtualTimeScheduler<TestSchedulerVirtualTimeConverte
- parameter create: Factory method to create an observable sequence.
- returns: Observer with timestamped recordings of events that were received during the virtual time window when the subscription to the source sequence was active.
*/
open func start<Element>(_ create: @escaping () -> Observable<Element>) -> TestableObserver<Element> {
public func start<Element>(_ create: @escaping () -> Observable<Element>) -> TestableObserver<Element> {
return start(Defaults.created, subscribed: Defaults.subscribed, disposed: Defaults.disposed, create: create)
}
}

View File

@ -12,20 +12,20 @@ import RxSwift
/**
Observable sequence that records subscription lifetimes and timestamped events sent to observers.
*/
open class TestableObservable<Element>
public class TestableObservable<Element>
: ObservableType {
public typealias E = Element
/**
Subscriptions recorded during observable lifetime.
*/
open internal(set) var subscriptions: [Subscription]
public internal(set) var subscriptions: [Subscription]
/**
List of events to replay for all subscribers.
Event times represent absolute `TestScheduler` time.
*/
open internal(set) var recordedEvents: [Recorded<Event<Element>>]
public internal(set) var recordedEvents: [Recorded<Event<Element>>]
/**
Parent test scheduler.
@ -38,7 +38,7 @@ open class TestableObservable<Element>
self.subscriptions = []
}
open func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.E == Element {
public func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.E == Element {
fatalError("Abstract method")
}
}

View File

@ -12,7 +12,7 @@ import RxSwift
/**
Observer that records events together with virtual time when they were received.
*/
open class TestableObserver<ElementType>
public class TestableObserver<ElementType>
: ObserverType {
public typealias Element = ElementType
@ -21,7 +21,7 @@ open class TestableObserver<ElementType>
/**
Recorded events.
*/
open fileprivate(set) var events = [Recorded<Event<Element>>]()
public fileprivate(set) var events = [Recorded<Event<Element>>]()
init(scheduler: TestScheduler) {
_scheduler = scheduler
@ -32,7 +32,7 @@ open class TestableObserver<ElementType>
- parameter event: Event that occured.
*/
open func on(_ event: Event<Element>) {
public func on(_ event: Event<Element>) {
events.append(Recorded(time: _scheduler.clock, event: event))
}
}