Skip to content
Permalink
Browse files

Merge branch 'develop' into feature/map

  • Loading branch information...
MortyMerr committed Jul 8, 2019
2 parents e1bed85 + d20871c commit de5a6bc7e754900a52df2a8f371474e4d59afe63
Showing with 219 additions and 242 deletions.
  1. +0 −1 .jazzy.yml
  2. +13 −0 Documentation/GettingStarted.md
  3. +1 −1 Platform/DataStructures/Bag.swift
  4. +1 −1 Platform/DataStructures/PriorityQueue.swift
  5. +2 −2 README.md
  6. +0 −4 Rx.xcodeproj/project.pbxproj
  7. +2 −2 RxBlocking/BlockingObservable+Operators.swift
  8. +3 −3 RxCocoa/Common/DelegateProxy.swift
  9. +4 −4 RxCocoa/Common/DelegateProxyType.swift
  10. +3 −0 RxCocoa/Deprecated.swift
  11. +8 −8 RxCocoa/Foundation/NSObject+Rx.swift
  12. +1 −1 RxCocoa/Foundation/URLSession+Rx.swift
  13. +2 −2 RxCocoa/Traits/SharedSequence/SharedSequence.swift
  14. +3 −3 RxCocoa/iOS/Proxies/RxCollectionViewDataSourcePrefetchingProxy.swift
  15. +2 −2 RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift
  16. +2 −2 RxCocoa/iOS/Proxies/RxScrollViewDelegateProxy.swift
  17. +3 −3 RxCocoa/iOS/Proxies/RxTableViewDataSourcePrefetchingProxy.swift
  18. +3 −3 RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift
  19. +1 −1 RxCocoa/iOS/Proxies/RxWebViewDelegateProxy.swift
  20. +1 −1 RxCocoa/iOS/UIBarButtonItem+Rx.swift
  21. +1 −1 RxCocoa/iOS/UIWebView+Rx.swift
  22. +2 −2 RxExample/Extensions/CLLocationManager+Rx.swift
  23. +1 −1 RxExample/Extensions/UIImagePickerController+Rx.swift
  24. +1 −1 RxExample/RxDataSources/Differentiator/Diff.swift
  25. +0 −6 RxExample/RxExample.xcodeproj/project.pbxproj
  26. +4 −4 RxExample/RxExample/Examples/GitHubSearchRepositories/GitHubSearchRepositoriesAPI.swift
  27. +2 −2 RxExample/RxExample/Examples/SimpleValidation/SimpleValidationViewController.swift
  28. +2 −2 RxExample/RxExample/Examples/WikipediaImageSearch/Views/WikipediaSearchCell.swift
  29. +1 −1 RxExample/RxExample/Feedbacks.swift
  30. +0 −12 RxExample/RxExample/Result.swift
  31. +6 −6 RxExample/RxExample/Services/Reachability.swift
  32. +1 −1 RxSwift/Deprecated.swift
  33. +2 −2 RxSwift/Disposables/AnonymousDisposable.swift
  34. +2 −2 RxSwift/Disposables/DisposeBag.swift
  35. +2 −2 RxSwift/Disposables/NopDisposable.swift
  36. +1 −1 RxSwift/Disposables/SingleAssignmentDisposable.swift
  37. +0 −22 RxSwift/Extensions/String+Rx.swift
  38. +7 −4 RxSwift/ObservableType+Extensions.swift
  39. +2 −2 RxSwift/Observables/Amb.swift
  40. +2 −2 RxSwift/Observables/AsMaybe.swift
  41. +2 −2 RxSwift/Observables/AsSingle.swift
  42. +1 −1 RxSwift/Observables/Create.swift
  43. +4 −4 RxSwift/Observables/Debug.swift
  44. +1 −1 RxSwift/Observables/Dematerialize.swift
  45. +1 −1 RxSwift/Observables/DistinctUntilChanged.swift
  46. +6 −6 RxSwift/Observables/Do.swift
  47. +2 −2 RxSwift/Observables/First.swift
  48. +1 −1 RxSwift/Observables/Materialize.swift
  49. +7 −7 RxSwift/Observables/Merge.swift
  50. +3 −3 RxSwift/Observables/Multicast.swift
  51. +1 −1 RxSwift/Observables/ObserveOn.swift
  52. +2 −2 RxSwift/Observables/Producer.swift
  53. +1 −1 RxSwift/Observables/Reduce.swift
  54. +6 −6 RxSwift/Observables/RetryWhen.swift
  55. +3 −3 RxSwift/Observables/Sample.swift
  56. +3 −3 RxSwift/Observables/Scan.swift
  57. +5 −5 RxSwift/Observables/ShareReplayScope.swift
  58. +2 −2 RxSwift/Observables/SingleAsync.swift
  59. +2 −2 RxSwift/Observables/Sink.swift
  60. +3 −3 RxSwift/Observables/SkipUntil.swift
  61. +3 −3 RxSwift/Observables/SkipWhile.swift
  62. +9 −9 RxSwift/Observables/Switch.swift
  63. +2 −2 RxSwift/Observables/Take.swift
  64. +1 −1 RxSwift/Observables/TakeLast.swift
  65. +5 −5 RxSwift/Observables/TakeUntil.swift
  66. +3 −3 RxSwift/Observables/TakeWhile.swift
  67. +2 −2 RxSwift/Observables/WithLatestFrom.swift
  68. +1 −1 RxSwift/Rx.swift
  69. +1 −1 RxSwift/Schedulers/CurrentThreadScheduler.swift
  70. +1 −1 RxSwift/Schedulers/VirtualTimeScheduler.swift
  71. +1 −1 RxSwift/Subjects/AsyncSubject.swift
  72. +1 −1 RxSwift/Subjects/BehaviorSubject.swift
  73. +1 −1 RxSwift/Subjects/PublishSubject.swift
  74. +3 −3 RxSwift/Subjects/ReplaySubject.swift
  75. +2 −2 RxTest/TestableObserver.swift
  76. +0 −1 Sources/RxSwift/String+Rx.swift
  77. +6 −6 Tests/Microoptimizations/PerformanceTools.swift
  78. +13 −13 Tests/RxCocoaTests/DelegateProxyTest+UIKit.swift
  79. +1 −1 Tests/RxCocoaTests/NSTextField+RxTests.swift
  80. +1 −1 Tests/RxCocoaTests/NSTextView+RxTests.swift
  81. +1 −1 Tests/RxCocoaTests/RuntimeStateSnapshot.swift
  82. +1 −1 Tests/RxCocoaTests/UIControl+RxTests.swift
  83. +1 −1 Tests/RxCocoaTests/UIWebView+RxTests.swift
  84. +1 −1 Tests/RxSwiftTests/AtomicTests.swift
  85. +1 −1 Tests/RxSwiftTests/Observable+MaterializeTests.swift
  86. +1 −1 Tests/RxSwiftTests/RecursiveLockTest.swift
  87. +1 −1 Tests/RxTest.swift
  88. +5 −1 scripts/validate-podspec.sh
@@ -187,7 +187,6 @@ custom_categories:
- name: RxSwift/Extensions
children:
- Bag+Rx
- String+Rx
- name: RxSwift/Observables
children:
- AddRef
@@ -727,6 +727,19 @@ You can recover from failure of observable by using `catch` operator. There are

There is also `retry` operator that enables retries in case of errored sequence.

### Hooks and Default error handling

RxSwift offers a global Hook that provides a default error handling mechanism for cases when you don't provide your own `onError` handler.

Set `Hooks.defaultErrorHandler` with your own closure to decide how to deal with unhandled errors in your system, if you need that option. For example, sending the stacktrace or untracked-error to your analytics system.

By default, `Hooks.defaultErrorHandler` simply prints the received error in `DEBUG` mode, and does nothing in `RELEASE`. However, you can add additional configurations to this behavior.

In order to enable detailed callstack logging, set `Hooks.recordCallStackOnError` flag to `true`.

By default, this will return the current `Thread.callStackSymbols` in `DEBUG` mode, and will track an empty stack trace in `RELEASE`. You may customize this behavior by overriding `Hooks.customCaptureSubscriptionCallstack` with your own implementation.


## Debugging Compile Errors

When writing elegant RxSwift/RxCocoa code, you are probably relying heavily on compiler to deduce types of `Observable`s. This is one of the reasons why Swift is awesome, but it can also be frustrating sometimes.
@@ -35,7 +35,7 @@ struct Bag<T> : CustomDebugStringConvertible {

typealias Entry = (key: BagKey, value: T)

fileprivate var _nextKey: BagKey = BagKey(rawValue: 0)
private var _nextKey: BagKey = BagKey(rawValue: 0)

// data
@@ -10,7 +10,7 @@ struct PriorityQueue<Element> {
private let _hasHigherPriority: (Element, Element) -> Bool
private let _isEqual: (Element, Element) -> Bool

fileprivate var _elements = [Element]()
private var _elements = [Element]()

init(hasHigherPriority: @escaping (Element, Element) -> Bool, isEqual: @escaping (Element, Element) -> Bool) {
_hasHigherPriority = hasHigherPriority
@@ -186,7 +186,7 @@ If you wish to build RxSwift as a Static Library using Carthage you may use the
```bash
carthage update RxSwift --platform iOS --no-build
sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj
carthage build RxAlamofire --platform iOS
carthage build RxSwift --platform iOS
```

### [Swift Package Manager](https://github.com/apple/swift-package-manager)
@@ -241,4 +241,4 @@ $ git submodule add git@github.com:ReactiveX/RxSwift.git
* [Reactive Programming Overview (Jafar Husain from Netflix)](https://www.youtube.com/watch?v=dwP1TNXE6fc)
* [Subject/Observer is Dual to Iterator (paper)](http://csl.stanford.edu/~christos/pldi2010.fit/meijer.duality.pdf)
* [Rx standard sequence operators visualized (visualization tool)](http://rxmarbles.com/)
* [Haskell](https://www.haskell.org/)
* [Haskell](https://www.haskell.org/)
@@ -563,7 +563,6 @@
C84CC55D1BDD010800E06A64 /* SynchronizedUnsubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84CC55C1BDD010800E06A64 /* SynchronizedUnsubscribeType.swift */; };
C84CC5621BDD037900E06A64 /* SynchronizedDisposeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84CC5611BDD037900E06A64 /* SynchronizedDisposeType.swift */; };
C84CC5671BDD08A500E06A64 /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84CC5661BDD08A500E06A64 /* SubscriptionDisposable.swift */; };
C85106881C2D550E0075150C /* String+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85106871C2D550E0075150C /* String+Rx.swift */; };
C85217E91E3374970015DD38 /* GroupedObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85217E81E3374970015DD38 /* GroupedObservable.swift */; };
C85217EE1E33C8E60015DD38 /* PerformanceTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E8BA701E2C18AE00A4AC2C /* PerformanceTools.swift */; };
C85217F31E33ECA00015DD38 /* PerformanceTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E8BA701E2C18AE00A4AC2C /* PerformanceTools.swift */; };
@@ -1251,7 +1250,6 @@
C84CC55C1BDD010800E06A64 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronizedUnsubscribeType.swift; sourceTree = "<group>"; };
C84CC5611BDD037900E06A64 /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronizedDisposeType.swift; sourceTree = "<group>"; };
C84CC5661BDD08A500E06A64 /* SubscriptionDisposable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionDisposable.swift; sourceTree = "<group>"; };
C85106871C2D550E0075150C /* String+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Rx.swift"; sourceTree = "<group>"; };
C85217E81E3374970015DD38 /* GroupedObservable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupedObservable.swift; sourceTree = "<group>"; };
C85217F41E33F9D70015DD38 /* RecursiveLock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = RecursiveLock.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
C85217F61E33FBBE0015DD38 /* RecursiveLock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = RecursiveLock.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
@@ -2075,7 +2073,6 @@
C85106851C2D54B70075150C /* Extensions */ = {
isa = PBXGroup;
children = (
C85106871C2D550E0075150C /* String+Rx.swift */,
C86781871DB814AD00B2029A /* Bag+Rx.swift */,
);
path = Extensions;
@@ -3675,7 +3672,6 @@
C8093D731B8A72BE0088E94D /* ObserverBase.swift in Sources */,
C820A8EC1EB4DA5A00D431BC /* Never.swift in Sources */,
C820A8981EB4DA5A00D431BC /* Catch.swift in Sources */,
C85106881C2D550E0075150C /* String+Rx.swift in Sources */,
C820A9141EB4DA5A00D431BC /* ToArray.swift in Sources */,
C820A8741EB4DA5A00D431BC /* SkipWhile.swift in Sources */,
25F6ECBE1F48C373008552FA /* Completable.swift in Sources */,
@@ -101,7 +101,7 @@ extension BlockingObservable {
}

extension BlockingObservable {
fileprivate func materializeResult(max: Int? = nil, predicate: @escaping (Element) throws -> Bool = { _ in true }) -> MaterializedSequenceResult<Element> {
private func materializeResult(max: Int? = nil, predicate: @escaping (Element) throws -> Bool = { _ in true }) -> MaterializedSequenceResult<Element> {
var elements = [Element]()
var error: Swift.Error?

@@ -159,7 +159,7 @@ extension BlockingObservable {
return MaterializedSequenceResult.completed(elements: elements)
}

fileprivate func elementsOrThrow(_ results: MaterializedSequenceResult<Element>) throws -> [Element] {
private func elementsOrThrow(_ results: MaterializedSequenceResult<Element>) throws -> [Element] {
switch results {
case .failed(_, let error):
throw error
@@ -26,8 +26,8 @@
/// Parent object associated with delegate proxy.
private weak var _parentObject: ParentObject?

fileprivate let _currentDelegateFor: (ParentObject) -> AnyObject?
fileprivate let _setCurrentDelegateTo: (AnyObject?, ParentObject) -> Void
private let _currentDelegateFor: (ParentObject) -> AnyObject?
private let _setCurrentDelegateTo: (AnyObject?, ParentObject) -> Void

/// Initializes new instance.
///
@@ -258,7 +258,7 @@

private let mainScheduler = MainScheduler()

fileprivate final class MessageDispatcher {
private final class MessageDispatcher {
private let dispatcher: PublishSubject<[Any]>
private let result: Observable<[Any]>

@@ -240,18 +240,18 @@ extension DelegateProxyType {
}


// fileprivate extensions
// private extensions
extension DelegateProxyType {
fileprivate static var factory: DelegateProxyFactory {
private static var factory: DelegateProxyFactory {
return DelegateProxyFactory.sharedFactory(for: self)
}

fileprivate static func assignedProxy(for object: ParentObject) -> AnyObject? {
private static func assignedProxy(for object: ParentObject) -> AnyObject? {
let maybeDelegate = objc_getAssociatedObject(object, self.identifier)
return castOptionalOrFatalError(maybeDelegate)
}

fileprivate static func assignProxy(_ proxy: AnyObject, toObject object: ParentObject) {
private static func assignProxy(_ proxy: AnyObject, toObject object: ParentObject) {
objc_setAssociatedObject(object, self.identifier, proxy, .OBJC_ASSOCIATION_RETAIN)
}
}
@@ -220,6 +220,9 @@ extension ObservableType {
fatalError()
}
}
#endif

#if os(iOS) && !targetEnvironment(UIKitForMac)
extension UIWebView {
@available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory")
public func createRxDelegateProxy() -> RxWebViewDelegateProxy {
@@ -202,7 +202,7 @@ extension Reactive where Base: AnyObject {
}
}

fileprivate func registerMessageInterceptor<T: MessageInterceptorSubject>(_ selector: Selector) throws -> T {
private func registerMessageInterceptor<T: MessageInterceptorSubject>(_ selector: Selector) throws -> T {
let rxSelector = RX_selector(selector)
let selectorReference = RX_reference_from_selector(rxSelector)

@@ -251,7 +251,7 @@ extension Reactive where Base: AnyObject {
var targetImplementation: IMP { get set }
}

fileprivate final class DeallocatingProxy
private final class DeallocatingProxy
: MessageInterceptorSubject
, RXDeallocatingObserver {
typealias Element = ()
@@ -276,7 +276,7 @@ extension Reactive where Base: AnyObject {
}
}

fileprivate final class MessageSentProxy
private final class MessageSentProxy
: MessageInterceptorSubject
, RXMessageSentObserver {
typealias Element = [AnyObject]
@@ -310,7 +310,7 @@ extension Reactive where Base: AnyObject {
#endif


fileprivate final class DeallocObservable {
private final class DeallocObservable {
let _subject = ReplaySubject<Void>.create(bufferSize:1)

init() {
@@ -333,7 +333,7 @@ private protocol KVOObservableProtocol {
var options: KeyValueObservingOptions { get }
}

fileprivate final class KVOObserver
private final class KVOObserver
: _RXKVOObserver
, Disposable {
typealias Callback = (Any?) -> Void
@@ -361,7 +361,7 @@ fileprivate final class KVOObserver
}
}

fileprivate final class KVOObservable<Element>
private final class KVOObservable<Element>
: ObservableType
, KVOObservableProtocol {
typealias Element = Element?
@@ -397,7 +397,7 @@ fileprivate final class KVOObservable<Element>

}

fileprivate extension KeyValueObservingOptions {
private extension KeyValueObservingOptions {
var nsOptions: NSKeyValueObservingOptions {
var result: UInt = 0
if self.contains(.new) {
@@ -438,7 +438,7 @@ fileprivate extension KeyValueObservingOptions {
return properyRuntimeInfo.range(of: ",W,") != nil
}

fileprivate extension ObservableType where Element == AnyObject? {
private extension ObservableType where Element == AnyObject? {
func finishWithNilWhenDealloc(_ target: NSObject)
-> Observable<AnyObject?> {
let deallocating = target.rx.deallocating
@@ -60,7 +60,7 @@ private func escapeTerminalString(_ value: String) -> String {
return value.replacingOccurrences(of: "\"", with: "\\\"", options:[], range: nil)
}

fileprivate func convertURLRequestToCurlCommand(_ request: URLRequest) -> String {
private func convertURLRequestToCurlCommand(_ request: URLRequest) -> String {
let method = request.httpMethod ?? "GET"
var returnValue = "curl -X \(method) "

@@ -37,8 +37,8 @@ public struct SharedSequence<SharingStrategy: SharingStrategyProtocol, Element>
By defining `EXPANDABLE_SHARED_SEQUENCE` one agrees that it's up to him to ensure shared sequence
properties are preserved after extension.
*/
public static func createUnsafe<Source: ObservableType>(source: Source) -> SharedSequence<Sequence, Source.Element> {
return SharedSequence<Sequence, Source.Element>(raw: source.asObservable())
public static func createUnsafe<Source: ObservableType>(source: Source) -> SharedSequence<SharingStrategy, Source.Element> {
return SharedSequence<SharingStrategy, Source.Element>(raw: source.asObservable())
}
#endif

@@ -17,10 +17,10 @@ extension UICollectionView: HasPrefetchDataSource {
}

@available(iOS 10.0, tvOS 10.0, *)
fileprivate let collectionViewPrefetchDataSourceNotSet = CollectionViewPrefetchDataSourceNotSet()
private let collectionViewPrefetchDataSourceNotSet = CollectionViewPrefetchDataSourceNotSet()

@available(iOS 10.0, tvOS 10.0, *)
fileprivate final class CollectionViewPrefetchDataSourceNotSet
private final class CollectionViewPrefetchDataSourceNotSet
: NSObject
, UICollectionViewDataSourcePrefetching {

@@ -48,7 +48,7 @@ open class RxCollectionViewDataSourcePrefetchingProxy
self.register { RxCollectionViewDataSourcePrefetchingProxy(collectionView: $0) }
}

fileprivate var _prefetchItemsPublishSubject: PublishSubject<[IndexPath]>?
private var _prefetchItemsPublishSubject: PublishSubject<[IndexPath]>?

/// Optimized version used for observing prefetch items callbacks.
internal var prefetchItemsPublishSubject: PublishSubject<[IndexPath]> {
@@ -15,9 +15,9 @@ extension UICollectionView: HasDataSource {
public typealias DataSource = UICollectionViewDataSource
}

fileprivate let collectionViewDataSourceNotSet = CollectionViewDataSourceNotSet()
private let collectionViewDataSourceNotSet = CollectionViewDataSourceNotSet()

fileprivate final class CollectionViewDataSourceNotSet
private final class CollectionViewDataSourceNotSet
: NSObject
, UICollectionViewDataSource {

@@ -38,8 +38,8 @@ open class RxScrollViewDelegateProxy
self.register { RxTextViewDelegateProxy(textView: $0) }
}

fileprivate var _contentOffsetBehaviorSubject: BehaviorSubject<CGPoint>?
fileprivate var _contentOffsetPublishSubject: PublishSubject<()>?
private var _contentOffsetBehaviorSubject: BehaviorSubject<CGPoint>?
private var _contentOffsetPublishSubject: PublishSubject<()>?

/// Optimized version used for observing content offset changes.
internal var contentOffsetBehaviorSubject: BehaviorSubject<CGPoint> {
@@ -17,10 +17,10 @@ extension UITableView: HasPrefetchDataSource {
}

@available(iOS 10.0, tvOS 10.0, *)
fileprivate let tableViewPrefetchDataSourceNotSet = TableViewPrefetchDataSourceNotSet()
private let tableViewPrefetchDataSourceNotSet = TableViewPrefetchDataSourceNotSet()

@available(iOS 10.0, tvOS 10.0, *)
fileprivate final class TableViewPrefetchDataSourceNotSet
private final class TableViewPrefetchDataSourceNotSet
: NSObject
, UITableViewDataSourcePrefetching {

@@ -48,7 +48,7 @@ open class RxTableViewDataSourcePrefetchingProxy
self.register { RxTableViewDataSourcePrefetchingProxy(tableView: $0) }
}

fileprivate var _prefetchRowsPublishSubject: PublishSubject<[IndexPath]>?
private var _prefetchRowsPublishSubject: PublishSubject<[IndexPath]>?

/// Optimized version used for observing prefetch rows callbacks.
internal var prefetchRowsPublishSubject: PublishSubject<[IndexPath]> {
@@ -15,9 +15,9 @@ extension UITableView: HasDataSource {
public typealias DataSource = UITableViewDataSource
}

fileprivate let tableViewDataSourceNotSet = TableViewDataSourceNotSet()
private let tableViewDataSourceNotSet = TableViewDataSourceNotSet()

fileprivate final class TableViewDataSourceNotSet
private final class TableViewDataSourceNotSet
: NSObject
, UITableViewDataSource {

@@ -50,7 +50,7 @@ open class RxTableViewDataSourceProxy
self.register { RxTableViewDataSourceProxy(tableView: $0) }
}

fileprivate weak var _requiredMethodsDataSource: UITableViewDataSource? = tableViewDataSourceNotSet
private weak var _requiredMethodsDataSource: UITableViewDataSource? = tableViewDataSourceNotSet

// MARK: delegate
@@ -6,7 +6,7 @@
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
#if os(iOS)
#if os(iOS) && !targetEnvironment(UIKitForMac)

import UIKit
import RxSwift
@@ -11,7 +11,7 @@
import UIKit
import RxSwift

fileprivate var rx_tap_key: UInt8 = 0
private var rx_tap_key: UInt8 = 0

extension Reactive where Base: UIBarButtonItem {

@@ -6,7 +6,7 @@
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
#if os(iOS)
#if os(iOS) && !targetEnvironment(UIKitForMac)

import UIKit
import RxSwift
@@ -207,15 +207,15 @@ extension Reactive where Base: CLLocationManager {
}


fileprivate func castOrThrow<T>(_ resultType: T.Type, _ object: Any) throws -> T {
private func castOrThrow<T>(_ resultType: T.Type, _ object: Any) throws -> T {
guard let returnValue = object as? T else {
throw RxCocoaError.castingError(object: object, targetType: resultType)
}

return returnValue
}

fileprivate func castOptionalOrThrow<T>(_ resultType: T.Type, _ object: Any) throws -> T? {
private func castOptionalOrThrow<T>(_ resultType: T.Type, _ object: Any) throws -> T? {
if NSNull().isEqual(object) {
return nil
}
@@ -39,7 +39,7 @@

#endif

fileprivate func castOrThrow<T>(_ resultType: T.Type, _ object: Any) throws -> T {
private func castOrThrow<T>(_ resultType: T.Type, _ object: Any) throws -> T {
guard let returnValue = object as? T else {
throw RxCocoaError.castingError(object: object, targetType: resultType)
}

0 comments on commit de5a6bc

Please sign in to comment.
You can’t perform that action at this time.