Compare commits
329 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
8b07d0cbde | |
|
|
2969fbe70d | |
|
|
6ed8c6c00d | |
|
|
de28113c06 | |
|
|
08501da396 | |
|
|
e85b3203bc | |
|
|
900035d78b | |
|
|
ef71ba9f20 | |
|
|
72122e3e43 | |
|
|
87b792e54d | |
|
|
8cebcd786f | |
|
|
7208a8d1cc | |
|
|
e1f72cb566 | |
|
|
154ac2583d | |
|
|
136322ab6a | |
|
|
24c4587b51 | |
|
|
22219781a5 | |
|
|
48bb9fcba5 | |
|
|
7f43e1eecd | |
|
|
f8d8c45f10 | |
|
|
92d4bdf5e1 | |
|
|
ff6e4fd651 | |
|
|
b68fc4260e | |
|
|
c9742e51b6 | |
|
|
1f363cea2e | |
|
|
83f3323ed8 | |
|
|
278c681753 | |
|
|
9b1f22e6a0 | |
|
|
9473953b65 | |
|
|
1998e54085 | |
|
|
94d6c01e3b | |
|
|
a4f15128bf | |
|
|
5610073ca9 | |
|
|
9ce054936d | |
|
|
4bd842301b | |
|
|
0fe4c9a792 | |
|
|
b9b593d740 | |
|
|
6763f1a4b7 | |
|
|
d43e717415 | |
|
|
819635d9aa | |
|
|
b0026d65eb | |
|
|
695ea19e02 | |
|
|
e55c6675f4 | |
|
|
301ad9f438 | |
|
|
047c77a698 | |
|
|
a2be331fee | |
|
|
2d36297601 | |
|
|
c12b315149 | |
|
|
74464a4940 | |
|
|
fcf8e4d092 | |
|
|
43c0b952ec | |
|
|
96ef70cc2f | |
|
|
7adc86f7d2 | |
|
|
cbb0ed5d29 | |
|
|
e2f4bad2bb | |
|
|
7f65914f93 | |
|
|
e59adc3ae9 | |
|
|
e4e422c4f1 | |
|
|
4f54c9bf5a | |
|
|
8b00921da7 | |
|
|
bdbcb5bc87 | |
|
|
55f4bb3b65 | |
|
|
f1b4e0f6b7 | |
|
|
f8a11aa0cb | |
|
|
8754166f35 | |
|
|
75971c61c6 | |
|
|
c643d4c0b5 | |
|
|
64526c8dcd | |
|
|
1fe15bb9da | |
|
|
a981d4caab | |
|
|
6d17e711ab | |
|
|
341ef8fc3b | |
|
|
2812da1f5e | |
|
|
2498b3194d | |
|
|
2e4b6990e8 | |
|
|
6eda820476 | |
|
|
2df8c43077 | |
|
|
ac876f35db | |
|
|
0058d2ff67 | |
|
|
23ae9692e7 | |
|
|
eb646a97a6 | |
|
|
b0a819981b | |
|
|
d3eacdfcb5 | |
|
|
dbc635d6e7 | |
|
|
cb5d23c757 | |
|
|
38e5a500c7 | |
|
|
6887745089 | |
|
|
e530858bd0 | |
|
|
10ff55cfba | |
|
|
46286d3291 | |
|
|
aef4e69339 | |
|
|
3637153169 | |
|
|
8a58deaa2b | |
|
|
441a4a22db | |
|
|
d1cde77b18 | |
|
|
afd40f5d8b | |
|
|
1b0e0a3c88 | |
|
|
10b0d39e05 | |
|
|
091b12242a | |
|
|
4b602fd88e | |
|
|
2f06600985 | |
|
|
8e01b2ffe4 | |
|
|
9c14b7fde1 | |
|
|
03d6950bf1 | |
|
|
7b6a244f45 | |
|
|
e2c3330d61 | |
|
|
208a84db0f | |
|
|
0b1856d43e | |
|
|
58e427b045 | |
|
|
a2ee04e721 | |
|
|
38c45c066d | |
|
|
01d86ff684 | |
|
|
2ead37809e | |
|
|
72e5488631 | |
|
|
21a56a8ebd | |
|
|
a9d0cfeb5b | |
|
|
7f84ec604e | |
|
|
bfb9441414 | |
|
|
3b34850675 | |
|
|
c844b6bdb3 | |
|
|
dffd6f0e1c | |
|
|
544e00d917 | |
|
|
490b6cbbc5 | |
|
|
b1c6673da7 | |
|
|
372d766519 | |
|
|
40eb452040 | |
|
|
99e21bdb46 | |
|
|
d12b8321d2 | |
|
|
f303efb077 | |
|
|
181a94bbc9 | |
|
|
fa14592a2b | |
|
|
61420eef9f | |
|
|
fbee131886 | |
|
|
2cb931d8e9 | |
|
|
0c8d28b1b6 | |
|
|
1301e9925a | |
|
|
070907471c | |
|
|
f3f2b0e083 | |
|
|
e79457dcd3 | |
|
|
824f23c94e | |
|
|
5c908f18b8 | |
|
|
d4981303b5 | |
|
|
7c2f20cf36 | |
|
|
cba021a961 | |
|
|
9cac0cc234 | |
|
|
b47ce13eae | |
|
|
1124f40ef1 | |
|
|
03fae9de6f | |
|
|
996caf6917 | |
|
|
a1b34f0f50 | |
|
|
125deae0c8 | |
|
|
8e46d377da | |
|
|
348ce89e17 | |
|
|
e222e52223 | |
|
|
edf423d42e | |
|
|
e2edffc39d | |
|
|
6770c8a4c0 | |
|
|
bce8e9cd2d | |
|
|
a64c07d1e1 | |
|
|
7cc3dab5cb | |
|
|
6757b82872 | |
|
|
d40557bbd7 | |
|
|
987afd4a92 | |
|
|
14fa47c623 | |
|
|
7e2a492895 | |
|
|
b7cd7ba56c | |
|
|
cfb8b1558a | |
|
|
95ee9d0de8 | |
|
|
ca831c7321 | |
|
|
56e09abb11 | |
|
|
1633a4192e | |
|
|
f51151c3d2 | |
|
|
2787393621 | |
|
|
5c0ce0a1c8 | |
|
|
bce72a2617 | |
|
|
68b5ae3e4c | |
|
|
f86d12a53b | |
|
|
88f718ffc3 | |
|
|
e20ac5fbb7 | |
|
|
2d50bc135c | |
|
|
17f8aac437 | |
|
|
f95b1ed122 | |
|
|
7e17ca9fde | |
|
|
6b031f97bd | |
|
|
c0939e1b4e | |
|
|
e3d2305a8f | |
|
|
5b95007fba | |
|
|
d1916b4a19 | |
|
|
98cf430382 | |
|
|
c33d5806fd | |
|
|
45b8b32b35 | |
|
|
8989ea3a0a | |
|
|
ad96d6b0e1 | |
|
|
5a9771e818 | |
|
|
62bd1d5498 | |
|
|
bbea37dcda | |
|
|
b72a2ce86d | |
|
|
67160ee0dc | |
|
|
76a63104fa | |
|
|
5a566ae183 | |
|
|
e730955869 | |
|
|
1a289e97fd | |
|
|
e4219c8423 | |
|
|
d48dff3a4f | |
|
|
c50efe34c7 | |
|
|
0815ea5c96 | |
|
|
fc0fdb4850 | |
|
|
7ec1ffc935 | |
|
|
7089f6d7de | |
|
|
f72cc12b94 | |
|
|
37560a734e | |
|
|
933cb02cb0 | |
|
|
ada55ed8e5 | |
|
|
5bf319adda | |
|
|
7a15347943 | |
|
|
c51f4f3b95 | |
|
|
c719c8cf86 | |
|
|
5d47db7609 | |
|
|
7ff150aafc | |
|
|
5a9f47262a | |
|
|
db4c04dcea | |
|
|
9287bebd10 | |
|
|
924a9a4983 | |
|
|
8d5b85306d | |
|
|
bc86d47a3f | |
|
|
a5f19de922 | |
|
|
8ce99d1219 | |
|
|
8bad8e547f | |
|
|
ced6ce3a7e | |
|
|
ff0d588189 | |
|
|
c35136fe0b | |
|
|
39a20441e1 | |
|
|
c4cf2e0d12 | |
|
|
0e38ecbc87 | |
|
|
9b1583f2e3 | |
|
|
079ab269c0 | |
|
|
8797a05a0e | |
|
|
95900ef394 | |
|
|
390e0d79e5 | |
|
|
087456aed3 | |
|
|
96b269dc5f | |
|
|
c038e7bb84 | |
|
|
9fed8676aa | |
|
|
d59b050eda | |
|
|
58a66df1d9 | |
|
|
e1040cfcf8 | |
|
|
56e6d09b0f | |
|
|
49ccdac810 | |
|
|
7fbbebe404 | |
|
|
c52090aee2 | |
|
|
49e9057d28 | |
|
|
34d35c1560 | |
|
|
b0bb65306b | |
|
|
902a659097 | |
|
|
6d84f30338 | |
|
|
3ebb38c681 | |
|
|
ab4c845d46 | |
|
|
b37f3f5bb6 | |
|
|
fbca0957c0 | |
|
|
7c706713b5 | |
|
|
0686b9a045 | |
|
|
e464c369dc | |
|
|
a121867280 | |
|
|
e45d3be7fd | |
|
|
9e2e7abf88 | |
|
|
0514c03963 | |
|
|
e291bff0f0 | |
|
|
e3a87c8801 | |
|
|
e26bce70af | |
|
|
f86e946f8f | |
|
|
ae9c8e3fd9 | |
|
|
dee4a93ccb | |
|
|
645b93c3e4 | |
|
|
2fdb6a6d81 | |
|
|
a9fafcee41 | |
|
|
52c6e6dc31 | |
|
|
3fd15897ce | |
|
|
00e0f5e689 | |
|
|
aba717b642 | |
|
|
c6ae73f9ce | |
|
|
bb4052fb1b | |
|
|
bdb09885c2 | |
|
|
75d1983afc | |
|
|
db62a3cf3f | |
|
|
d2eec7c478 | |
|
|
a5f1d1eef7 | |
|
|
6b038ad039 | |
|
|
0e75ad3cf0 | |
|
|
e902c8b7f6 | |
|
|
c742831992 | |
|
|
38f5eb210f | |
|
|
eeabccf348 | |
|
|
d1713a8ac5 | |
|
|
31ebe46a16 | |
|
|
d1393da8eb | |
|
|
94833e438d | |
|
|
3693809b34 | |
|
|
e1bfa8c7ea | |
|
|
5269932678 | |
|
|
cf2433e665 | |
|
|
a2b00547b8 | |
|
|
45133039c3 | |
|
|
eda25e28ff | |
|
|
607ebfbf3d | |
|
|
4b3056b81f | |
|
|
185f66af90 | |
|
|
45042307ac | |
|
|
66230b7afe | |
|
|
e61b62d64f | |
|
|
b1dd82e831 | |
|
|
49b1481dff | |
|
|
43269fa279 | |
|
|
af7c011a53 | |
|
|
c4e83f3f34 | |
|
|
0188dccd4f | |
|
|
b8ecb446d8 | |
|
|
490118fdad | |
|
|
a4ae75d03f | |
|
|
37d685690c | |
|
|
3a57927a92 | |
|
|
b384c3e982 | |
|
|
7622d9c5b7 | |
|
|
c11c7a8f97 | |
|
|
4e6880d218 | |
|
|
1b5cd9ecb5 | |
|
|
c4ca775bdc | |
|
|
56119d3e91 | |
|
|
2c7a403dae | |
|
|
8b4642a1c0 |
|
|
@ -0,0 +1,278 @@
|
|||
---
|
||||
custom_categories:
|
||||
- name: RxSwift
|
||||
children:
|
||||
- AnyObserver
|
||||
- Cancelable
|
||||
- ConnectableObservableType
|
||||
- Disposable
|
||||
- Errors
|
||||
- Event
|
||||
- ImmediateSchedulerType
|
||||
- Observable+Extensions
|
||||
- Observable
|
||||
- ObservableConvertibleType
|
||||
- ObservableType
|
||||
- ObserverType
|
||||
- Rx
|
||||
- RxMutableBox
|
||||
- SchedulerType
|
||||
- name: RxSwift/Concurrency
|
||||
children:
|
||||
- AsyncLock
|
||||
- Lock
|
||||
- LockOwnerType
|
||||
- SynchronizedDisposeType
|
||||
- SynchronizedOnType
|
||||
- SynchronizedSubscribeType
|
||||
- SynchronizedUnsubscribeType
|
||||
- name: RxSwift/DataStructures
|
||||
children:
|
||||
- Bag
|
||||
- InfiniteSequence
|
||||
- PriorityQueue
|
||||
- Queue
|
||||
- name: RxSwift/Disposables
|
||||
children:
|
||||
- AnonymousDisposable
|
||||
- BinaryDisposable
|
||||
- BooleanDisposable
|
||||
- CompositeDisposable
|
||||
- DisposeBag
|
||||
- DisposeBase
|
||||
- NAryDisposable
|
||||
- NopDisposable
|
||||
- RefCountDisposable
|
||||
- ScheduledDisposable
|
||||
- SerialDisposable
|
||||
- SingleAssignmentDisposable
|
||||
- StableCompositeDisposable
|
||||
- SubscriptionDisposable
|
||||
- name: RxSwift/Extensions
|
||||
children:
|
||||
- String+Rx
|
||||
- name: RxSwift/Observables/Implementations
|
||||
children:
|
||||
- AddRef
|
||||
- Amb
|
||||
- AnonymousObservable
|
||||
- Buffer
|
||||
- Catch
|
||||
- CombineLatest+arity
|
||||
- CombineLatest+CollectionType
|
||||
- CombineLatest
|
||||
- Concat
|
||||
- ConnectableObservable
|
||||
- Debug
|
||||
- Deferred
|
||||
- DelaySubscription
|
||||
- DistinctUntilChanged
|
||||
- Do
|
||||
- ElementAt
|
||||
- Empty
|
||||
- Error
|
||||
- Filter
|
||||
- Generate
|
||||
- Just
|
||||
- Map
|
||||
- Merge
|
||||
- Multicast
|
||||
- Never
|
||||
- ObserveOn
|
||||
- ObserveOnSerialDispatchQueue
|
||||
- Producer
|
||||
- Range
|
||||
- Reduce
|
||||
- RefCount
|
||||
- Repeat
|
||||
- RetryWhen
|
||||
- Sample
|
||||
- Scan
|
||||
- Sequence
|
||||
- ShareReplay1
|
||||
- ShareReplay1WhileConnected
|
||||
- SingleAsync
|
||||
- Sink
|
||||
- Skip
|
||||
- SkipUntil
|
||||
- SkipWhile
|
||||
- StartWith
|
||||
- SubscribeOn
|
||||
- Switch
|
||||
- Take
|
||||
- TakeLast
|
||||
- TakeUntil
|
||||
- TakeWhile
|
||||
- Throttle
|
||||
- Timeout
|
||||
- Timer
|
||||
- ToArray
|
||||
- Using
|
||||
- Window
|
||||
- WithLatestFrom
|
||||
- Zip+arity
|
||||
- Zip+CollectionType
|
||||
- Zip
|
||||
- name: RxSwift/Observables
|
||||
children:
|
||||
- Observable+Aggregate
|
||||
- Observable+Binding
|
||||
- Observable+Concurrency
|
||||
- Observable+Creation
|
||||
- Observable+Debug
|
||||
- Observable+Multiple
|
||||
- Observable+Single
|
||||
- Observable+StandardSequenceOperators
|
||||
- Observable+Time
|
||||
- name: RxSwift/Observers
|
||||
children:
|
||||
- AnonymousObserver
|
||||
- ObserverBase
|
||||
- TailRecursiveSink
|
||||
- name: RxSwift/Platform
|
||||
children:
|
||||
- Platform.Darwin
|
||||
- Platform.Linux
|
||||
- name: RxSwift/Schedulers
|
||||
children:
|
||||
- ConcurrentDispatchQueueScheduler
|
||||
- ConcurrentMainScheduler
|
||||
- CurrentThreadScheduler
|
||||
- DispatchQueueSchedulerQOS
|
||||
- HistoricalScheduler
|
||||
- HistoricalSchedulerTimeConverter
|
||||
- ImmediateScheduler
|
||||
- MainScheduler
|
||||
- OperationQueueScheduler
|
||||
- RecursiveScheduler
|
||||
- SchedulerServices+Emulation
|
||||
- SerialDispatchQueueScheduler
|
||||
- VirtualTimeConverterType
|
||||
- VirtualTimeScheduler
|
||||
- name: RxSwift/Schedulers/Internal
|
||||
children:
|
||||
- AnonymousInvocable
|
||||
- InvocableScheduledItem
|
||||
- InvocableType
|
||||
- ScheduledItem
|
||||
- ScheduledItemType
|
||||
- name: RxSwift/Subjects
|
||||
children:
|
||||
- BehaviorSubject
|
||||
- PublishSubject
|
||||
- ReplaySubject
|
||||
- SubjectType
|
||||
- Variable
|
||||
- name: RxCocoa/Common
|
||||
children:
|
||||
- CLLocationManager+Rx
|
||||
- DelegateProxy
|
||||
- DelegateProxyType
|
||||
- KVORepresentable+CoreGraphics
|
||||
- KVORepresentable+Swift
|
||||
- KVORepresentable
|
||||
- Logging
|
||||
- NSLayoutConstraint+Rx
|
||||
- Observable+Bind
|
||||
- Reactive
|
||||
- RxCocoa
|
||||
- RxTarget
|
||||
- RxTextInput
|
||||
- SectionedViewDataSourceType
|
||||
- name: RxCocoa/Common/CocoaUnits
|
||||
children:
|
||||
- ControlEvent
|
||||
- ControlProperty
|
||||
- UIBindingObserver
|
||||
- name: RxCocoa/Common/CocoaUnits/Driver
|
||||
children:
|
||||
- ControlEvent+Driver
|
||||
- ControlProperty+Driver
|
||||
- Driver+Operators+arity
|
||||
- Driver+Operators
|
||||
- Driver+Subscription
|
||||
- Driver
|
||||
- ObservableConvertibleType+Driver
|
||||
- Variable+Driver
|
||||
- name: RxCocoa/Common/Observables/Implementations
|
||||
children:
|
||||
- ControlTarget
|
||||
- DeallocObservable
|
||||
- KVOObservable
|
||||
- KVOObserver
|
||||
- MessageSentObserver
|
||||
- name: RxCocoa/Common/Observables
|
||||
children:
|
||||
- NSNotificationCenter+Rx
|
||||
- NSObject+Rx+KVORepresentable
|
||||
- NSObject+Rx+RawRepresentable
|
||||
- NSObject+Rx
|
||||
- NSURLSession+Rx
|
||||
- name: RxCocoa/Common/Proxies
|
||||
children:
|
||||
- RxCLLocationManagerDelegateProxy
|
||||
- name: RxCocoa/iOS/DataSources
|
||||
children:
|
||||
- RxCollectionViewReactiveArrayDataSource
|
||||
- RxTableViewReactiveArrayDataSource
|
||||
- name: RxCocoa/iOS/Events
|
||||
children:
|
||||
- ItemEvents
|
||||
- name: RxCocoa/iOS
|
||||
children:
|
||||
- NSTextStorage+Rx
|
||||
- UIActivityIndicatorView+Rx
|
||||
- UIAlertAction+Rx
|
||||
- UIApplication+Rx
|
||||
- UIBarButtonItem+Rx
|
||||
- UIButton+Rx
|
||||
- UICollectionView+Rx
|
||||
- UIControl+Rx
|
||||
- UIDatePicker+Rx
|
||||
- UIGestureRecognizer+Rx
|
||||
- UIImagePickerController+Rx
|
||||
- UIImageView+Rx
|
||||
- UILabel+Rx
|
||||
- UINavigationItem+Rx
|
||||
- UIPageControl+Rx
|
||||
- UIPickerView+Rx
|
||||
- UIProgressView+Rx
|
||||
- UIRefreshControl+Rx
|
||||
- UIScrollView+Rx
|
||||
- UISearchBar+Rx
|
||||
- UISearchController+Rx
|
||||
- UISegmentedControl+Rx
|
||||
- UISlider+Rx
|
||||
- UIStepper+Rx
|
||||
- UISwitch+Rx
|
||||
- UITabBarItem+Rx
|
||||
- UITableView+Rx
|
||||
- UITextField+Rx
|
||||
- UITextView+Rx
|
||||
- UIView+Rx
|
||||
- UIViewController+Rx
|
||||
- name: RxCocoa/iOS/Protocols
|
||||
children:
|
||||
- RxCollectionViewDataSourceType
|
||||
- RxTableViewDataSourceType
|
||||
- name: RxCocoa/iOS/Proxies
|
||||
children:
|
||||
- RxCollectionViewDataSourceProxy
|
||||
- RxCollectionViewDelegateProxy
|
||||
- RxImagePickerDelegateProxy
|
||||
- RxPickerViewDelegateProxy
|
||||
- RxScrollViewDelegateProxy
|
||||
- RxSearchBarDelegateProxy
|
||||
- RxSearchControllerDelegateProxy
|
||||
- RxTableViewDataSourceProxy
|
||||
- RxTableViewDelegateProxy
|
||||
- RxTextStorageDelegateProxy
|
||||
- RxTextViewDelegateProxy
|
||||
- name: RxCocoa/OSX
|
||||
children:
|
||||
- NSButton+Rx
|
||||
- NSControl+Rx
|
||||
- NSImageView+Rx
|
||||
- NSSlider+Rx
|
||||
- NSTextField+Rx
|
||||
- NSView+Rx
|
||||
|
|
@ -1,9 +1,13 @@
|
|||
language: objective-c
|
||||
|
||||
osx_image: xcode7.3
|
||||
osx_image: xcode8
|
||||
|
||||
notifications:
|
||||
slack: rxswift:3ykt2Z61f8GkdvhCZTYPduOL
|
||||
email: false
|
||||
|
||||
script: ./scripts/pre-release-tests.sh
|
||||
script:
|
||||
- "bundle exec danger --verbose"
|
||||
- xcodebuild -version
|
||||
- xcodebuild -showsdks
|
||||
- ./scripts/all-tests.sh
|
||||
|
|
|
|||
71
CHANGELOG.md
71
CHANGELOG.md
|
|
@ -3,6 +3,65 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
---
|
||||
|
||||
## Master
|
||||
|
||||
## [3.0.0.alpha.1](https://github.com/ReactiveX/RxSwift/releases/tag/3.0.0.alpha.1) (Xcode 8 beta 6 compatible 8S201h)
|
||||
|
||||
#### Features
|
||||
|
||||
* Modernizes API to be more consistent with Swift 3.0 API Design Guidelines
|
||||
* Replaces `rx_*` prefix with `rx.*` extensions. (Inspired by `.lazy` collections API). We've tried annotate deprecated APIs with `@available(*, deprecated, renamed: "new method")` but trivial replacements aren't annotated.
|
||||
* `rx_text` -> `rx.text`
|
||||
* `rx_tap` -> `rx.tap`
|
||||
* `rx_date` -> `rx.date`
|
||||
* ...
|
||||
* Deprecates `subscribeNext`, `subscribeError`, `subscribeCompleted` in favor of `subscribe(onNext:onError:onCompleted:onDisposed)` (The downsides of old extensions were inconsistencies with Swift API guidelines. They also weren't expressing that calling them actually performes additional subscriptions and thus potentially additional work beside just registering observers).
|
||||
* Deprecates `doOnNext`, `doOnCompleted`, `doOnError` in favor of `do(onNext:onCompleted:onError:onSubscribe:onDisposed:)`
|
||||
* Adds `onSubscribe` and `onDisposed` to `do` operator.
|
||||
* Adds namespace for immutable disposables called `Disposables`
|
||||
* Deprecates `AnonymousDisposable` in favor of `Disposables.create(with:)`
|
||||
* Deprecates `NopDisposable` in favor of `Disposables.create()`
|
||||
* Deprecates `BinaryDisposable` in favor of `Disposables.create(_:_:)`
|
||||
* Deprecates `toObservable` in favor of `Observable.from()`.
|
||||
* Replaces old javascript automation tests with Swift UI Tests.
|
||||
* ...
|
||||
|
||||
#### Anomalies
|
||||
|
||||
* There is a problem using `UISwitch` extensions because it seems that a bug exists in UIKit that causes all `UISwitch` instances to leak. https://github.com/ReactiveX/RxSwift/issues/842
|
||||
|
||||
## [2.6.0](https://github.com/ReactiveX/RxSwift/releases/tag/2.6.0)
|
||||
|
||||
#### Features
|
||||
|
||||
* Adds Swift 2.3 compatibility.
|
||||
* Adds `UIViewController.rx_title` extension.
|
||||
* Adds `UIScrollView.rx_scrollEnabled` extension.
|
||||
* Resolve static analysis issues relating to non-use of an assigned value, and potential null dereferences in RxCocoa's Objective-C classes.
|
||||
* Changes `forwardDelegate` property type on `DelegateProxy` from `assign` to `weak`.
|
||||
* Simplifies UITable/CollectionView data source generic parameters.
|
||||
* Adds simple usage examples to UITable/CollectionView data source extensions.
|
||||
* Documents UITable/CollectionView data source extensions memory management and adds unit tests to cover that documentation.
|
||||
* Adds `.jazzy.yml`
|
||||
* Adds `UITabBar` extensions and delegate proxy wrapper
|
||||
* rx_didSelectItem
|
||||
* rx_willBeginCustomizing
|
||||
* rx_didBeginCustomizing
|
||||
* rx_willEndCustomizing
|
||||
* rx_didEndCustomizing
|
||||
* Adds `UIPickerView` delegate proxy and extensions:
|
||||
* rx_itemSelected
|
||||
* Adds `UIAlertAction.rx_enabled` extension.
|
||||
* Adds `UIButton.rx_title(controlState: UIControlState = .Normal)` extension.
|
||||
* Adds `UIPageControl.rx_currentPage` extension.
|
||||
* Adds `hasObservers` property to `*Subject`.
|
||||
|
||||
#### Anomalies
|
||||
|
||||
* Fixes problem with UITable/CollectionView releasing of data sources when result subscription disposable wasn't retained.
|
||||
* Fixes all Xcode analyzer warnings
|
||||
|
||||
|
||||
## [2.5.0](https://github.com/ReactiveX/RxSwift/releases/tag/2.5.0)
|
||||
|
||||
#### Features
|
||||
|
|
@ -84,12 +143,12 @@ All notable changes to this project will be documented in this file.
|
|||
This is example of those changes:
|
||||
|
||||
```swift
|
||||
- public func rx_itemsWithCellFactory<S : SequenceType, O : ObservableType where O.E == S>
|
||||
- public func rx_itemsWithCellFactory<S : Sequence, O : ObservableType where O.E == S>
|
||||
(source: O)
|
||||
(cellFactory: (UITableView, Int, S.Generator.Element) -> UITableViewCell) -> Disposable
|
||||
+ public func rx_itemsWithCellFactory<S : SequenceType, O : ObservableType where O.E == S>
|
||||
(cellFactory: (UITableView, Int, S.Iterator.Element) -> UITableViewCell) -> Disposable
|
||||
+ public func rx_itemsWithCellFactory<S : Sequence, O : ObservableType where O.E == S>
|
||||
(source: O)
|
||||
-> (cellFactory: (UITableView, Int, S.Generator.Element) -> UITableViewCell) -> Disposable
|
||||
-> (cellFactory: (UITableView, Int, S.Iterator.Element) -> UITableViewCell) -> Disposable
|
||||
```
|
||||
|
||||
* Fixes anomaly in `CLLocationManager` extensions
|
||||
|
|
@ -361,7 +420,7 @@ let (
|
|||
* `NSURLSession` extensions now return `Observable<(NSData!, NSHTTPURLResponse)>` instead of `Observable<(NSData!, NSURLResponse!)>`.
|
||||
* Optimizes consecutive map operators. For example `map(validate1).map(validate2).map(parse)` is now internally optimized to one `map` operator.
|
||||
* Adds overloads for `just`, `sequenceOf`, `toObservable` that accept scheduler.
|
||||
* Deprecates `asObservable` extension of `SequenceType` in favor of `toObservable`.
|
||||
* Deprecates `asObservable` extension of `Sequence` in favor of `toObservable`.
|
||||
* Adds `toObservable` extension to `Array`.
|
||||
* Improves table view animated data source example.
|
||||
* Polishing of `RxDataSourceStarterKit`
|
||||
|
|
@ -473,7 +532,7 @@ let (
|
|||
* Renames `ScopedDispose` to `ScopedDisposable`
|
||||
* Deprecates `observeSingleOn` in favor of `observeOn`
|
||||
* Adds inline documentation
|
||||
* Renames `from` to `asObservable` extension method on `SequenceType`
|
||||
* Renames `from` to `asObservable` extension method on `Sequence`
|
||||
* Renames `catchErrorResumeNext` in favor of `catchErrorJustReturn`
|
||||
* Deprecates `catchErrorToResult`, the preferred way is to use Swift `do/try/catch` mechanism.
|
||||
* Deprecates `RxResult`, the preferred way is to use Swift `do/try/catch` mechanism.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting one of the project maintainers https://github.com/ReactiveX/RxSwift/graphs/contributors. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
|
|
@ -13,6 +13,14 @@ So what does this mean in practice:
|
|||
* Please target your PR to **develop** branch
|
||||
* If you want to make a bigger contribution to the project, please [open an issue first](https://github.com/ReactiveX/RxSwift/issues/new) so we can plan that work, discuss the architecture and brainstorm around that idea first.
|
||||
|
||||
## Submitting a Pull Request
|
||||
|
||||
Before submitting a pull request please make sure **`./scripts/all-tests.sh`** is passing (exits with 0), otherwise we won't be able to pull your code.
|
||||
|
||||
To be able to run `./scripts/all-tests.sh`, you'll need to install [xcpretty](https://github.com/supermarin/xcpretty).
|
||||
|
||||
`sudo gem install xcpretty`
|
||||
|
||||
## Developer's Certificate of Origin 1.1
|
||||
|
||||
By making a contribution to this project, I certify that:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
# Warn about develop branch
|
||||
current_branch = env.request_source.pr_json["base"]["ref"]
|
||||
warn("Please target PRs to `develop` branch") if current_branch != "develop" && current_branch != "swift-3.0"
|
||||
|
||||
# Sometimes it's a README fix, or something like that - which isn't relevant for
|
||||
# including in a project's CHANGELOG for example
|
||||
declared_trivial = pr_title.include? "#trivial"
|
||||
|
||||
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
|
||||
warn("PR is classed as Work in Progress") if pr_title.include? "[WIP]"
|
||||
|
||||
# Warn no CHANGELOG
|
||||
warn("No CHANGELOG changes made") if lines_of_code > 50 && !modified_files.include?("CHANGELOG.yml") && !declared_trivial
|
||||
|
||||
# Warn pod spec changes
|
||||
warn("RxCocoa.podspec changed") if modified_files.include?("RxCocoa.podspec")
|
||||
warn("RxSwift.podspec changed") if modified_files.include?("RxSwift.podspec")
|
||||
warn("RxTests.podspec changed") if modified_files.include?("RxTests.podspec")
|
||||
warn("RxBlocking.podspec changed") if modified_files.include?("RxBlocking.podspec")
|
||||
|
||||
# Warn summary on pull request
|
||||
if pr_body.length < 5
|
||||
warn "Please provide a summary in the Pull Request description"
|
||||
end
|
||||
|
||||
# If these are all empty something has gone wrong, better to raise it in a comment
|
||||
if modified_files.empty? && added_files.empty? && deleted_files.empty?
|
||||
fail "This PR has no changes at all, this is likely a developer issue."
|
||||
end
|
||||
|
||||
# Warn when there is a big PR
|
||||
warn("Big PR") if lines_of_code > 500
|
||||
|
||||
|
|
@ -102,13 +102,13 @@ Creating new operators is also pretty straightforward.
|
|||
|
||||
```swift
|
||||
|
||||
extension NSObject {
|
||||
extension Reactive where Base: NSObject {
|
||||
|
||||
public var rx_deallocated: Observable<Void> {}
|
||||
public var deallocated: Observable<Void> {}
|
||||
|
||||
#if !DISABLE_SWIZZLING
|
||||
|
||||
public var rx_deallocating: Observable<Void> {}
|
||||
public var deallocating: Observable<Void> {}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -118,9 +118,9 @@ extension NSObject {
|
|||
|
||||
|
||||
```swift
|
||||
extension NSObject {
|
||||
extension Reactive where Base: NSObject {
|
||||
|
||||
public func rx_observe<Element>(
|
||||
public func observe<Element>(
|
||||
type: E.Type,
|
||||
_ keyPath: String,
|
||||
options: NSKeyValueObservingOptions = .New | .Initial,
|
||||
|
|
@ -129,7 +129,7 @@ extension NSObject {
|
|||
|
||||
#if !DISABLE_SWIZZLING
|
||||
|
||||
public func rx_observeWeakly<Element>(
|
||||
public func observeWeakly<Element>(
|
||||
type: E.Type,
|
||||
_ keyPath: String,
|
||||
options: NSKeyValueObservingOptions = .New | .Initial
|
||||
|
|
@ -140,23 +140,23 @@ extension NSObject {
|
|||
```
|
||||
|
||||
```swift
|
||||
extension NSURLSession {
|
||||
extension Reactive where Base: NSURLSession {
|
||||
|
||||
public func rx_response(request: NSURLRequest) -> Observable<(NSData, NSURLResponse)> {}
|
||||
public func response(request: NSURLRequest) -> Observable<(NSData, NSURLResponse)> {}
|
||||
|
||||
public func rx_data(request: NSURLRequest) -> Observable<NSData> {}
|
||||
public func data(request: NSURLRequest) -> Observable<NSData> {}
|
||||
|
||||
public func rx_JSON(request: NSURLRequest) -> Observable<AnyObject> {}
|
||||
public func JSON(request: NSURLRequest) -> Observable<AnyObject> {}
|
||||
|
||||
public func rx_JSON(URL: NSURL) -> Observable<AnyObject> {}
|
||||
public func JSON(URL: NSURL) -> Observable<AnyObject> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension NSNotificationCenter {
|
||||
extension Reactive where Base: NSNotificationCenter {
|
||||
|
||||
public func rx_notification(name: String, object: AnyObject?) -> Observable<NSNotification> {}
|
||||
public func notification(name: String, object: AnyObject?) -> Observable<NSNotification> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
|
@ -170,39 +170,39 @@ class DelegateProxy {
|
|||
```
|
||||
|
||||
```swift
|
||||
extension CLLocationManager {
|
||||
extension Reactive where Base: CLLocationManager {
|
||||
|
||||
public var rx_delegate: DelegateProxy {}
|
||||
public var delegate: DelegateProxy {}
|
||||
|
||||
public var rx_didUpdateLocations: Observable<[CLLocation]> {}
|
||||
public var didUpdateLocations: Observable<[CLLocation]> {}
|
||||
|
||||
public var rx_didFailWithError: Observable<NSError> {}
|
||||
public var didFailWithError: Observable<NSError> {}
|
||||
|
||||
public var rx_didFinishDeferredUpdatesWithError: Observable<NSError> {}
|
||||
public var didFinishDeferredUpdatesWithError: Observable<NSError> {}
|
||||
|
||||
public var rx_didPauseLocationUpdates: Observable<Void> {}
|
||||
public var didPauseLocationUpdates: Observable<Void> {}
|
||||
|
||||
public var rx_didResumeLocationUpdates: Observable<Void> {}
|
||||
public var didResumeLocationUpdates: Observable<Void> {}
|
||||
|
||||
public var rx_didUpdateHeading: Observable<CLHeading> {}
|
||||
public var didUpdateHeading: Observable<CLHeading> {}
|
||||
|
||||
public var rx_didEnterRegion: Observable<CLRegion> {}
|
||||
public var didEnterRegion: Observable<CLRegion> {}
|
||||
|
||||
public var rx_didExitRegion: Observable<CLRegion> {}
|
||||
public var didExitRegion: Observable<CLRegion> {}
|
||||
|
||||
public var rx_didDetermineStateForRegion: Observable<(state: CLRegionState, region: CLRegion)> {}
|
||||
public var didDetermineStateForRegion: Observable<(state: CLRegionState, region: CLRegion)> {}
|
||||
|
||||
public var rx_monitoringDidFailForRegionWithError: Observable<(region: CLRegion?, error: NSError)> {}
|
||||
public var monitoringDidFailForRegionWithError: Observable<(region: CLRegion?, error: NSError)> {}
|
||||
|
||||
public var rx_didStartMonitoringForRegion: Observable<CLRegion> {}
|
||||
public var didStartMonitoringForRegion: Observable<CLRegion> {}
|
||||
|
||||
public var rx_didRangeBeaconsInRegion: Observable<(beacons: [CLBeacon], region: CLBeaconRegion)> {}
|
||||
public var didRangeBeaconsInRegion: Observable<(beacons: [CLBeacon], region: CLBeaconRegion)> {}
|
||||
|
||||
public var rx_rangingBeaconsDidFailForRegionWithError: Observable<(region: CLBeaconRegion, error: NSError)> {}
|
||||
public var rangingBeaconsDidFailForRegionWithError: Observable<(region: CLBeaconRegion, error: NSError)> {}
|
||||
|
||||
public var rx_didVisit: Observable<CLVisit> {}
|
||||
public var didVisit: Observable<CLVisit> {}
|
||||
|
||||
public var rx_didChangeAuthorizationStatus: Observable<CLAuthorizationStatus> {}
|
||||
public var didChangeAuthorizationStatus: Observable<CLAuthorizationStatus> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
|
@ -211,265 +211,281 @@ extension CLLocationManager {
|
|||
|
||||
```swift
|
||||
|
||||
extension UIControl {
|
||||
extension Reactive where Base: UIControl {
|
||||
|
||||
public func rx_controlEvent(controlEvents: UIControlEvents) -> ControlEvent<Void> {}
|
||||
public func controlEvent(controlEvents: UIControlEvents) -> ControlEvent<Void> {}
|
||||
|
||||
public var rx_enabled: ObserverOf<Bool> {}
|
||||
public var enabled: ObserverOf<Bool> {}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UIButton {
|
||||
extension Reactive where Base: UIButton {
|
||||
|
||||
public var rx_tap: ControlEvent<Void> {}
|
||||
public var tap: ControlEvent<Void> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UITextField {
|
||||
extension Reactive where Base: UITextField {
|
||||
|
||||
public var rx_text: ControlProperty<String> {}
|
||||
public var text: ControlProperty<String> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UITextView {
|
||||
extension Reactive where Base: UITextView {
|
||||
|
||||
override func rx_createDelegateProxy() -> RxScrollViewDelegateProxy {}
|
||||
override func createDelegateProxy() -> RxScrollViewDelegateProxy {}
|
||||
|
||||
public var rx_text: ControlProperty<String> {}
|
||||
public var text: ControlProperty<String> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UISearchBar {
|
||||
extension Reactive where Base: UISearchBar {
|
||||
|
||||
public var rx_delegate: DelegateProxy {}
|
||||
public var delegate: DelegateProxy {}
|
||||
|
||||
public var rx_searchText: ControlProperty<String> {}
|
||||
public var searchText: ControlProperty<String> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UILabel {
|
||||
extension Reactive where Base: UILabel {
|
||||
|
||||
public var rx_text: ObserverOf<String> {}
|
||||
public var text: ObserverOf<String> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UIDatePicker {
|
||||
extension Reactive where Base: UIDatePicker {
|
||||
|
||||
public var rx_date: ControlProperty<NSDate> {}
|
||||
public var date: ControlProperty<NSDate> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UIImageView {
|
||||
extension Reactive where Base: UIImageView {
|
||||
|
||||
public var rx_image: ObserverOf<UIImage!> {}
|
||||
public var image: ObserverOf<UIImage!> {}
|
||||
|
||||
public func rx_imageAnimated(transitionType: String?) -> AnyObserver<UIImage?>
|
||||
public func imageAnimated(transitionType: String?) -> AnyObserver<UIImage?>
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UIScrollView {
|
||||
extension Reactive where Base: UIScrollView {
|
||||
|
||||
public var rx_delegate: DelegateProxy {}
|
||||
public var delegate: DelegateProxy {}
|
||||
|
||||
public func rx_setDelegate(delegate: UIScrollViewDelegate) {}
|
||||
public func setDelegate(delegate: UIScrollViewDelegate) {}
|
||||
|
||||
public var rx_contentOffset: ControlProperty<CGPoint> {}
|
||||
public var contentOffset: ControlProperty<CGPoint> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UIBarButtonItem {
|
||||
extension Reactive where Base: UIBarButtonItem {
|
||||
|
||||
public var rx_tap: ControlEvent<Void> {}
|
||||
public var tap: ControlEvent<Void> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UISlider {
|
||||
extension Reactive where Base: UISlider {
|
||||
|
||||
public var rx_value: ControlProperty<Float> {}
|
||||
public var value: ControlProperty<Float> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UITableView {
|
||||
extension Reactive where Base: UITableView {
|
||||
|
||||
public var rx_dataSource: DelegateProxy {}
|
||||
public var dataSource: DelegateProxy {}
|
||||
|
||||
public func rx_setDataSource(dataSource: UITableViewDataSource) -> Disposable {}
|
||||
public func setDataSource(dataSource: UITableViewDataSource) -> Disposable {}
|
||||
|
||||
public func rx_itemsWithCellFactory(source: O)(cellFactory: (UITableView, Int, S.Generator.Element) -> UITableViewCell) -> Disposable {}
|
||||
public func itemsWithCellFactory(source: O)(cellFactory: (UITableView, Int, S.Iterator.Element) -> UITableViewCell) -> Disposable {}
|
||||
|
||||
public func rx_itemsWithCellIdentifier(cellIdentifier: String, cellType: Cell.Type = Cell.self)(source: O)(configureCell: (Int, S.Generator.Element, Cell) -> Void) -> Disposable {}
|
||||
public func itemsWithCellIdentifier(cellIdentifier: String, cellType: Cell.Type = Cell.self)(source: O)(configureCell: (Int, S.Iterator.Element, Cell) -> Void) -> Disposable {}
|
||||
|
||||
public func rx_itemsWithDataSource(dataSource: DataSource)(source: O) -> Disposable {}
|
||||
public func itemsWithDataSource(dataSource: DataSource)(source: O) -> Disposable {}
|
||||
|
||||
public var rx_itemSelected: ControlEvent<NSIndexPath> {}
|
||||
public var itemSelected: ControlEvent<IndexPath> {}
|
||||
|
||||
public var rx_itemDeselected: ControlEvent<NSIndexPath> {}
|
||||
public var itemDeselected: ControlEvent<IndexPath> {}
|
||||
|
||||
public var rx_itemInserted: ControlEvent<NSIndexPath> {}
|
||||
public var itemInserted: ControlEvent<IndexPath> {}
|
||||
|
||||
public var rx_itemDeleted: ControlEvent<NSIndexPath> {}
|
||||
public var itemDeleted: ControlEvent<IndexPath> {}
|
||||
|
||||
public var rx_itemMoved: ControlEvent<ItemMovedEvent> {}
|
||||
public var itemMoved: ControlEvent<ItemMovedEvent> {}
|
||||
|
||||
// This method only works in case one of the `rx_itemsWith*` methods was used, or data source implements `SectionedViewDataSourceType`
|
||||
public func rx_modelSelected<T>(modelType: T.Type) -> ControlEvent<T> {}
|
||||
// This method only works in case one of the `rx.itemsWith*` methods was used, or data source implements `SectionedViewDataSourceType`
|
||||
public func modelSelected<T>(modelType: T.Type) -> ControlEvent<T> {}
|
||||
|
||||
// This method only works in case one of the `rx_itemsWith*` methods was used, or data source implements `SectionedViewDataSourceType`
|
||||
public func rx_modelDeselected<T>(modelType: T.Type) -> ControlEvent<T> {}
|
||||
// This method only works in case one of the `rx.itemsWith*` methods was used, or data source implements `SectionedViewDataSourceType`
|
||||
public func modelDeselected<T>(modelType: T.Type) -> ControlEvent<T> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UICollectionView {
|
||||
extension Reactive where Base: UICollectionView {
|
||||
|
||||
public var rx_dataSource: DelegateProxy {}
|
||||
public var dataSource: DelegateProxy {}
|
||||
|
||||
public func rx_setDataSource(dataSource: UICollectionViewDataSource) -> Disposable {}
|
||||
public func setDataSource(dataSource: UICollectionViewDataSource) -> Disposable {}
|
||||
|
||||
public func rx_itemsWithCellFactory(source: O)(cellFactory: (UICollectionView, Int, S.Generator.Element) -> UICollectionViewCell) -> Disposable {}
|
||||
public func itemsWithCellFactory(source: O)(cellFactory: (UICollectionView, Int, S.Iterator.Element) -> UICollectionViewCell) -> Disposable {}
|
||||
|
||||
public func rx_itemsWithCellIdentifier(cellIdentifier: String, cellType: Cell.Type = Cell.self)(source: O)(configureCell: (Int, S.Generator.Element, Cell) -> Void) -> Disposable {}
|
||||
public func itemsWithCellIdentifier(cellIdentifier: String, cellType: Cell.Type = Cell.self)(source: O)(configureCell: (Int, S.Iterator.Element, Cell) -> Void) -> Disposable {}
|
||||
|
||||
public func rx_itemsWithDataSource(dataSource: DataSource)(source: O) -> Disposable {}
|
||||
public func itemsWithDataSource(dataSource: DataSource)(source: O) -> Disposable {}
|
||||
|
||||
public var rx_itemSelected: ControlEvent<NSIndexPath> {}
|
||||
public var itemSelected: ControlEvent<IndexPath> {}
|
||||
|
||||
public var rx_itemDeselected: ControlEvent<NSIndexPath> {}
|
||||
public var itemDeselected: ControlEvent<IndexPath> {}
|
||||
|
||||
// This method only works in case one of the `rx_itemsWith*` methods was used, or data source implements `SectionedViewDataSourceType`
|
||||
public func rx_modelSelected<T>(modelType: T.Type) -> ControlEvent<T> {}
|
||||
// This method only works in case one of the `rx.itemsWith*` methods was used, or data source implements `SectionedViewDataSourceType`
|
||||
public func modelSelected<T>(modelType: T.Type) -> ControlEvent<T> {}
|
||||
|
||||
// This method only works in case one of the `rx_itemsWith*` methods was used, or data source implements `SectionedViewDataSourceType`
|
||||
public func rx_modelSelected<T>(modelType: T.Type) -> ControlEvent<T> {}
|
||||
// This method only works in case one of the `rx.itemsWith*` methods was used, or data source implements `SectionedViewDataSourceType`
|
||||
public func modelSelected<T>(modelType: T.Type) -> ControlEvent<T> {}
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UIGestureRecognizer {
|
||||
extension Reactive where Base: UIGestureRecognizer {
|
||||
|
||||
public var rx_event: ControlEvent<UIGestureRecognizer> {}
|
||||
public var event: ControlEvent<UIGestureRecognizer> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UIImagePickerController {
|
||||
extension Reactive where Base: UIImagePickerController {
|
||||
|
||||
public var rx_didFinishPickingMediaWithInfo: Observable<[String : AnyObject]> {}
|
||||
public var didFinishPickingMediaWithInfo: Observable<[String : AnyObject]> {}
|
||||
|
||||
public var rx_didCancel: Observable<()> {}
|
||||
public var didCancel: Observable<()> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UISegmentedControl {
|
||||
extension Reactive where Base: UISegmentedControl {
|
||||
|
||||
public var rx_value: ControlProperty<Int> {}
|
||||
public var value: ControlProperty<Int> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UISwitch {
|
||||
extension Reactive where Base: UISwitch {
|
||||
|
||||
public var rx_value: ControlProperty<Bool> {}
|
||||
public var value: ControlProperty<Bool> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UIActivityIndicatorView {
|
||||
extension Reactive where Base: UIActivityIndicatorView {
|
||||
|
||||
public var rx_animating: AnyObserver<Bool> {}
|
||||
public var animating: AnyObserver<Bool> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UINavigationItem {
|
||||
extension Reactive where Base: UINavigationItem {
|
||||
|
||||
public var rx_title: AnyObserver<String?> {}
|
||||
public var title: AnyObserver<String?> {}
|
||||
}
|
||||
```
|
||||
|
||||
**OSX**
|
||||
|
||||
```swift
|
||||
extension NSControl {
|
||||
extension Reactive where Base: NSControl {
|
||||
|
||||
public var rx_controlEvent: ControlEvent<()> {}
|
||||
public var controlEvent: ControlEvent<()> {}
|
||||
|
||||
public var rx_enabled: AnyObserver<Bool> {}
|
||||
public var enabled: AnyObserver<Bool> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
|
||||
extension NSSlider {
|
||||
extension Reactive where Base: NSSlider {
|
||||
|
||||
public var rx_value: ControlProperty<Double> {}
|
||||
public var value: ControlProperty<Double> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension NSButton {
|
||||
extension Reactive where Base: NSButton {
|
||||
|
||||
public var rx_tap: ControlEvent<Void> {}
|
||||
public var tap: ControlEvent<Void> {}
|
||||
|
||||
public var rx_state: ControlProperty<Int> {}
|
||||
public var state: ControlProperty<Int> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension NSImageView {
|
||||
extension Reactive where Base: NSImageView {
|
||||
|
||||
public var rx_image: ObserverOf<NSImage?> {}
|
||||
public var image: ObserverOf<NSImage?> {}
|
||||
|
||||
public func rx_imageAnimated(transitionType: String?) -> AnyObserver<NSImage?>
|
||||
public func imageAnimated(transitionType: String?) -> AnyObserver<NSImage?>
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension NSTextField {
|
||||
extension Reactive where Base: NSTextField {
|
||||
|
||||
public var rx_delegate: DelegateProxy {}
|
||||
public var delegate: DelegateProxy {}
|
||||
|
||||
public var rx_text: ControlProperty<String> {}
|
||||
public var text: ControlProperty<String> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension UITabBarItem {
|
||||
extension Reactive where Base: UITabBarItem {
|
||||
|
||||
public var rx_badgeValue: AnyObserver<String?> {}
|
||||
public var badgeValue: AnyObserver<String?> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
extension Reactive where Base: UITabBar {
|
||||
|
||||
public var didSelectItem: ControlEvent<UITabBarItem> {}
|
||||
|
||||
public var willBeginCustomizing: ControlEvent<[UITabBarItem]> {}
|
||||
|
||||
public var didBeginCustomizing: ControlEvent<[UITabBarItem]> {}
|
||||
|
||||
public var willEndCustomizing: ControlEvent<(items: [UITabBarItem], changed: Bool)> {}
|
||||
|
||||
public var didEndCustomizing: ControlEvent<(items: [UITabBarItem], changed: Bool)> {}
|
||||
|
||||
}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ let c = Observable.combineLatest(a.asObservable(), b.asObservable()) { $0 + $1 }
|
|||
// 1 + 2 = 3 which is >= 0, so `c` is initially equal to "3 is positive"
|
||||
|
||||
// To pull values out of the Rx `Observable` `c`, subscribe to values from `c`.
|
||||
// `subscribeNext` means subscribe to the next (fresh) values of `c`.
|
||||
// `subscribe(onNext:)` means subscribe to the next (fresh) values of `c`.
|
||||
// That also includes the initial value "3 is positive".
|
||||
c.subscribeNext { print($0) } // prints: "3 is positive"
|
||||
c.subscribe(onNext: { print($0) }) // prints: "3 is positive"
|
||||
|
||||
// Now, let's increase the value of `a`
|
||||
a.value = 4 // prints: 6 is positive
|
||||
|
|
@ -72,17 +72,17 @@ b.value = -8 // doesn't print anything
|
|||
|
||||
## Simple UI bindings
|
||||
|
||||
* Instead of binding to variables, let's bind to `UITextField` values using the `rx_text` property
|
||||
* Instead of binding to variables, let's bind to `UITextField` values using the `rx.text` property
|
||||
* Next, `map` the `String` into an `Int` and determine if the number is prime using an async API
|
||||
* If the text is changed before the async call completes, a new async call will replace it via `concat`
|
||||
* Bind the results to a `UILabel`
|
||||
|
||||
```swift
|
||||
let subscription/*: Disposable */ = primeTextField.rx_text // type is Observable<String>
|
||||
let subscription/*: Disposable */ = primeTextField.rx.text // type is Observable<String>
|
||||
.map { WolframAlphaIsPrime(Int($0) ?? 0) } // type is Observable<Observable<Prime>>
|
||||
.concat() // type is Observable<Prime>
|
||||
.map { "number \($0.n) is prime? \($0.isPrime)" } // type is Observable<String>
|
||||
.bindTo(resultLabel.rx_text) // return Disposable that can be used to unbind everything
|
||||
.bindTo(resultLabel.rx.text) // return Disposable that can be used to unbind everything
|
||||
|
||||
// This will set `resultLabel.text` to "number 43 is prime? true" after
|
||||
// server call completes.
|
||||
|
|
@ -108,7 +108,7 @@ Let's give it a shot.
|
|||
```swift
|
||||
// bind UI control values directly
|
||||
// use username from `usernameOutlet` as username values source
|
||||
self.usernameOutlet.rx_text
|
||||
self.usernameOutlet.rx.text
|
||||
.map { username in
|
||||
|
||||
// synchronous validation, nothing special here
|
||||
|
|
@ -152,12 +152,12 @@ self.usernameOutlet.rx_text
|
|||
// That's what `switchLatest` does.
|
||||
.switchLatest()
|
||||
// Now we need to bind that to the user interface somehow.
|
||||
// Good old `subscribeNext` can do that.
|
||||
// Good old `subscribe(onNext:)` can do that.
|
||||
// That's the end of `Observable` chain.
|
||||
.subscribeNext { valid in
|
||||
.subscribe(onNext: { valid in
|
||||
errorLabel.textColor = validationColor(valid)
|
||||
errorLabel.text = valid.message
|
||||
}
|
||||
})
|
||||
// This will produce a `Disposable` object that can unbind everything and cancel
|
||||
// pending async operations.
|
||||
// Instead of doing it manually, which is tedious,
|
||||
|
|
|
|||
|
|
@ -67,32 +67,32 @@ These are called marble diagrams. There are more marble diagrams at [rxmarbles.c
|
|||
|
||||
If we were to specify sequence grammar as a regular expression it would look like:
|
||||
|
||||
**Next* (Error | Completed)?**
|
||||
**next* (error | completed)?**
|
||||
|
||||
This describes the following:
|
||||
|
||||
* **Sequences can have 0 or more elements.**
|
||||
* **Once an `Error` or `Completed` event is received, the sequence cannot produce any other element.**
|
||||
* **Once an `error` or `completed` event is received, the sequence cannot produce any other element.**
|
||||
|
||||
Sequences in Rx are described by a push interface (aka callback).
|
||||
|
||||
```swift
|
||||
enum Event<Element> {
|
||||
case Next(Element) // next element of a sequence
|
||||
case Error(ErrorType) // sequence failed with error
|
||||
case Completed // sequence terminated successfully
|
||||
case next(Element) // next element of a sequence
|
||||
case error(Swift.Error) // sequence failed with error
|
||||
case completed // sequence terminated successfully
|
||||
}
|
||||
|
||||
class Observable<Element> {
|
||||
func subscribe(observer: Observer<Element>) -> Disposable
|
||||
func subscribe(_ observer: Observer<Element>) -> Disposable
|
||||
}
|
||||
|
||||
protocol ObserverType {
|
||||
func on(event: Event<Element>)
|
||||
func on(_ event: Event<Element>)
|
||||
}
|
||||
```
|
||||
|
||||
**When a sequence sends the `Completed` or `Error` event all internal resources that compute sequence elements will be freed.**
|
||||
**When a sequence sends the `completed` or `error` event all internal resources that compute sequence elements will be freed.**
|
||||
|
||||
**To cancel production of sequence elements and free resources immediately, call `dispose` on the returned subscription.**
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ If a sequence does not terminate in some way, resources will be allocated perman
|
|||
|
||||
**Using dispose bags or `takeUntil` operator is a robust way of making sure resources are cleaned up. We recommend using them in production even if the sequences will terminate in finite time.**
|
||||
|
||||
In case you are curious why `ErrorType` isn't generic, you can find explanation [here](DesignRationale.md#why-error-type-isnt-generic).
|
||||
In case you are curious why `Swift.Error` isn't generic, you can find explanation [here](DesignRationale.md#why-error-type-isnt-generic).
|
||||
|
||||
## Disposing
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ let subscription = Observable<Int>.interval(0.3, scheduler: scheduler)
|
|||
print(event)
|
||||
}
|
||||
|
||||
NSThread.sleepForTimeInterval(2)
|
||||
NSThread.sleep(forTimeInterval: 2.0)
|
||||
|
||||
subscription.dispose()
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ This will print:
|
|||
5
|
||||
```
|
||||
|
||||
Note the you usually do not want to manually call `dispose`; this is only educational example. Calling dispose manually is usually a bad code smell. There are better ways to dispose subscriptions. We can use `DisposeBag`, the `takeUntil` operator, or some other mechanism.
|
||||
Note that you usually do not want to manually call `dispose`; this is only educational example. Calling dispose manually is usually a bad code smell. There are better ways to dispose subscriptions. We can use `DisposeBag`, the `takeUntil` operator, or some other mechanism.
|
||||
|
||||
So can this code print something after the `dispose` call executed? The answer is: it depends.
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ Additional way to automatically dispose subscription on dealloc is to use `takeU
|
|||
|
||||
```swift
|
||||
sequence
|
||||
.takeUntil(self.rx_deallocated)
|
||||
.takeUntil(self.rx.deallocated)
|
||||
.subscribe {
|
||||
print($0)
|
||||
}
|
||||
|
|
@ -218,9 +218,9 @@ sequence
|
|||
|
||||
There is also a couple of additional guarantees that all sequence producers (`Observable`s) must honor.
|
||||
|
||||
It doesn't matter on which thread they produce elements, but if they generate one element and send it to the observer `observer.on(.Next(nextElement))`, they can't send next element until `observer.on` method has finished execution.
|
||||
It doesn't matter on which thread they produce elements, but if they generate one element and send it to the observer `observer.on(.next(nextElement))`, they can't send next element until `observer.on` method has finished execution.
|
||||
|
||||
Producers also cannot send terminating `.Completed` or `.Error` in case `.Next` event hasn't finished.
|
||||
Producers also cannot send terminating `.completed` or `.error` in case `.next` event hasn't finished.
|
||||
|
||||
In short, consider this example:
|
||||
|
||||
|
|
@ -276,9 +276,9 @@ let searchForMe = searchWikipedia("me")
|
|||
|
||||
let cancel = searchForMe
|
||||
// sequence generation starts now, URL requests are fired
|
||||
.subscribeNext { results in
|
||||
.subscribe(onNext: { results in
|
||||
print(results)
|
||||
}
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
|
|
@ -291,16 +291,16 @@ Let's create a function which creates a sequence that returns one element upon s
|
|||
```swift
|
||||
func myJust<E>(element: E) -> Observable<E> {
|
||||
return Observable.create { observer in
|
||||
observer.on(.Next(element))
|
||||
observer.on(.Completed)
|
||||
return NopDisposable.instance
|
||||
observer.on(.next(element))
|
||||
observer.on(.completed)
|
||||
return Disposables.create()
|
||||
}
|
||||
}
|
||||
|
||||
myJust(0)
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print(n)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
this will print:
|
||||
|
|
@ -325,11 +325,11 @@ Lets now create an observable that returns elements from an array.
|
|||
func myFrom<E>(sequence: [E]) -> Observable<E> {
|
||||
return Observable.create { observer in
|
||||
for element in sequence {
|
||||
observer.on(.Next(element))
|
||||
observer.on(.next(element))
|
||||
}
|
||||
|
||||
observer.on(.Completed)
|
||||
return NopDisposable.instance
|
||||
observer.on(.completed)
|
||||
return Disposables.create()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -339,17 +339,17 @@ print("Started ----")
|
|||
|
||||
// first time
|
||||
stringCounter
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print(n)
|
||||
}
|
||||
})
|
||||
|
||||
print("----")
|
||||
|
||||
// again
|
||||
stringCounter
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print(n)
|
||||
}
|
||||
})
|
||||
|
||||
print("Ended ----")
|
||||
```
|
||||
|
|
@ -382,15 +382,15 @@ func myInterval(interval: NSTimeInterval) -> Observable<Int> {
|
|||
var next = 0
|
||||
|
||||
dispatch_source_set_timer(timer, 0, UInt64(interval * Double(NSEC_PER_SEC)), 0)
|
||||
let cancel = AnonymousDisposable {
|
||||
let cancel = Disposables.create {
|
||||
print("Disposed")
|
||||
dispatch_source_cancel(timer)
|
||||
}
|
||||
dispatch_source_set_event_handler(timer, {
|
||||
if cancel.disposed {
|
||||
if cancel.isDisposed {
|
||||
return
|
||||
}
|
||||
observer.on(.Next(next))
|
||||
observer.on(.next(next))
|
||||
next += 1
|
||||
})
|
||||
dispatch_resume(timer)
|
||||
|
|
@ -406,11 +406,12 @@ let counter = myInterval(0.1)
|
|||
print("Started ----")
|
||||
|
||||
let subscription = counter
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print(n)
|
||||
}
|
||||
})
|
||||
|
||||
NSThread.sleepForTimeInterval(0.5)
|
||||
|
||||
NSThread.sleep(forTimeInterval: 0.5)
|
||||
|
||||
subscription.dispose()
|
||||
|
||||
|
|
@ -438,19 +439,19 @@ let counter = myInterval(0.1)
|
|||
print("Started ----")
|
||||
|
||||
let subscription1 = counter
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print("First \(n)")
|
||||
}
|
||||
})
|
||||
let subscription2 = counter
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print("Second \(n)")
|
||||
}
|
||||
})
|
||||
|
||||
NSThread.sleepForTimeInterval(0.5)
|
||||
NSThread.sleep(forTimeInterval: 0.5)
|
||||
|
||||
subscription1.dispose()
|
||||
|
||||
NSThread.sleepForTimeInterval(0.5)
|
||||
NSThread.sleep(forTimeInterval: 0.5)
|
||||
|
||||
subscription2.dispose()
|
||||
|
||||
|
|
@ -503,13 +504,13 @@ let counter = myInterval(0.1)
|
|||
print("Started ----")
|
||||
|
||||
let subscription1 = counter
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print("First \(n)")
|
||||
}
|
||||
})
|
||||
let subscription2 = counter
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print("Second \(n)")
|
||||
}
|
||||
})
|
||||
|
||||
NSThread.sleepForTimeInterval(0.5)
|
||||
|
||||
|
|
@ -554,27 +555,27 @@ Behavior for URL observables is equivalent.
|
|||
This is how HTTP requests are wrapped in Rx. It's pretty much the same pattern like the `interval` operator.
|
||||
|
||||
```swift
|
||||
extension NSURLSession {
|
||||
public func rx_response(request: NSURLRequest) -> Observable<(NSData, NSURLResponse)> {
|
||||
extension Reactive where Base: NSURLSession {
|
||||
public func response(request: NSURLRequest) -> Observable<(NSData, NSURLResponse)> {
|
||||
return Observable.create { observer in
|
||||
let task = self.dataTaskWithRequest(request) { (data, response, error) in
|
||||
guard let response = response, data = data else {
|
||||
observer.on(.Error(error ?? RxCocoaURLError.Unknown))
|
||||
observer.on(.error(error ?? RxCocoaURLError.Unknown))
|
||||
return
|
||||
}
|
||||
|
||||
guard let httpResponse = response as? NSHTTPURLResponse else {
|
||||
observer.on(.Error(RxCocoaURLError.NonHTTPResponse(response: response)))
|
||||
observer.on(.error(RxCocoaURLError.nonHTTPResponse(response: response)))
|
||||
return
|
||||
}
|
||||
|
||||
observer.on(.Next(data, httpResponse))
|
||||
observer.on(.Completed)
|
||||
observer.on(.next(data, httpResponse))
|
||||
observer.on(.completed)
|
||||
}
|
||||
|
||||
task.resume()
|
||||
|
||||
return AnonymousDisposable {
|
||||
return Disposables.create {
|
||||
task.cancel()
|
||||
}
|
||||
}
|
||||
|
|
@ -614,13 +615,13 @@ extension ObservableType {
|
|||
return Observable.create { observer in
|
||||
let subscription = self.subscribe { e in
|
||||
switch e {
|
||||
case .Next(let value):
|
||||
case .next(let value):
|
||||
let result = transform(value)
|
||||
observer.on(.Next(result))
|
||||
case .Error(let error):
|
||||
observer.on(.Error(error))
|
||||
case .Completed:
|
||||
observer.on(.Completed)
|
||||
observer.on(.next(result))
|
||||
case .error(let error):
|
||||
observer.on(.error(error))
|
||||
case .completed:
|
||||
observer.on(.completed)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -637,9 +638,9 @@ let subscription = myInterval(0.1)
|
|||
.myMap { e in
|
||||
return "This is simply \(e)"
|
||||
}
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print(n)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
and this will print
|
||||
|
|
@ -668,9 +669,9 @@ This isn't something that should be practiced often, and is a bad code smell, bu
|
|||
let magicBeings: Observable<MagicBeing> = summonFromMiddleEarth()
|
||||
|
||||
magicBeings
|
||||
.subscribeNext { being in // exit the Rx monad
|
||||
.subscribe(onNext: { being in // exit the Rx monad
|
||||
self.doSomeStateMagic(being)
|
||||
}
|
||||
})
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
//
|
||||
|
|
@ -680,7 +681,7 @@ This isn't something that should be practiced often, and is a bad code smell, bu
|
|||
being,
|
||||
UIApplication.delegate.dataSomething.attendees
|
||||
)
|
||||
kittens.on(.Next(kitten)) // send result back to rx
|
||||
kittens.on(.next(kitten)) // send result back to rx
|
||||
//
|
||||
// Another mess
|
||||
//
|
||||
|
|
@ -698,9 +699,9 @@ Every time you do this, somebody will probably write this code somewhere
|
|||
|
||||
```swift
|
||||
kittens
|
||||
.subscribeNext { kitten in
|
||||
.subscribe(onNext: { kitten in
|
||||
// so something with kitten
|
||||
}
|
||||
})
|
||||
.addDisposableTo(disposeBag)
|
||||
```
|
||||
|
||||
|
|
@ -716,7 +717,7 @@ If you are unsure how exactly some of the operators work, [playgrounds](../Rx.pl
|
|||
|
||||
## Error handling
|
||||
|
||||
The are two error mechanisms.
|
||||
There are two error mechanisms.
|
||||
|
||||
### Asynchronous error handling mechanism in observables
|
||||
|
||||
|
|
@ -783,9 +784,9 @@ let subscription = myInterval(0.1)
|
|||
.map { e in
|
||||
return "This is simply \(e)"
|
||||
}
|
||||
.subscribeNext { n in
|
||||
.subscribe(onNext: { n in
|
||||
print(n)
|
||||
}
|
||||
})
|
||||
|
||||
NSThread.sleepForTimeInterval(0.5)
|
||||
|
||||
|
|
@ -797,15 +798,15 @@ will print
|
|||
```
|
||||
[my probe] subscribed
|
||||
Subscribed
|
||||
[my probe] -> Event Next(Box(0))
|
||||
[my probe] -> Event next(Box(0))
|
||||
This is simply 0
|
||||
[my probe] -> Event Next(Box(1))
|
||||
[my probe] -> Event next(Box(1))
|
||||
This is simply 1
|
||||
[my probe] -> Event Next(Box(2))
|
||||
[my probe] -> Event next(Box(2))
|
||||
This is simply 2
|
||||
[my probe] -> Event Next(Box(3))
|
||||
[my probe] -> Event next(Box(3))
|
||||
This is simply 3
|
||||
[my probe] -> Event Next(Box(4))
|
||||
[my probe] -> Event next(Box(4))
|
||||
This is simply 4
|
||||
[my probe] dispose
|
||||
Disposed
|
||||
|
|
@ -821,17 +822,17 @@ extension ObservableType {
|
|||
let subscription = self.subscribe { e in
|
||||
print("event \(identifier) \(e)")
|
||||
switch e {
|
||||
case .Next(let value):
|
||||
observer.on(.Next(value))
|
||||
case .next(let value):
|
||||
observer.on(.next(value))
|
||||
|
||||
case .Error(let error):
|
||||
observer.on(.Error(error))
|
||||
case .error(let error):
|
||||
observer.on(.error(error))
|
||||
|
||||
case .Completed:
|
||||
observer.on(.Completed)
|
||||
case .completed:
|
||||
observer.on(.completed)
|
||||
}
|
||||
}
|
||||
return AnonymousDisposable {
|
||||
return Disposables.create {
|
||||
print("disposing \(identifier)")
|
||||
subscription.dispose()
|
||||
}
|
||||
|
|
@ -851,9 +852,9 @@ In case you want to have some resource leak detection logic, the simplest method
|
|||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
|
||||
*/
|
||||
_ = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
|
||||
.subscribeNext { _ in
|
||||
print("Resource count \(RxSwift.resourceCount)")
|
||||
}
|
||||
.subscribe(onNext: { _ in
|
||||
print("Resource count \(RxSwift.resourceCount)")
|
||||
})
|
||||
```
|
||||
|
||||
Most efficient way to test for memory leaks is:
|
||||
|
|
@ -875,7 +876,7 @@ The reason why 2 navigations are suggested is because first navigation forces lo
|
|||
|
||||
Variable wraps a [`Subject`](http://reactivex.io/documentation/subject.html). More specifically it is a `BehaviorSubject`. Unlike `BehaviorSubject`, it only exposes `value` interface, so variable can never terminate or fail.
|
||||
|
||||
It will also broadcast it's current value immediately on subscription.
|
||||
It will also broadcast its current value immediately on subscription.
|
||||
|
||||
After variable is deallocated, it will complete the observable sequence returned from `.asObservable()`.
|
||||
|
||||
|
|
@ -933,14 +934,14 @@ There are two built in ways this library supports KVO.
|
|||
|
||||
```swift
|
||||
// KVO
|
||||
extension NSObject {
|
||||
public func rx_observe<E>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions, retainSelf: Bool = true) -> Observable<E?> {}
|
||||
extension Reactive where Base: NSObject {
|
||||
public func observe<E>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions, retainSelf: Bool = true) -> Observable<E?> {}
|
||||
}
|
||||
|
||||
#if !DISABLE_SWIZZLING
|
||||
// KVO
|
||||
extension NSObject {
|
||||
public func rx_observeWeakly<E>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions) -> Observable<E?> {}
|
||||
extension Reactive where Base: NSObject {
|
||||
public func observeWeakly<E>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions) -> Observable<E?> {}
|
||||
}
|
||||
#endif
|
||||
```
|
||||
|
|
@ -951,25 +952,25 @@ Example how to observe frame of `UIView`.
|
|||
|
||||
```swift
|
||||
view
|
||||
.rx_observe(CGRect.self, "frame")
|
||||
.subscribeNext { frame in
|
||||
.rx.observe(CGRect.self, "frame")
|
||||
.subscribe(onNext: { frame in
|
||||
...
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```swift
|
||||
view
|
||||
.rx_observeWeakly(CGRect.self, "frame")
|
||||
.subscribeNext { frame in
|
||||
.rx.observeWeakly(CGRect.self, "frame")
|
||||
.subscribe(onNext: { frame in
|
||||
...
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### `rx_observe`
|
||||
### `rx.observe`
|
||||
|
||||
`rx_observe` is more performant because it's just a simple wrapper around KVO mechanism, but it has more limited usage scenarios
|
||||
`rx.observe` is more performant because it's just a simple wrapper around KVO mechanism, but it has more limited usage scenarios
|
||||
|
||||
* it can be used to observe paths starting from `self` or from ancestors in ownership graph (`retainSelf = false`)
|
||||
* it can be used to observe paths starting from descendants in ownership graph (`retainSelf = true`)
|
||||
|
|
@ -978,14 +979,14 @@ view
|
|||
E.g.
|
||||
|
||||
```swift
|
||||
self.rx_observe(CGRect.self, "view.frame", retainSelf: false)
|
||||
self.rx.observe(CGRect.self, "view.frame", retainSelf: false)
|
||||
```
|
||||
|
||||
### `rx_observeWeakly`
|
||||
### `rx.observeWeakly`
|
||||
|
||||
`rx_observeWeakly` has somewhat slower than `rx_observe` because it has to handle object deallocation in case of weak references.
|
||||
`rx.observeWeakly` has somewhat slower than `rx.observe` because it has to handle object deallocation in case of weak references.
|
||||
|
||||
It can be used in all cases where `rx_observe` can be used and additionally
|
||||
It can be used in all cases where `rx.observe` can be used and additionally
|
||||
|
||||
* because it won't retain observed target, it can be used to observe arbitrary object graph whose ownership relation is unknown
|
||||
* it can be used to observe `weak` properties
|
||||
|
|
@ -993,7 +994,7 @@ It can be used in all cases where `rx_observe` can be used and additionally
|
|||
E.g.
|
||||
|
||||
```swift
|
||||
someSuspiciousViewController.rx_observeWeakly(Bool.self, "behavingOk")
|
||||
someSuspiciousViewController.rx.observeWeakly(Bool.self, "behavingOk")
|
||||
```
|
||||
|
||||
### Observing structs
|
||||
|
|
@ -1004,7 +1005,7 @@ KVO is an Objective-C mechanism so it relies heavily on `NSValue`.
|
|||
|
||||
When observing some other structures it is necessary to extract those structures from `NSValue` manually.
|
||||
|
||||
[Here](../RxCocoa/Common/KVORepresentable+CoreGraphics.swift) are examples how to extend KVO observing mechanism and `rx_observe*` methods for other structs by implementing `KVORepresentable` protocol.
|
||||
[Here](../RxCocoa/Common/KVORepresentable+CoreGraphics.swift) are examples how to extend KVO observing mechanism and `rx.observe*` methods for other structs by implementing `KVORepresentable` protocol.
|
||||
|
||||
## UI layer tips
|
||||
|
||||
|
|
@ -1070,18 +1071,18 @@ let request = NSURLRequest(URL: NSURL(string: "http://en.wikipedia.org/w/api.php
|
|||
If you want to just execute that request outside of composition with other observables, this is what needs to be done.
|
||||
|
||||
```swift
|
||||
let responseJSON = NSURLSession.sharedSession().rx_JSON(request)
|
||||
let responseJSON = NSURLSession.sharedSession().rx.JSON(request)
|
||||
|
||||
// no requests will be performed up to this point
|
||||
// `responseJSON` is just a description how to fetch the response
|
||||
|
||||
let cancelRequest = responseJSON
|
||||
// this will fire the request
|
||||
.subscribeNext { json in
|
||||
.subscribe(onNext: { json in
|
||||
print(json)
|
||||
}
|
||||
})
|
||||
|
||||
NSThread.sleepForTimeInterval(3)
|
||||
NSThread.sleep(forTimeInterval: 3.0)
|
||||
|
||||
// if you want to cancel request after 3 seconds have passed just call
|
||||
cancelRequest.dispose()
|
||||
|
|
@ -1093,7 +1094,7 @@ cancelRequest.dispose()
|
|||
In case you want a more low level access to response, you can use:
|
||||
|
||||
```swift
|
||||
NSURLSession.sharedSession().rx_response(myNSURLRequest)
|
||||
NSURLSession.shared.rx.response(myNSURLRequest)
|
||||
.debug("my request") // this will print out information to console
|
||||
.flatMap { (data: NSData!, response: NSURLResponse!) -> Observable<String> in
|
||||
if let response = response as? NSHTTPURLResponse {
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
**Please copy the following template [here](https://github.com/ReactiveX/RxSwift/issues/new) and fill in the missing fields so we can help you as soon as possible.**
|
||||
|
||||
**If you don't have something to report in the following format, it will probably be easier and faster to ask in the [slack channel](http://http://slack.rxswift.org/) first.**
|
||||
|
||||
```
|
||||
*Short description*:
|
||||
|
||||
description here
|
||||
|
||||
*Code that reproduces the issue*:
|
||||
|
||||
code goes here
|
||||
|
||||
*Xcode version*:
|
||||
|
||||
Xcode version goes here
|
||||
|
||||
*Expected outcome*:
|
||||
|
||||
what you expect to happen goes here
|
||||
|
||||
*What actually happens*:
|
||||
|
||||
what actually happens goes here
|
||||
|
||||
// filling in additional information below is optional, but resolving your issue could potentially be a lot faster
|
||||
|
||||
*Installation method*:
|
||||
(so we don't waste time investigating an incorrect integration)
|
||||
* CocoaPods
|
||||
* Carthage
|
||||
* Git submodules
|
||||
|
||||
*I have multiple versions of Xcode installed*:
|
||||
(so we can know if this is a potential cause of your issue)
|
||||
* yes (which ones)
|
||||
* no
|
||||
|
||||
*Level of RxSwift knowledge*:
|
||||
(this is so we can understand your level of knowledge
|
||||
and formulate the response in an appropriate manner)
|
||||
* just starting
|
||||
* I have a small code base
|
||||
* I have a significant code base
|
||||
```
|
||||
|
|
@ -28,4 +28,4 @@ What works:
|
|||
What doesn't work:
|
||||
* Schedulers - because they are dependent on https://github.com/apple/swift-corelibs-libdispatch and it still hasn't been released
|
||||
* Multithreading - still no access to c11 locks
|
||||
* For some reason it looks like Swift compiler generates wrong code when using `ErrorType` on `Linux`, so don't use errors, otherwise you can get weird crashes.
|
||||
* For some reason it looks like Swift compiler generates wrong code when using `Swift.Error` on `Linux`, so don't use errors, otherwise you can get weird crashes.
|
||||
|
|
|
|||
|
|
@ -5,37 +5,37 @@ Schedulers
|
|||
1. [Custom schedulers](#custom-schedulers)
|
||||
1. [Builtin schedulers](#builtin-schedulers)
|
||||
|
||||
Schedulers abstract away mechanism for performing work.
|
||||
Schedulers abstract away the mechanism for performing work.
|
||||
|
||||
Different mechanisms for performing work include, current thread, dispatch queues, operation queues, new threads, thread pools, run loops ...
|
||||
Different mechanisms for performing work include the current thread, dispatch queues, operation queues, new threads, thread pools, and run loops.
|
||||
|
||||
There are two main operators that work with schedulers. `observeOn` and `subscribeOn`.
|
||||
There are two main operators that work with schedulers, `observeOn` and `subscribeOn`.
|
||||
|
||||
If you want to perform work on different scheduler just use `observeOn(scheduler)` operator.
|
||||
If you want to perform work on a different scheduler just use `observeOn(scheduler)` operator.
|
||||
|
||||
You would usually use `observeOn` a lot more often then `subscribeOn`.
|
||||
You would usually use `observeOn` a lot more often than `subscribeOn`.
|
||||
|
||||
In case `observeOn` isn't explicitly specified, work will be performed on which ever thread/scheduler elements are generated.
|
||||
In case `observeOn` isn't explicitly specified, work will be performed on whichever thread/scheduler elements are generated.
|
||||
|
||||
Example of using `observeOn` operator
|
||||
Example of using the `observeOn` operator:
|
||||
|
||||
```
|
||||
sequence1
|
||||
.observeOn(backgroundScheduler)
|
||||
.map { n in
|
||||
print("This is performed on background scheduler")
|
||||
print("This is performed on the background scheduler")
|
||||
}
|
||||
.observeOn(MainScheduler.instance)
|
||||
.map { n in
|
||||
print("This is performed on main scheduler")
|
||||
print("This is performed on the main scheduler")
|
||||
}
|
||||
```
|
||||
|
||||
If you want to start sequence generation (`subscribe` method) and call dispose on a specific scheduler, use `subscribeOn(scheduler)`.
|
||||
|
||||
In case `subscribeOn` isn't explicitly specified, `subscribe` method will be called on the same thread/scheduler that `subscribeNext` or `subscribe` is called.
|
||||
In case `subscribeOn` isn't explicitly specified, the `subscribe` method will be called on the same thread/scheduler on which `subscribe(onNext:)` or `subscribe` is called.
|
||||
|
||||
In case `subscribeOn` isn't explicitly specified, `dispose` method will be called on the same thread/scheduler that initiated disposing.
|
||||
In case `subscribeOn` isn't explicitly specified, the `dispose` method will be called on the same thread/scheduler that initiated disposing.
|
||||
|
||||
In short, if no explicit scheduler is chosen, those methods will be called on current thread/scheduler.
|
||||
|
||||
|
|
@ -43,19 +43,19 @@ In short, if no explicit scheduler is chosen, those methods will be called on cu
|
|||
|
||||
Since schedulers can really be anything, and all operators that transform sequences need to preserve additional [implicit guarantees](GettingStarted.md#implicit-observable-guarantees), it is important what kind of schedulers are you creating.
|
||||
|
||||
In case scheduler is concurrent, Rx's `observeOn` and `subscribeOn` operators will make sure everything works perfect.
|
||||
In case the scheduler is concurrent, Rx's `observeOn` and `subscribeOn` operators will make sure everything works perfectly.
|
||||
|
||||
If you use some scheduler that for which Rx can prove that it's serial, it will able to perform additional optimizations.
|
||||
If you use some scheduler that Rx can prove is serial, it will be able to perform additional optimizations.
|
||||
|
||||
So far it only performing those optimizations for dispatch queue schedulers.
|
||||
So far it only performs those optimizations for dispatch queue schedulers.
|
||||
|
||||
In case of serial dispatch queue schedulers `observeOn` is optimized to just a simple `dispatch_async` call.
|
||||
In case of serial dispatch queue schedulers, `observeOn` is optimized to just a simple `dispatch_async` call.
|
||||
|
||||
# Custom schedulers
|
||||
|
||||
Besides current schedulers, you can write your own schedulers.
|
||||
|
||||
If you just want to describe who needs to perform work immediately, you can create your own scheduler by implementing `ImmediateScheduler` protocol.
|
||||
If you just want to describe who needs to perform work immediately, you can create your own scheduler by implementing the `ImmediateScheduler` protocol.
|
||||
|
||||
```swift
|
||||
public protocol ImmediateScheduler {
|
||||
|
|
@ -63,7 +63,7 @@ public protocol ImmediateScheduler {
|
|||
}
|
||||
```
|
||||
|
||||
If you want to create new scheduler that supports time based operations, then you'll need to implement.
|
||||
If you want to create a new scheduler that supports time based operations, then you'll need to implement the `Scheduler` protocol:
|
||||
|
||||
```swift
|
||||
public protocol Scheduler: ImmediateScheduler {
|
||||
|
|
@ -78,7 +78,7 @@ public protocol Scheduler: ImmediateScheduler {
|
|||
}
|
||||
```
|
||||
|
||||
In case scheduler only has periodic scheduling capabilities, you can inform Rx by implementing `PeriodicScheduler` protocol
|
||||
In case the scheduler only has periodic scheduling capabilities, you can inform Rx by implementing the `PeriodicScheduler` protocol:
|
||||
|
||||
```swift
|
||||
public protocol PeriodicScheduler : Scheduler {
|
||||
|
|
@ -86,47 +86,47 @@ public protocol PeriodicScheduler : Scheduler {
|
|||
}
|
||||
```
|
||||
|
||||
In case scheduler doesn't support `PeriodicScheduling` capabilities, Rx will emulate periodic scheduling transparently.
|
||||
In case the scheduler doesn't support `PeriodicScheduling` capabilities, Rx will emulate periodic scheduling transparently.
|
||||
|
||||
# Builtin schedulers
|
||||
|
||||
Rx can use all types of schedulers, but it can also perform some additional optimizations if it has proof that scheduler is serial.
|
||||
|
||||
These are currently supported schedulers
|
||||
These are the currently supported schedulers:
|
||||
|
||||
## CurrentThreadScheduler (Serial scheduler)
|
||||
|
||||
Schedules units of work on the current thread.
|
||||
This is the default scheduler for operators that generate elements.
|
||||
|
||||
This scheduler is also sometimes called `trampoline scheduler`.
|
||||
This scheduler is also sometimes called a "trampoline scheduler".
|
||||
|
||||
If `CurrentThreadScheduler.instance.schedule(state) { }` is called for first time on some thread, scheduled action will be executed immediately and hidden queue will be created where all recursively scheduled actions will be temporarily enqueued.
|
||||
If `CurrentThreadScheduler.instance.schedule(state) { }` is called for the first time on some thread, the scheduled action will be executed immediately and a hidden queue will be created where all recursively scheduled actions will be temporarily enqueued.
|
||||
|
||||
If some parent frame on call stack is already running `CurrentThreadScheduler.instance.schedule(state) { }`, scheduled action will be enqueued and executed when currently running action and all previously enqueued actions have finished executing.
|
||||
If some parent frame on the call stack is already running `CurrentThreadScheduler.instance.schedule(state) { }`, the scheduled action will be enqueued and executed when the currently running action and all previously enqueued actions have finished executing.
|
||||
|
||||
## MainScheduler (Serial scheduler)
|
||||
|
||||
Abstracts work that needs to be performed on `MainThread`. In case `schedule` methods are called from main thread, it will perform action immediately without scheduling.
|
||||
Abstracts work that needs to be performed on `MainThread`. In case `schedule` methods are called from main thread, it will perform the action immediately without scheduling.
|
||||
|
||||
This scheduler is usually used to perform UI work.
|
||||
|
||||
## SerialDispatchQueueScheduler (Serial scheduler)
|
||||
|
||||
Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. It will make sure that even if concurrent dispatch queue is passed, it's transformed into a serial one.
|
||||
Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. It will make sure that even if a concurrent dispatch queue is passed, it's transformed into a serial one.
|
||||
|
||||
Serial schedulers enable certain optimizations for `observeOn`.
|
||||
|
||||
Main scheduler is an instance of `SerialDispatchQueueScheduler`.
|
||||
The main scheduler is an instance of `SerialDispatchQueueScheduler`.
|
||||
|
||||
## ConcurrentDispatchQueueScheduler (Concurrent scheduler)
|
||||
|
||||
Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. You can also pass a serial dispatch queue, it shouldn't cause any problems.
|
||||
|
||||
This scheduler is suitable when some work needs to be performed in background.
|
||||
This scheduler is suitable when some work needs to be performed in the background.
|
||||
|
||||
## OperationQueueScheduler (Concurrent scheduler)
|
||||
|
||||
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`.
|
||||
This scheduler is suitable for cases when there is some bigger chunk of work that needs to be performed in the background and you want to fine tune concurrent processing using `maxConcurrentOperationCount`.
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ Analogies:
|
|||
| Physical units | Rx units |
|
||||
|-------------------------------------|---------------------------------------------------------------------|
|
||||
| number (one value) | observable sequence (sequence of values) |
|
||||
| dimensional unit (m, s, m/s, N ...) | Swift struct (Driver, ControlProperty, ControlEvent, Variable, ...) |
|
||||
| dimensional unit (m, s, m/s, N ...) | Swift struct (Driver, ControlProperty, ControlEvent, ...) |
|
||||
|
||||
A physical unit is a pair of a number and a corresponding dimensional unit.<br/>
|
||||
An Rx unit is a pair of an observable sequence and a corresponding struct that describes observable sequence properties.
|
||||
|
|
@ -71,7 +71,7 @@ Rx units define operations by using corresponding observable sequence operations
|
|||
The `map` operation on `Driver` is defined using the `map` operation on its observable sequence.
|
||||
|
||||
```swift
|
||||
let d: Driver<Int> = Drive.just(11)
|
||||
let d: Driver<Int> = Driver.just(11)
|
||||
driver.map { $0 / 0.5 } = ...
|
||||
```
|
||||
|
||||
|
|
@ -106,7 +106,6 @@ E.g.
|
|||
```
|
||||
Driver = (can't error out) * (observe on main scheduler) * (sharing side effects)
|
||||
ControlProperty = (sharing side effects) * (subscribe on main scheduler)
|
||||
Variable = (can't error out) * (sharing side effects)
|
||||
```
|
||||
|
||||
Conversion between different units in physics is done with the help of operators defined on numbers `*`, `/`.<br/>
|
||||
|
|
@ -137,11 +136,6 @@ Sharing side effects = share* (one of the `share` operators)
|
|||
* Observe on main scheduler
|
||||
* Sharing side effects
|
||||
|
||||
### Variable
|
||||
|
||||
* Can't error out
|
||||
* Sharing side effects
|
||||
|
||||
## Driver
|
||||
|
||||
This is the most elaborate unit. Its intention is to provide an intuitive way to write reactive code in the UI layer.
|
||||
|
|
@ -170,7 +164,7 @@ E.g.
|
|||
This is a typical beginner example.
|
||||
|
||||
```swift
|
||||
let results = query.rx_text
|
||||
let results = query.rx.text
|
||||
.throttle(0.3, scheduler: MainScheduler.instance)
|
||||
.flatMapLatest { query in
|
||||
fetchAutoCompleteItems(query)
|
||||
|
|
@ -178,11 +172,11 @@ let results = query.rx_text
|
|||
|
||||
results
|
||||
.map { "\($0.count)" }
|
||||
.bindTo(resultCount.rx_text)
|
||||
.bindTo(resultCount.rx.text)
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
results
|
||||
.bindTo(resultsTableView.rx_itemsWithCellIdentifier("Cell")) { (_, result, cell) in
|
||||
.bindTo(resultsTableView.rx.itemsWithCellIdentifier("Cell")) { (_, result, cell) in
|
||||
cell.textLabel?.text = "\(result)"
|
||||
}
|
||||
.addDisposableTo(disposeBag)
|
||||
|
|
@ -201,7 +195,7 @@ So, what are the problems with this code?:
|
|||
A more appropriate version of the code would look like this:
|
||||
|
||||
```swift
|
||||
let results = query.rx_text
|
||||
let results = query.rx.text
|
||||
.throttle(0.3, scheduler: MainScheduler.instance)
|
||||
.flatMapLatest { query in
|
||||
fetchAutoCompleteItems(query)
|
||||
|
|
@ -213,11 +207,11 @@ let results = query.rx_text
|
|||
|
||||
results
|
||||
.map { "\($0.count)" }
|
||||
.bindTo(resultCount.rx_text)
|
||||
.bindTo(resultCount.rx.text)
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
results
|
||||
.bindTo(resultTableView.rx_itemsWithCellIdentifier("Cell")) { (_, result, cell) in
|
||||
.bindTo(resultTableView.rx.itemsWithCellIdentifier("Cell")) { (_, result, cell) in
|
||||
cell.textLabel?.text = "\(result)"
|
||||
}
|
||||
.addDisposableTo(disposeBag)
|
||||
|
|
@ -228,7 +222,7 @@ Making sure all of these requirements are properly handled in large systems can
|
|||
The following code looks almost the same:
|
||||
|
||||
```swift
|
||||
let results = query.rx_text.asDriver() // This converts a normal sequence into a `Driver` sequence.
|
||||
let results = query.rx.text.asDriver() // This converts a normal sequence into a `Driver` sequence.
|
||||
.throttle(0.3, scheduler: MainScheduler.instance)
|
||||
.flatMapLatest { query in
|
||||
fetchAutoCompleteItems(query)
|
||||
|
|
@ -237,11 +231,11 @@ let results = query.rx_text.asDriver() // This converts a normal sequence
|
|||
|
||||
results
|
||||
.map { "\($0.count)" }
|
||||
.drive(resultCount.rx_text) // If there is a `drive` method available instead of `bindTo`,
|
||||
.drive(resultCount.rx.text) // If there is a `drive` method available instead of `bindTo`,
|
||||
.addDisposableTo(disposeBag) // that means that the compiler has proven that all properties
|
||||
// are satisfied.
|
||||
results
|
||||
.drive(resultTableView.rx_itemsWithCellIdentifier("Cell")) { (_, result, cell) in
|
||||
.drive(resultTableView.rx.itemsWithCellIdentifier("Cell")) { (_, result, cell) in
|
||||
cell.textLabel?.text = "\(result)"
|
||||
}
|
||||
.addDisposableTo(disposeBag)
|
||||
|
|
@ -252,7 +246,7 @@ So what is happening here?
|
|||
This first `asDriver` method converts the `ControlProperty` unit to a `Driver` unit.
|
||||
|
||||
```swift
|
||||
query.rx_text.asDriver()
|
||||
query.rx.text.asDriver()
|
||||
```
|
||||
|
||||
Notice that there wasn't anything special that needed to be done. `Driver` has all of the properties of the `ControlProperty` unit, plus some more. The underlying observable sequence is just wrapped as a `Driver` unit, and that's it.
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ _ = xs
|
|||
.filter { ... }
|
||||
.map { ... }
|
||||
.switchLatest()
|
||||
.takeUntil(someObject.rx_deallocated) // <-- note the `takeUntil` operator
|
||||
.takeUntil(someObject.deallocated) // <-- note the `takeUntil` operator
|
||||
.subscribe(onNext: {
|
||||
...
|
||||
}, onError: {
|
||||
|
|
@ -114,9 +114,9 @@ let disposeBag = DisposeBag()
|
|||
xs
|
||||
.filter { ... }
|
||||
.map { ... }
|
||||
.subscribeNext { nextElement in // <-- note the `subscribe*` method
|
||||
.subscribe(onNext: { nextElement in // <-- note the `subscribe*` method
|
||||
// use the element
|
||||
print(nextElement)
|
||||
}
|
||||
})
|
||||
.addDisposableTo(disposeBag)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.3.8)
|
||||
claide (1.0.0)
|
||||
colored (1.2)
|
||||
danger (0.7.4)
|
||||
claide
|
||||
colored (~> 1.2)
|
||||
faraday
|
||||
git
|
||||
octokit (~> 4.2)
|
||||
redcarpet (~> 3.3)
|
||||
terminal-table (~> 1)
|
||||
faraday (0.9.1)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
git (1.3.0)
|
||||
multipart-post (2.0.0)
|
||||
octokit (4.3.0)
|
||||
sawyer (~> 0.7.0, >= 0.5.3)
|
||||
redcarpet (3.3.4)
|
||||
sawyer (0.7.0)
|
||||
addressable (>= 2.3.5, < 2.5)
|
||||
faraday (~> 0.8, < 0.10)
|
||||
terminal-table (1.4.5)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
danger
|
||||
|
||||
BUNDLED WITH
|
||||
1.12.5
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
|
||||
:warning: If you don't have something to report in the following format, it will probably be easier and faster to ask in the [slack channel](http://http://slack.rxswift.org/) first. :warning:
|
||||
|
||||
**Short description of the issue**:
|
||||
|
||||
_description here_
|
||||
|
||||
**Self contained code example that reproduces the issue**:
|
||||
|
||||
```swift
|
||||
code goes here
|
||||
|
||||
// If we can't get a self contained code example that reproduces the issue, there is a big chance we won't be able
|
||||
// to help you because there is not much we can do.
|
||||
// `Self contained code example` means:
|
||||
// * that we should be able to just run the provided code without changing it.
|
||||
// * that it will reproduce the issue upon running
|
||||
```
|
||||
|
||||
**Xcode version**:
|
||||
|
||||
```
|
||||
Xcode version goes here
|
||||
```
|
||||
|
||||
**Expected outcome**:
|
||||
|
||||
_what you expect to happen goes here_
|
||||
|
||||
**What actually happens**:
|
||||
|
||||
_what actually happens goes here_
|
||||
|
||||
:warning: Fields below are optional for general issues or in case those questions aren't related to your issue, but filling them out will increase the chances of getting your issue resolved. :warning:
|
||||
|
||||
**Installation method**:
|
||||
- [ ] CocoaPods
|
||||
- [ ] Carthage
|
||||
- [ ] Git submodules
|
||||
|
||||
**I have multiple versions of Xcode installed**:
|
||||
(so we can know if this is a potential cause of your issue)
|
||||
- [ ] yes (which ones)
|
||||
- [ ] no
|
||||
|
||||
**Level of RxSwift knowledge**:
|
||||
(this is so we can understand your level of knowledge
|
||||
and formulate the response in an appropriate manner)
|
||||
- [ ] just starting
|
||||
- [ ] I have a small code base
|
||||
- [ ] I have a significant code base
|
||||
|
|
@ -3,11 +3,6 @@ import PackageDescription
|
|||
#if os(OSX)
|
||||
let package = Package(
|
||||
name: "RxSwift",
|
||||
exclude: [
|
||||
"Sources/RxCocoa",
|
||||
"Sources/RxTests",
|
||||
"Sources/AllTests"
|
||||
],
|
||||
targets: [
|
||||
Target(
|
||||
name: "RxSwift"
|
||||
|
|
@ -32,14 +27,16 @@ let package = Package(
|
|||
.Target(name: "RxTests")
|
||||
]
|
||||
)
|
||||
],
|
||||
exclude: [
|
||||
"Sources/RxCocoa",
|
||||
"Sources/RxTests",
|
||||
"Sources/AllTests"
|
||||
]
|
||||
)
|
||||
#elseif os(Linux)
|
||||
let package = Package(
|
||||
name: "RxSwift",
|
||||
exclude: [
|
||||
"Sources/RxCocoa",
|
||||
],
|
||||
targets: [
|
||||
Target(
|
||||
name: "RxSwift"
|
||||
|
|
@ -64,6 +61,9 @@ let package = Package(
|
|||
.Target(name: "RxTests")
|
||||
]
|
||||
)
|
||||
],
|
||||
exclude: [
|
||||
"Sources/RxCocoa",
|
||||
]
|
||||
)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@
|
|||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
|
@ -201,6 +202,7 @@
|
|||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,28 +16,29 @@ if Process.argc != 3 {
|
|||
let sourceFilesRoot = Process.arguments[1]
|
||||
let derivedData = Process.arguments[2]
|
||||
|
||||
let fileManager = NSFileManager()
|
||||
let fileManager = FileManager()
|
||||
|
||||
func escape(value: String) -> String {
|
||||
let escapedString = value.stringByReplacingOccurrencesOfString("\n", withString: "\\n")
|
||||
let escapedString1 = escapedString.stringByReplacingOccurrencesOfString("\r", withString: "\\r")
|
||||
let escapedString2 = escapedString1.stringByReplacingOccurrencesOfString("\"", withString: "\\\"")
|
||||
let escapedString = value.replacingOccurrences(of: "\n", with: "\\n")
|
||||
let escapedString1 = escapedString.replacingOccurrences(of: "\r", with: "\\r")
|
||||
let escapedString2 = escapedString1.replacingOccurrences(of: "\"", with: "\\\"")
|
||||
|
||||
return "\"\(escapedString2)\""
|
||||
}
|
||||
|
||||
func processFile(path: String, outputPath: String) -> String {
|
||||
let rawContent = NSData(contentsOfFile: path)!
|
||||
let content = NSString(data: rawContent, encoding: NSUTF8StringEncoding)! as String
|
||||
let url = URL(fileURLWithPath: path)
|
||||
let rawContent = try! Data(contentsOf: url)
|
||||
let content = String(data: rawContent, encoding: String.Encoding.utf8)
|
||||
|
||||
let components = content.componentsSeparatedByString("<%")
|
||||
guard let components = content?.components(separatedBy: "<%") else { return "" }
|
||||
|
||||
var functionContentComponents: [String] = []
|
||||
functionContentComponents.append("var components: [String] = [\"// This file is autogenerated. Take a look at `Preprocessor` target in RxSwift project \\n\"]\n")
|
||||
functionContentComponents.append("components.append(\(escape(components[0])))\n")
|
||||
functionContentComponents.append("components.append(\(escape(value: components[0])))\n")
|
||||
|
||||
for codePlusSuffix in (components[1 ..< components.count]) {
|
||||
let codePlusSuffixSeparated = codePlusSuffix.componentsSeparatedByString("%>")
|
||||
let codePlusSuffixSeparated = codePlusSuffix.components(separatedBy: "%>")
|
||||
if codePlusSuffixSeparated.count != 2 {
|
||||
fatalError("Error in \(path) near \(codePlusSuffix)")
|
||||
}
|
||||
|
|
@ -46,24 +47,24 @@ func processFile(path: String, outputPath: String) -> String {
|
|||
let suffix = codePlusSuffixSeparated[1]
|
||||
|
||||
if code.hasPrefix("=") {
|
||||
functionContentComponents.append("components.append(String(\(code.substringFromIndex(code.startIndex.successor()))))\n")
|
||||
functionContentComponents.append("components.append(String(\(code.substring(from: code.index(after: code.startIndex)))))\n")
|
||||
}
|
||||
else {
|
||||
functionContentComponents.append("\(code)\n")
|
||||
}
|
||||
|
||||
functionContentComponents.append("components.append(\(escape(suffix)));\n")
|
||||
functionContentComponents.append("components.append(\(escape(value: suffix)));\n")
|
||||
}
|
||||
|
||||
functionContentComponents.append("try! components.joinWithSeparator(\"\").writeToFile(\"\(outputPath)\", atomically: false, encoding: NSUTF8StringEncoding)")
|
||||
functionContentComponents.append("try! components.joined(separator:\"\").write(toFile:\"\(outputPath)\", atomically: false, encoding: String.Encoding.utf8)")
|
||||
|
||||
return functionContentComponents.joinWithSeparator("")
|
||||
return functionContentComponents.joined(separator: "")
|
||||
}
|
||||
|
||||
func runCommand(path: String) {
|
||||
_ = NSProcessInfo().processIdentifier
|
||||
_ = ProcessInfo().processIdentifier
|
||||
|
||||
let task = NSTask()
|
||||
let task = Task()
|
||||
task.launchPath = "/bin/bash"
|
||||
task.arguments = ["-c", "xcrun swift \"\(path)\""]
|
||||
|
||||
|
|
@ -71,34 +72,34 @@ func runCommand(path: String) {
|
|||
|
||||
task.waitUntilExit()
|
||||
|
||||
if task.terminationReason != NSTaskTerminationReason.Exit {
|
||||
if task.terminationReason != Task.TerminationReason.exit {
|
||||
exit(-1)
|
||||
}
|
||||
}
|
||||
|
||||
let files = fileManager.subpathsAtPath(sourceFilesRoot)
|
||||
let files = try fileManager.subpathsOfDirectory(atPath: sourceFilesRoot)
|
||||
|
||||
var generateAllFiles = ["// Generated code\n", "import Foundation\n"]
|
||||
|
||||
for file in files! {
|
||||
for file in files {
|
||||
if ((file as NSString).pathExtension ?? "") != "tt" {
|
||||
continue
|
||||
}
|
||||
|
||||
print(file)
|
||||
|
||||
let path = (sourceFilesRoot as NSString).stringByAppendingPathComponent(file as String)
|
||||
let path = (sourceFilesRoot as NSString).appendingPathComponent(file as String)
|
||||
let endIndex = path.index(before: path.index(before: path.index(before: path.endIndex)))
|
||||
let outputPath = path.substring(to: endIndex) + ".swift"
|
||||
|
||||
let outputPath = path.substringToIndex(path.endIndex.predecessor().predecessor().predecessor()) + ".swift"
|
||||
|
||||
generateAllFiles.append("_ = { () -> Void in\n\(processFile(path, outputPath: outputPath))\n}()\n")
|
||||
generateAllFiles.append("_ = { () -> Void in\n\(processFile(path: path, outputPath: outputPath))\n}()\n")
|
||||
}
|
||||
|
||||
let script = generateAllFiles.joinWithSeparator("")
|
||||
let scriptPath = (derivedData as NSString).stringByAppendingPathComponent("_preprocessor.sh")
|
||||
let script = generateAllFiles.joined(separator: "")
|
||||
let scriptPath = (derivedData as NSString).appendingPathComponent("_preprocessor.sh")
|
||||
|
||||
do {
|
||||
try script.writeToFile(scriptPath, atomically: true, encoding: NSUTF8StringEncoding)
|
||||
try script.write(toFile: scriptPath, atomically: true, encoding: String.Encoding.utf8)
|
||||
} catch _ {
|
||||
}
|
||||
runCommand(scriptPath)
|
||||
runCommand(path: scriptPath)
|
||||
|
|
|
|||
53
README.md
53
README.md
|
|
@ -3,10 +3,12 @@
|
|||
|
||||
[](https://travis-ci.org/ReactiveX/RxSwift)   [](https://github.com/Carthage/Carthage)
|
||||
|
||||
Xcode 7.3 Swift 2.2 required
|
||||
|
||||
## About Rx
|
||||
|
||||
**:warning: This readme describes RxSwift 3.0 version that requires Swift 3.0:warning:**
|
||||
|
||||
**:warning: If you are looking for Swift 2.3 compatible version, please take a look at RxSwift ~> 2.0 versions and [swift-2.3](https://github.com/ReactiveX/RxSwift/tree/rxswift-2.0) branch :warning:**
|
||||
|
||||
Rx is a [generic abstraction of computation](https://youtu.be/looJcaeboBY) expressed through `Observable<Element>` interface.
|
||||
|
||||
This is a Swift version of [Rx](https://github.com/Reactive-Extensions/Rx.NET).
|
||||
|
|
@ -33,6 +35,7 @@ KVO observing, async operations and streams are all unified under [abstraction o
|
|||
* [what are hot and cold observable sequences?](Documentation/HotAndColdObservables.md)
|
||||
* [what does the the public API look like?](Documentation/API.md)
|
||||
|
||||
|
||||
###### ... install
|
||||
|
||||
* Integrate RxSwift/RxCocoa with my app. [Installation Guide](Documentation/Installation.md)
|
||||
|
|
@ -44,8 +47,8 @@ KVO observing, async operations and streams are all unified under [abstraction o
|
|||
|
||||
###### ... interact
|
||||
|
||||
* All of this is great, but it would be nice to talk with other people using RxSwift and exchange experiences. <br />[](http://slack.rxswift.org) [Join Slack Channel](http://slack.rxswift.org/)
|
||||
* Report a problem using the library. [Open an Issue With Bug Template](Documentation/IssueTemplate.md)
|
||||
* All of this is great, but it would be nice to talk with other people using RxSwift and exchange experiences. <br />[](http://slack.rxswift.org) [Join Slack Channel](http://rxswift-slack.herokuapp.com)
|
||||
* Report a problem using the library. [Open an Issue With Bug Template](ISSUE_TEMPLATE.md)
|
||||
* Request a new feature. [Open an Issue With Feature Request Template](Documentation/NewFeatureRequestTemplate.md)
|
||||
|
||||
|
||||
|
|
@ -77,7 +80,7 @@ KVO observing, async operations and streams are all unified under [abstraction o
|
|||
</tr>
|
||||
<tr>
|
||||
<td><div class="highlight highlight-source-swift"><pre>
|
||||
let searchResults = searchBar.rx_text
|
||||
let searchResults = searchBar.rx.text
|
||||
.throttle(0.3, scheduler: MainScheduler.instance)
|
||||
.distinctUntilChanged()
|
||||
.flatMapLatest { query -> Observable<[Repository]> in
|
||||
|
|
@ -96,7 +99,7 @@ let searchResults = searchBar.rx_text
|
|||
<tr>
|
||||
<td width="30%"><div class="highlight highlight-source-swift"><pre>
|
||||
searchResults
|
||||
.bindTo(tableView.rx_itemsWithCellIdentifier("Cell")) {
|
||||
.bindTo(tableView.rx.items(cellIdentifier: "Cell")) {
|
||||
(index, repository: Repository, cell) in
|
||||
cell.textLabel?.text = repository.name
|
||||
cell.detailTextLabel?.text = repository.url
|
||||
|
|
@ -106,6 +109,16 @@ searchResults
|
|||
</table>
|
||||
|
||||
|
||||
## Requirements
|
||||
|
||||
* Xcode 8.0 beta 6 (8S201h)
|
||||
* Swift 3.0
|
||||
|
||||
* iOS 8.0+
|
||||
* Mac OS X 10.10+
|
||||
* tvOS 9.0+
|
||||
* watchOS 2.0+
|
||||
|
||||
## Installation
|
||||
|
||||
Rx doesn't contain any external dependencies.
|
||||
|
|
@ -118,38 +131,48 @@ Open Rx.xcworkspace, choose `RxExample` and hit run. This method will build ever
|
|||
|
||||
### [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
|
||||
|
||||
**:warning: IMPORTANT! For tvOS support, CocoaPods `0.39` is required. :warning:**
|
||||
|
||||
```
|
||||
# Podfile
|
||||
use_frameworks!
|
||||
|
||||
target 'YOUR_TARGET_NAME' do
|
||||
pod 'RxSwift', '~> 2.0'
|
||||
pod 'RxCocoa', '~> 2.0'
|
||||
pod 'RxSwift', '~> 3.0.0.alpha.1'
|
||||
pod 'RxCocoa', '~> 3.0.0.alpha.1'
|
||||
end
|
||||
|
||||
# RxTests and RxBlocking make the most sense in the context of unit/integration tests
|
||||
target 'YOUR_TESTING_TARGET' do
|
||||
pod 'RxBlocking', '~> 2.0'
|
||||
pod 'RxTests', '~> 2.0'
|
||||
pod 'RxBlocking', '~> 3.0.0.alpha.1'
|
||||
pod 'RxTests', '~> 3.0.0.alpha.1'
|
||||
end
|
||||
```
|
||||
|
||||
Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type:
|
||||
|
||||
**:warning: If you want to use CocoaPods with Xcode 8.0 beta and Swift 3.0, you might need to add the following
|
||||
lines to your podfile: :warning:**
|
||||
|
||||
```
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['SWIFT_VERSION'] = '3.0'
|
||||
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.10'
|
||||
end
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
```
|
||||
$ pod install
|
||||
```
|
||||
|
||||
### [Carthage](https://github.com/Carthage/Carthage)
|
||||
|
||||
**Xcode 7.1 required**
|
||||
|
||||
Add this to `Cartfile`
|
||||
|
||||
```
|
||||
github "ReactiveX/RxSwift" ~> 2.0
|
||||
github "ReactiveX/RxSwift" "3.0.0.alpha.1"
|
||||
```
|
||||
|
||||
```
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ example("startWith") {
|
|||
.startWith("1️⃣")
|
||||
.startWith("2️⃣")
|
||||
.startWith("3️⃣", "🅰️", "🅱️")
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -40,7 +40,7 @@ example("merge") {
|
|||
|
||||
Observable.of(subject1, subject2)
|
||||
.merge()
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
subject1.onNext("🅰️")
|
||||
|
|
@ -70,7 +70,7 @@ example("zip") {
|
|||
Observable.zip(stringSubject, intSubject) { stringElement, intElement in
|
||||
"\(stringElement) \(intElement)"
|
||||
}
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
stringSubject.onNext("🅰️")
|
||||
|
|
@ -98,7 +98,7 @@ example("combineLatest") {
|
|||
Observable.combineLatest(stringSubject, intSubject) { stringElement, intElement in
|
||||
"\(stringElement) \(intElement)"
|
||||
}
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
stringSubject.onNext("🅰️")
|
||||
|
|
@ -115,13 +115,13 @@ example("Array.combineLatest") {
|
|||
let disposeBag = DisposeBag()
|
||||
|
||||
let stringObservable = Observable.just("❤️")
|
||||
let fruitObservable = ["🍎", "🍐", "🍊"].toObservable()
|
||||
let fruitObservable = Observable.from(["🍎", "🍐", "🍊"])
|
||||
let animalObservable = Observable.of("🐶", "🐱", "🐭", "🐹")
|
||||
|
||||
[stringObservable, fruitObservable, animalObservable].combineLatest {
|
||||
"\($0[0]) \($0[1]) \($0[2])"
|
||||
}
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -141,7 +141,7 @@ example("switchLatest") {
|
|||
|
||||
variable.asObservable()
|
||||
.switchLatest()
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
subject1.onNext("🏈")
|
||||
|
|
|
|||
|
|
@ -23,15 +23,15 @@ func sampleWithoutConnectableOperators() {
|
|||
let interval = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
|
||||
|
||||
_ = interval
|
||||
.subscribeNext { print("Subscription: 1, Event: \($0)") }
|
||||
.subscribe(onNext: { print("Subscription: 1, Event: \($0)") })
|
||||
|
||||
delay(5) {
|
||||
_ = interval
|
||||
.subscribeNext { print("Subscription: 2, Event: \($0)") }
|
||||
.subscribe(onNext: { print("Subscription: 2, Event: \($0)") })
|
||||
}
|
||||
}
|
||||
|
||||
// sampleWithoutConnectableOperators() // ⚠️ Uncomment to run this example; comment to stop running
|
||||
//sampleWithoutConnectableOperators() // ⚠️ Uncomment to run this example; comment to stop running
|
||||
/*:
|
||||
> `interval` creates an `Observable` sequence that emits elements after each `period`, on the specified scheduler. [More info](http://reactivex.io/documentation/operators/interval.html)
|
||||

|
||||
|
|
@ -47,18 +47,18 @@ func sampleWithPublish() {
|
|||
.publish()
|
||||
|
||||
_ = intSequence
|
||||
.subscribeNext { print("Subscription 1:, Event: \($0)") }
|
||||
.subscribe(onNext: { print("Subscription 1:, Event: \($0)") })
|
||||
|
||||
delay(2) { intSequence.connect() }
|
||||
delay(2) { _ = intSequence.connect() }
|
||||
|
||||
delay(4) {
|
||||
_ = intSequence
|
||||
.subscribeNext { print("Subscription 2:, Event: \($0)") }
|
||||
.subscribe(onNext: { print("Subscription 2:, Event: \($0)") })
|
||||
}
|
||||
|
||||
delay(6) {
|
||||
_ = intSequence
|
||||
.subscribeNext { print("Subscription 3:, Event: \($0)") }
|
||||
.subscribe(onNext: { print("Subscription 3:, Event: \($0)") })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -79,18 +79,18 @@ func sampleWithReplayBuffer() {
|
|||
.replay(5)
|
||||
|
||||
_ = intSequence
|
||||
.subscribeNext { print("Subscription 1:, Event: \($0)") }
|
||||
.subscribe(onNext: { print("Subscription 1:, Event: \($0)") })
|
||||
|
||||
delay(2) { intSequence.connect() }
|
||||
delay(2) { _ = intSequence.connect() }
|
||||
|
||||
delay(4) {
|
||||
_ = intSequence
|
||||
.subscribeNext { print("Subscription 2:, Event: \($0)") }
|
||||
.subscribe(onNext: { print("Subscription 2:, Event: \($0)") })
|
||||
}
|
||||
|
||||
delay(8) {
|
||||
_ = intSequence
|
||||
.subscribeNext { print("Subscription 3:, Event: \($0)") }
|
||||
.subscribe(onNext: { print("Subscription 3:, Event: \($0)") })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -107,24 +107,24 @@ func sampleWithMulticast() {
|
|||
let subject = PublishSubject<Int>()
|
||||
|
||||
_ = subject
|
||||
.subscribeNext { print("Subject: \($0)") }
|
||||
.subscribe(onNext: { print("Subject: \($0)") })
|
||||
|
||||
let intSequence = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
|
||||
.multicast(subject)
|
||||
|
||||
_ = intSequence
|
||||
.subscribeNext { print("\tSubscription 1:, Event: \($0)") }
|
||||
.subscribe(onNext: { print("\tSubscription 1:, Event: \($0)") })
|
||||
|
||||
delay(2) { intSequence.connect() }
|
||||
delay(2) { _ = intSequence.connect() }
|
||||
|
||||
delay(4) {
|
||||
_ = intSequence
|
||||
.subscribeNext { print("\tSubscription 2:, Event: \($0)") }
|
||||
.subscribe(onNext: { print("\tSubscription 2:, Event: \($0)") })
|
||||
}
|
||||
|
||||
delay(6) {
|
||||
_ = intSequence
|
||||
.subscribeNext { print("\tSubscription 3:, Event: \($0)") }
|
||||
.subscribe(onNext: { print("\tSubscription 3:, Event: \($0)") })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,13 +63,13 @@ example("of") {
|
|||
let disposeBag = DisposeBag()
|
||||
|
||||
Observable.of("🐶", "🐱", "🐭", "🐹")
|
||||
.subscribeNext { element in
|
||||
.subscribe(onNext: { element in
|
||||
print(element)
|
||||
}
|
||||
})
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
> This example also introduces using the `subscribeNext(_:)` convenience method. Unlike `subscribe(_:)`, which subscribes an _event_ handler for all event types (Next, Error, and Completed), `subscribeNext(_:)` subscribes an _element_ handler that will ignore Error and Completed events and only produce Next event elements. There are also `subscribeError(_:)` and `subscribeCompleted(_:)` convenience methods, should you only want to subscribe to those event types. And there is a `subscribe(onNext:onError:onCompleted:onDisposed:)` method, which allows you to react to one or more event types and when the subscription is terminated for any reason, or disposed, in a single call:
|
||||
> This example also introduces using the `subscribe(onNext:)` convenience method. Unlike `subscribe(_:)`, which subscribes an _event_ handler for all event types (Next, Error, and Completed), `subscribe(onNext:)` subscribes an _element_ handler that will ignore Error and Completed events and only produce Next event elements. There are also `subscribe(onError:)` and `subscribe(onCompleted:)` convenience methods, should you only want to subscribe to those event types. And there is a `subscribe(onNext:onError:onCompleted:onDisposed:)` method, which allows you to react to one or more event types and when the subscription is terminated for any reason, or disposed, in a single call:
|
||||
```
|
||||
someObservable.subscribe(
|
||||
onNext: { print("Element:", $0) },
|
||||
|
|
@ -79,14 +79,14 @@ example("of") {
|
|||
)
|
||||
```
|
||||
----
|
||||
## toObservable
|
||||
## from
|
||||
Creates an `Observable` sequence from a `SequenceType`, such as an `Array`, `Dictionary`, or `Set`.
|
||||
*/
|
||||
example("toObservable") {
|
||||
example("from") {
|
||||
let disposeBag = DisposeBag()
|
||||
|
||||
["🐶", "🐱", "🐭", "🐹"].toObservable()
|
||||
.subscribeNext { print($0) }
|
||||
Observable.from(["🐶", "🐱", "🐭", "🐹"])
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -100,9 +100,9 @@ example("create") {
|
|||
|
||||
let myJust = { (element: String) -> Observable<String> in
|
||||
return Observable.create { observer in
|
||||
observer.on(.Next(element))
|
||||
observer.on(.Completed)
|
||||
return NopDisposable.instance
|
||||
observer.on(.next(element))
|
||||
observer.on(.completed)
|
||||
return Disposables.create()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ example("repeatElement") {
|
|||
|
||||
Observable.repeatElement("🔴")
|
||||
.take(3)
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -149,7 +149,7 @@ example("generate") {
|
|||
condition: { $0 < 3 },
|
||||
iterate: { $0 + 1 }
|
||||
)
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -170,16 +170,16 @@ example("deferred") {
|
|||
observer.onNext("🐶")
|
||||
observer.onNext("🐱")
|
||||
observer.onNext("🐵")
|
||||
return NopDisposable.instance
|
||||
return Disposables.create()
|
||||
}
|
||||
}
|
||||
|
||||
deferredSequence
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
deferredSequence
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -190,7 +190,7 @@ example("deferred") {
|
|||
example("error") {
|
||||
let disposeBag = DisposeBag()
|
||||
|
||||
Observable<Int>.error(Error.Test)
|
||||
Observable<Int>.error(TestError.test)
|
||||
.subscribe { print($0) }
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
|
|
@ -203,8 +203,8 @@ example("doOn") {
|
|||
let disposeBag = DisposeBag()
|
||||
|
||||
Observable.of("🍎", "🍐", "🍊", "🍋")
|
||||
.doOn { print("Intercepted:", $0) }
|
||||
.subscribeNext { print($0) }
|
||||
.do(onNext: { print("Intercepted:", $0) }, onError: { print("Intercepted error:", $0) }, onCompleted: { print("Completed") })
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
//: > There are also `doOnNext(_:)`, `doOnError(_:)`, and `doOnCompleted(_:)` convenience methods to intercept those specific events, and `doOn(onNext:onError:onCompleted:)` to intercept one or more events in a single call.
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ example("debug") {
|
|||
observer.onNext("🍊")
|
||||
|
||||
if count < 5 {
|
||||
observer.onError(Error.Test)
|
||||
observer.onError(TestError.test)
|
||||
print("Error encountered")
|
||||
count += 1
|
||||
}
|
||||
|
|
@ -34,13 +34,13 @@ example("debug") {
|
|||
observer.onNext("🐭")
|
||||
observer.onCompleted()
|
||||
|
||||
return NopDisposable.instance
|
||||
return Disposables.create()
|
||||
}
|
||||
|
||||
sequenceThatErrors
|
||||
.retry(3)
|
||||
.debug()
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -59,11 +59,11 @@ example("RxSwift.resourceCount") {
|
|||
|
||||
let variable = Variable("🍎")
|
||||
|
||||
let subscription1 = variable.asObservable().subscribeNext { print($0) }
|
||||
let subscription1 = variable.asObservable().subscribe(onNext: { print($0) })
|
||||
|
||||
print(RxSwift.resourceCount)
|
||||
|
||||
let subscription2 = variable.asObservable().subscribeNext { print($0) }
|
||||
let subscription2 = variable.asObservable().subscribe(onNext: { print($0) })
|
||||
|
||||
print(RxSwift.resourceCount)
|
||||
|
||||
|
|
@ -80,4 +80,4 @@ print(RxSwift.resourceCount)
|
|||
#endif
|
||||
//: > `RxSwift.resourceCount` is not enabled by default, and should generally not be enabled in Release builds. [Click here](Enable_RxSwift.resourceCount) for instructions on how to enable it.
|
||||
|
||||
//: [Table of Contents](Table_of_Contents)
|
||||
//: [Next](@next) - [Table of Contents](Table_of_Contents)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ example("catchErrorJustReturn") {
|
|||
sequenceThatFails.onNext("😨")
|
||||
sequenceThatFails.onNext("😡")
|
||||
sequenceThatFails.onNext("🔴")
|
||||
sequenceThatFails.onError(Error.Test)
|
||||
sequenceThatFails.onError(TestError.test)
|
||||
}
|
||||
/*:
|
||||
----
|
||||
|
|
@ -40,10 +40,10 @@ example("catchErrorJustReturn") {
|
|||
example("catchError") {
|
||||
let disposeBag = DisposeBag()
|
||||
|
||||
let sequenceThatErrors = PublishSubject<String>()
|
||||
let sequenceThatFails = PublishSubject<String>()
|
||||
let recoverySequence = PublishSubject<String>()
|
||||
|
||||
sequenceThatErrors
|
||||
sequenceThatFails
|
||||
.catchError {
|
||||
print("Error:", $0)
|
||||
return recoverySequence
|
||||
|
|
@ -51,18 +51,18 @@ example("catchError") {
|
|||
.subscribe { print($0) }
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
sequenceThatErrors.onNext("😬")
|
||||
sequenceThatErrors.onNext("😨")
|
||||
sequenceThatErrors.onNext("😡")
|
||||
sequenceThatErrors.onNext("🔴")
|
||||
sequenceThatErrors.onError(Error.Test)
|
||||
sequenceThatFails.onNext("😬")
|
||||
sequenceThatFails.onNext("😨")
|
||||
sequenceThatFails.onNext("😡")
|
||||
sequenceThatFails.onNext("🔴")
|
||||
sequenceThatFails.onError(TestError.test)
|
||||
|
||||
recoverySequence.onNext("😊")
|
||||
}
|
||||
/*:
|
||||
----
|
||||
## `retry`
|
||||
Recovers repeatedly Error events by rescribing to the `Observable` sequence, indefinitely. [More info](http://reactivex.io/documentation/operators/retry.html)
|
||||
Recovers repeatedly Error events by resubscribing to the `Observable` sequence, indefinitely. [More info](http://reactivex.io/documentation/operators/retry.html)
|
||||

|
||||
*/
|
||||
example("retry") {
|
||||
|
|
@ -75,7 +75,7 @@ example("retry") {
|
|||
observer.onNext("🍊")
|
||||
|
||||
if count == 1 {
|
||||
observer.onError(Error.Test)
|
||||
observer.onError(TestError.test)
|
||||
print("Error encountered")
|
||||
count += 1
|
||||
}
|
||||
|
|
@ -85,12 +85,12 @@ example("retry") {
|
|||
observer.onNext("🐭")
|
||||
observer.onCompleted()
|
||||
|
||||
return NopDisposable.instance
|
||||
return Disposables.create()
|
||||
}
|
||||
|
||||
sequenceThatErrors
|
||||
.retry()
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -109,7 +109,7 @@ example("retry maxAttemptCount") {
|
|||
observer.onNext("🍊")
|
||||
|
||||
if count < 5 {
|
||||
observer.onError(Error.Test)
|
||||
observer.onError(TestError.test)
|
||||
print("Error encountered")
|
||||
count += 1
|
||||
}
|
||||
|
|
@ -119,12 +119,12 @@ example("retry maxAttemptCount") {
|
|||
observer.onNext("🐭")
|
||||
observer.onCompleted()
|
||||
|
||||
return NopDisposable.instance
|
||||
return Disposables.create()
|
||||
}
|
||||
|
||||
sequenceThatErrors
|
||||
.retry(3)
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ example("filter") {
|
|||
.filter {
|
||||
$0 == "🐱"
|
||||
}
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -39,7 +39,7 @@ example("distinctUntilChanged") {
|
|||
|
||||
Observable.of("🐱", "🐷", "🐱", "🐱", "🐱", "🐵", "🐱")
|
||||
.distinctUntilChanged()
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -53,7 +53,7 @@ example("elementAt") {
|
|||
|
||||
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
|
||||
.elementAt(3)
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -66,13 +66,23 @@ example("single") {
|
|||
|
||||
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
|
||||
.single()
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
|
||||
example("single with conditions") {
|
||||
let disposeBag = DisposeBag()
|
||||
|
||||
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
|
||||
.single { $0 == "🐸" }
|
||||
.subscribe { print($0) }
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
Observable.of("🐱", "🐰", "🐶", "🐱", "🐰", "🐶")
|
||||
.single { $0 == "🐰" }
|
||||
.subscribe { print($0) }
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
|
||||
.single { $0 == "🔵" }
|
||||
.subscribe { print($0) }
|
||||
|
|
@ -89,7 +99,7 @@ example("take") {
|
|||
|
||||
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
|
||||
.take(3)
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -103,7 +113,7 @@ example("takeLast") {
|
|||
|
||||
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
|
||||
.takeLast(3)
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -117,7 +127,7 @@ example("takeWhile") {
|
|||
|
||||
Observable.of(1, 2, 3, 4, 5, 6)
|
||||
.takeWhile { $0 < 4 }
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -158,7 +168,7 @@ example("skip") {
|
|||
|
||||
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
|
||||
.skip(2)
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -172,7 +182,7 @@ example("skipWhile") {
|
|||
|
||||
Observable.of(1, 2, 3, 4, 5, 6)
|
||||
.skipWhile { $0 < 4 }
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -187,7 +197,7 @@ example("skipWhileWithIndex") {
|
|||
.skipWhileWithIndex { element, index in
|
||||
index < 3
|
||||
}
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -204,7 +214,7 @@ example("skipUntil") {
|
|||
|
||||
sourceSequence
|
||||
.skipUntil(referenceSequence)
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
sourceSequence.onNext("🐱")
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@
|
|||
----
|
||||
[Previous](@previous)
|
||||
*/
|
||||
|
||||
import RxSwift
|
||||
|
||||
/*:
|
||||
# Introduction
|
||||
|
||||
|
|
@ -30,11 +32,11 @@ All of these various systems makes our code needlessly complex. Wouldn't it be b
|
|||
* `ObservableType.subscribe(_:)` takes an observer (`ObserverType`) parameter, which will be subscribed to automatically receive sequence events and elements emitted by the `Observable`, instead of manually calling `next()` on the returned generator.
|
||||
*/
|
||||
/*:
|
||||
If an `Observable` emits a Next event (`Event.Next(Element)`), it can continue to emit more events. However, if the `Observable` emits either an Error event (`Event.Error(ErrorType)`) or a Completed event (`Event.Completed`), the `Observable` sequence cannot emit additional events to the subscriber.
|
||||
If an `Observable` emits a next event (`Event.next(Element)`), it can continue to emit more events. However, if the `Observable` emits either an error event (`Event.error(ErrorType)`) or a completed event (`Event.completed`), the `Observable` sequence cannot emit additional events to the subscriber.
|
||||
|
||||
Sequence grammar explains this more concisely:
|
||||
|
||||
`Next* (Error | Completed)?`
|
||||
`next* (error | completed)?`
|
||||
|
||||
And this can also be explained more visually using diagrams:
|
||||
|
||||
|
|
@ -44,7 +46,7 @@ All of these various systems makes our code needlessly complex. Wouldn't it be b
|
|||
|
||||
`--tap--tap----------tap--> // "|" = Continues indefinitely, such as a sequence of button taps`
|
||||
|
||||
> These diagrams are call marble diagrams. You can learn more about them at [RxMarbles.com](http://rxmarbles.com).
|
||||
> These diagrams are called marble diagrams. You can learn more about them at [RxMarbles.com](http://rxmarbles.com).
|
||||
*/
|
||||
/*:
|
||||
### Observables and observers (aka subscribers)
|
||||
|
|
@ -54,9 +56,9 @@ All of these various systems makes our code needlessly complex. Wouldn't it be b
|
|||
example("Observable with no subscribers") {
|
||||
_ = Observable<String>.create { observerOfString -> Disposable in
|
||||
print("This will never be printed")
|
||||
observerOfString.on(.Next("😬"))
|
||||
observerOfString.on(.Completed)
|
||||
return NopDisposable.instance
|
||||
observerOfString.on(.next("😬"))
|
||||
observerOfString.on(.completed)
|
||||
return Disposables.create()
|
||||
}
|
||||
}
|
||||
/*:
|
||||
|
|
@ -64,11 +66,11 @@ example("Observable with no subscribers") {
|
|||
In the following example, the closure will be executed when `subscribe(_:)` is called:
|
||||
*/
|
||||
example("Observable with subscriber") {
|
||||
_ = Observable<String>.create { observerOfString in
|
||||
_ = Observable<String>.create { observerOfString in
|
||||
print("Observable created")
|
||||
observerOfString.on(.Next("😉"))
|
||||
observerOfString.on(.Completed)
|
||||
return NopDisposable.instance
|
||||
observerOfString.on(.next("😉"))
|
||||
observerOfString.on(.completed)
|
||||
return Disposables.create()
|
||||
}
|
||||
.subscribe { event in
|
||||
print(event)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ example("reduce") {
|
|||
|
||||
Observable.of(10, 100, 1000)
|
||||
.reduce(1, accumulator: +)
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -61,6 +61,7 @@ example("concat") {
|
|||
|
||||
variable.value = subject2
|
||||
|
||||
subject2.onNext("I would be ignored")
|
||||
subject2.onNext("🐱")
|
||||
|
||||
subject1.onCompleted()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ example("map") {
|
|||
let disposeBag = DisposeBag()
|
||||
Observable.of(1, 2, 3)
|
||||
.map { $0 * $0 }
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
/*:
|
||||
|
|
@ -42,7 +42,7 @@ example("flatMap and flatMapLatest") {
|
|||
|
||||
player.asObservable()
|
||||
.flatMap { $0.score.asObservable() } // Change flatMap to flatMapLatest and observe change in printed output
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
|
||||
👦🏻.score.value = 85
|
||||
|
|
@ -71,7 +71,7 @@ example("scan") {
|
|||
.scan(1) { aggregateValue, newValue in
|
||||
aggregateValue + newValue
|
||||
}
|
||||
.subscribeNext { print($0) }
|
||||
.subscribe(onNext: { print($0) })
|
||||
.addDisposableTo(disposeBag)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ extension ObservableType {
|
|||
Add observer with `id` and print each emitted event.
|
||||
- parameter id: an identifier for the subscription.
|
||||
*/
|
||||
func addObserver(id: String) -> Disposable {
|
||||
func addObserver(_ id: String) -> Disposable {
|
||||
return subscribe { print("Subscription:", id, "Event:", $0) }
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ example("PublishSubject") {
|
|||
subject.onNext("🅱️")
|
||||
}
|
||||
/*:
|
||||
> This example also introduces using the `onNext(_:)` convenience method, equivalent to `on(.Next(_:)`, which causes a new Next event to be emitted to subscribers with the provided `element`. There are also `onError(_:)` and `onCompleted()` convenience methods, equivalent to `on(.Error(_:))` and `on(.Completed)`, respectively.
|
||||
> This example also introduces using the `onNext(_:)` convenience method, equivalent to `on(.next(_:)`, which causes a new Next event to be emitted to subscribers with the provided `element`. There are also `onError(_:)` and `onCompleted()` convenience methods, equivalent to `on(.error(_:))` and `on(.completed)`, respectively.
|
||||
----
|
||||
## ReplaySubject
|
||||
Broadcasts new events to all subscribers, and the specified `bufferSize` number of previous events to new subscribers.
|
||||
|
|
|
|||
|
|
@ -5,32 +5,31 @@ import Foundation
|
|||
- parameter description: example description
|
||||
- parameter action: `Void` closure
|
||||
*/
|
||||
public func example(description: String, @noescape action: Void -> Void) {
|
||||
public func example(_ description: String, action: (Void) -> Void) {
|
||||
printExampleHeader(description)
|
||||
action()
|
||||
}
|
||||
|
||||
public func printExampleHeader(description: String) {
|
||||
public func printExampleHeader(_ description: String) {
|
||||
print("\n--- \(description) example ---")
|
||||
}
|
||||
|
||||
public enum Error: ErrorType {
|
||||
case Test
|
||||
public enum TestError: Swift.Error {
|
||||
case test
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Executes `closure` on main thread after `delay` seconds.
|
||||
- parameter delay: time in seconds to wait before executing `closure`
|
||||
- parameter closure: `Void` closure
|
||||
*/
|
||||
public func delay(delay: Double, closure: Void -> Void) {
|
||||
dispatch_after(
|
||||
dispatch_time(
|
||||
DISPATCH_TIME_NOW,
|
||||
Int64(delay * Double(NSEC_PER_SEC))
|
||||
),
|
||||
dispatch_get_main_queue(),
|
||||
closure)
|
||||
public func delay(_ delay: Double, closure: @escaping (Void) -> Void) {
|
||||
|
||||
let delayTime = DispatchTime.now() + DispatchTimeInterval.seconds(Int(delay))
|
||||
DispatchQueue.main.asyncAfter(deadline: delayTime) {
|
||||
closure()
|
||||
}
|
||||
}
|
||||
|
||||
#if NOT_IN_PLAYGROUND
|
||||
|
|
@ -39,10 +38,10 @@ public func delay(delay: Double, closure: Void -> Void) {
|
|||
|
||||
#else
|
||||
|
||||
import XCPlayground
|
||||
import PlaygroundSupport
|
||||
|
||||
public func playgroundShouldContinueIndefinitely() {
|
||||
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
|
||||
PlaygroundPage.current.needsIndefiniteExecution = true
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
[
|
||||
{
|
||||
"file": "/Users/mo/Documents/OpenSource/RxSwift/Rx.playground/Sources/SupportCode.swift",
|
||||
"offset": 276,
|
||||
"remove": 9,
|
||||
},
|
||||
{
|
||||
"file": "/Users/mo/Documents/OpenSource/RxSwift/Rx.playground/Sources/SupportCode.swift",
|
||||
"offset": 733,
|
||||
"text": "@escaping ",
|
||||
}
|
||||
]
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<playground version='6.0' target-platform='osx' display-mode='rendered'>
|
||||
<playground version='6.0' target-platform='osx' display-mode='raw' last-migration='0800'>
|
||||
<pages>
|
||||
<page name='Table_of_Contents'/>
|
||||
<page name='Introduction'/>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,17 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
033C2EF61D081C460050C015 /* UIScrollView+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 033C2EF41D081B2A0050C015 /* UIScrollView+RxTests.swift */; };
|
||||
1AF67DA21CED420A00C310FA /* PublishSubjectTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AF67DA11CED420A00C310FA /* PublishSubjectTest.swift */; };
|
||||
1AF67DA31CED427D00C310FA /* PublishSubjectTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AF67DA11CED420A00C310FA /* PublishSubjectTest.swift */; };
|
||||
1AF67DA41CED427D00C310FA /* PublishSubjectTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AF67DA11CED420A00C310FA /* PublishSubjectTest.swift */; };
|
||||
1AF67DA61CED430100C310FA /* ReplaySubjectTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AF67DA51CED430100C310FA /* ReplaySubjectTest.swift */; };
|
||||
1AF67DA71CED430100C310FA /* ReplaySubjectTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AF67DA51CED430100C310FA /* ReplaySubjectTest.swift */; };
|
||||
1AF67DA81CED430100C310FA /* ReplaySubjectTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AF67DA51CED430100C310FA /* ReplaySubjectTest.swift */; };
|
||||
271A97411CFC996B00D64125 /* UIViewController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 271A97401CFC996B00D64125 /* UIViewController+Rx.swift */; };
|
||||
271A97441CFC9F7B00D64125 /* UIViewControler+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 271A97421CFC99FE00D64125 /* UIViewControler+RxTests.swift */; };
|
||||
46307D4E1CDE77D800E47A1C /* UIAlertAction+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46307D4D1CDE77D800E47A1C /* UIAlertAction+Rx.swift */; };
|
||||
46307D4F1CDE77D800E47A1C /* UIAlertAction+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46307D4D1CDE77D800E47A1C /* UIAlertAction+Rx.swift */; };
|
||||
54700CA01CE37E1800EF3A8F /* UINavigationItem+RxTests.swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54700C9E1CE37D1000EF3A8F /* UINavigationItem+RxTests.swift.swift */; };
|
||||
54700CA11CE37E1900EF3A8F /* UINavigationItem+RxTests.swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54700C9E1CE37D1000EF3A8F /* UINavigationItem+RxTests.swift.swift */; };
|
||||
54D2138E1CE0824E0028D5B4 /* UINavigationItem+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54D2138C1CE081890028D5B4 /* UINavigationItem+Rx.swift */; };
|
||||
|
|
@ -29,6 +40,13 @@
|
|||
842A5A2C1C357F92003568D5 /* NSTextStorage+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842A5A281C357F7D003568D5 /* NSTextStorage+Rx.swift */; };
|
||||
842A5A2D1C357F93003568D5 /* NSTextStorage+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842A5A281C357F7D003568D5 /* NSTextStorage+Rx.swift */; };
|
||||
842A5A2E1C357F94003568D5 /* NSTextStorage+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842A5A281C357F7D003568D5 /* NSTextStorage+Rx.swift */; };
|
||||
844BC8AC1CE4FA6300F5C7CB /* RxPickerViewDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844BC8AA1CE4FA5600F5C7CB /* RxPickerViewDelegateProxy.swift */; };
|
||||
844BC8AD1CE4FA6400F5C7CB /* RxPickerViewDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844BC8AA1CE4FA5600F5C7CB /* RxPickerViewDelegateProxy.swift */; };
|
||||
844BC8AE1CE4FA6600F5C7CB /* RxPickerViewDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844BC8AA1CE4FA5600F5C7CB /* RxPickerViewDelegateProxy.swift */; };
|
||||
844BC8B41CE4FD7500F5C7CB /* UIPickerView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844BC8B31CE4FD7500F5C7CB /* UIPickerView+Rx.swift */; };
|
||||
844BC8B51CE4FD7500F5C7CB /* UIPickerView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844BC8B31CE4FD7500F5C7CB /* UIPickerView+Rx.swift */; };
|
||||
844BC8B61CE4FD7500F5C7CB /* UIPickerView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844BC8B31CE4FD7500F5C7CB /* UIPickerView+Rx.swift */; };
|
||||
844BC8BB1CE5024500F5C7CB /* UIPickerView+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844BC8B71CE5023200F5C7CB /* UIPickerView+RxTests.swift */; };
|
||||
846436E31C9AF65B0035B40D /* RxSearchControllerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */; };
|
||||
846436E51C9AF65E0035B40D /* RxSearchControllerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */; };
|
||||
846436E61C9AF6670035B40D /* RxSearchControllerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */; };
|
||||
|
|
@ -48,6 +66,18 @@
|
|||
84E4D3931C9AFD3500ADFDC9 /* UISearchController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E4D3901C9AFCD500ADFDC9 /* UISearchController+Rx.swift */; };
|
||||
84E4D3941C9AFD3600ADFDC9 /* UISearchController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E4D3901C9AFCD500ADFDC9 /* UISearchController+Rx.swift */; };
|
||||
84E4D3961C9B011000ADFDC9 /* UISearchController+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E4D3951C9B011000ADFDC9 /* UISearchController+RxTests.swift */; };
|
||||
87379AE01D61C6F50047CA88 /* Reactive.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2F461001CD7ABE400527B4D /* Reactive.swift */; };
|
||||
88718CFE1CE5D80000D88D60 /* UITabBar+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88718CFD1CE5D80000D88D60 /* UITabBar+Rx.swift */; };
|
||||
88718CFF1CE5D80000D88D60 /* UITabBar+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88718CFD1CE5D80000D88D60 /* UITabBar+Rx.swift */; };
|
||||
88718D011CE5DE2600D88D60 /* UITabBar+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88718D001CE5DE2500D88D60 /* UITabBar+RxTests.swift */; };
|
||||
88718D021CE5DE2600D88D60 /* UITabBar+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88718D001CE5DE2500D88D60 /* UITabBar+RxTests.swift */; };
|
||||
88D98F2E1CE7549A00D50457 /* RxTabBarDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D98F2D1CE7549A00D50457 /* RxTabBarDelegateProxy.swift */; };
|
||||
88D98F2F1CE7549A00D50457 /* RxTabBarDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D98F2D1CE7549A00D50457 /* RxTabBarDelegateProxy.swift */; };
|
||||
914FCD671CCDB82E0058B304 /* UIPageControl+RxTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 914FCD661CCDB82E0058B304 /* UIPageControl+RxTest.swift */; };
|
||||
914FCD681CCDB82E0058B304 /* UIPageControl+RxTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 914FCD661CCDB82E0058B304 /* UIPageControl+RxTest.swift */; };
|
||||
91BE429C1CBF7EC000F6B062 /* UIPageControl+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91BE429B1CBF7EC000F6B062 /* UIPageControl+Rx.swift */; };
|
||||
91BE429D1CBF7EC000F6B062 /* UIPageControl+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91BE429B1CBF7EC000F6B062 /* UIPageControl+Rx.swift */; };
|
||||
91BE429F1CBF7F3D00F6B062 /* UIPageControl+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91BE429B1CBF7EC000F6B062 /* UIPageControl+Rx.swift */; };
|
||||
9BA1CBD31C0F7D550044B50A /* UIActivityIndicatorView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA1CBD11C0F7C0A0044B50A /* UIActivityIndicatorView+Rx.swift */; };
|
||||
9BA1CBFD1C0F84A10044B50A /* UIActivityIndicatorView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA1CBD11C0F7C0A0044B50A /* UIActivityIndicatorView+Rx.swift */; };
|
||||
9BA1CBFE1C0F84C40044B50A /* UIActivityIndicatorView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA1CBD11C0F7C0A0044B50A /* UIActivityIndicatorView+Rx.swift */; };
|
||||
|
|
@ -92,8 +122,6 @@
|
|||
C8093CDE1B8A72BE0088E94D /* DisposeBag.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C581B8A72BE0088E94D /* DisposeBag.swift */; };
|
||||
C8093CDF1B8A72BE0088E94D /* DisposeBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C591B8A72BE0088E94D /* DisposeBase.swift */; };
|
||||
C8093CE01B8A72BE0088E94D /* DisposeBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C591B8A72BE0088E94D /* DisposeBase.swift */; };
|
||||
C8093CE11B8A72BE0088E94D /* NAryDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5A1B8A72BE0088E94D /* NAryDisposable.swift */; };
|
||||
C8093CE21B8A72BE0088E94D /* NAryDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5A1B8A72BE0088E94D /* NAryDisposable.swift */; };
|
||||
C8093CE51B8A72BE0088E94D /* NopDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5C1B8A72BE0088E94D /* NopDisposable.swift */; };
|
||||
C8093CE61B8A72BE0088E94D /* NopDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5C1B8A72BE0088E94D /* NopDisposable.swift */; };
|
||||
C8093CE71B8A72BE0088E94D /* ScheduledDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5D1B8A72BE0088E94D /* ScheduledDisposable.swift */; };
|
||||
|
|
@ -110,8 +138,8 @@
|
|||
C8093CF61B8A72BE0088E94D /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C641B8A72BE0088E94D /* Event.swift */; };
|
||||
C8093CF71B8A72BE0088E94D /* ImmediateSchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C651B8A72BE0088E94D /* ImmediateSchedulerType.swift */; };
|
||||
C8093CF81B8A72BE0088E94D /* ImmediateSchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C651B8A72BE0088E94D /* ImmediateSchedulerType.swift */; };
|
||||
C8093CFB1B8A72BE0088E94D /* Observable+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C671B8A72BE0088E94D /* Observable+Extensions.swift */; };
|
||||
C8093CFC1B8A72BE0088E94D /* Observable+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C671B8A72BE0088E94D /* Observable+Extensions.swift */; };
|
||||
C8093CFB1B8A72BE0088E94D /* ObservableType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C671B8A72BE0088E94D /* ObservableType+Extensions.swift */; };
|
||||
C8093CFC1B8A72BE0088E94D /* ObservableType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C671B8A72BE0088E94D /* ObservableType+Extensions.swift */; };
|
||||
C8093CFD1B8A72BE0088E94D /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C681B8A72BE0088E94D /* Observable.swift */; };
|
||||
C8093CFE1B8A72BE0088E94D /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C681B8A72BE0088E94D /* Observable.swift */; };
|
||||
C8093CFF1B8A72BE0088E94D /* Amb.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C6B1B8A72BE0088E94D /* Amb.swift */; };
|
||||
|
|
@ -323,6 +351,10 @@
|
|||
C80DDEB21BCE8CA3006A1832 /* Driver+Operators+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = C80DDEB01BCE8CA3006A1832 /* Driver+Operators+arity.swift */; };
|
||||
C80DDEB31BCE8CA3006A1832 /* Driver+Operators+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = C80DDEB01BCE8CA3006A1832 /* Driver+Operators+arity.swift */; };
|
||||
C80DDEB41BCE8CA3006A1832 /* Driver+Operators+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = C80DDEB01BCE8CA3006A1832 /* Driver+Operators+arity.swift */; };
|
||||
C80EEC341D42D06E00131C39 /* DispatchQueueConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C80EEC331D42D06E00131C39 /* DispatchQueueConfiguration.swift */; };
|
||||
C80EEC351D42D06E00131C39 /* DispatchQueueConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C80EEC331D42D06E00131C39 /* DispatchQueueConfiguration.swift */; };
|
||||
C80EEC361D42D06E00131C39 /* DispatchQueueConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C80EEC331D42D06E00131C39 /* DispatchQueueConfiguration.swift */; };
|
||||
C80EEC371D42D06E00131C39 /* DispatchQueueConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C80EEC331D42D06E00131C39 /* DispatchQueueConfiguration.swift */; };
|
||||
C811C89D1C24D80100A2DDD4 /* DeallocObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C811C89C1C24D80100A2DDD4 /* DeallocObservable.swift */; };
|
||||
C811C89E1C24D80100A2DDD4 /* DeallocObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C811C89C1C24D80100A2DDD4 /* DeallocObservable.swift */; };
|
||||
C811C89F1C24D80100A2DDD4 /* DeallocObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C811C89C1C24D80100A2DDD4 /* DeallocObservable.swift */; };
|
||||
|
|
@ -338,7 +370,6 @@
|
|||
C83100661BF7D51600AAE3CD /* Sequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83100631BF7D51600AAE3CD /* Sequence.swift */; };
|
||||
C83100671BF7D51600AAE3CD /* Sequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83100631BF7D51600AAE3CD /* Sequence.swift */; };
|
||||
C83508C81C386F6F0027C24C /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8A56AD71AD7424700B4673B /* RxSwift.framework */; };
|
||||
C83509271C38706E0027C24C /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C83508D51C38706D0027C24C /* Info.plist */; };
|
||||
C83509291C38706E0027C24C /* PerformanceTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83508D71C38706D0027C24C /* PerformanceTools.swift */; };
|
||||
C835092A1C38706E0027C24C /* CLLocationManager+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83508D91C38706D0027C24C /* CLLocationManager+RxTests.swift */; };
|
||||
C835092C1C38706E0027C24C /* Control+RxTests+UIKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83508DB1C38706D0027C24C /* Control+RxTests+UIKit.swift */; };
|
||||
|
|
@ -526,6 +557,8 @@
|
|||
C8350A231C38756B0027C24C /* VirtualSchedulerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C835091C1C38706D0027C24C /* VirtualSchedulerTest.swift */; };
|
||||
C8350A2A1C3875B50027C24C /* RxMutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093CB01B8A72BE0088E94D /* RxMutableBox.swift */; };
|
||||
C8350A2B1C3875B60027C24C /* RxMutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093CB01B8A72BE0088E94D /* RxMutableBox.swift */; };
|
||||
C8379EF41D1DD326003EF8FC /* UIButton+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8379EF31D1DD326003EF8FC /* UIButton+RxTests.swift */; };
|
||||
C8379EF51D1DD326003EF8FC /* UIButton+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8379EF31D1DD326003EF8FC /* UIButton+RxTests.swift */; };
|
||||
C839365F1C70E02200A9A09E /* UIApplication+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C839365E1C70E02200A9A09E /* UIApplication+Rx.swift */; };
|
||||
C83D73B81C1DBAEE003DC470 /* AnonymousInvocable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83D73B31C1DBAEE003DC470 /* AnonymousInvocable.swift */; };
|
||||
C83D73B91C1DBAEE003DC470 /* AnonymousInvocable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83D73B31C1DBAEE003DC470 /* AnonymousInvocable.swift */; };
|
||||
|
|
@ -600,6 +633,9 @@
|
|||
C86409FD1BA593F500D3C4E8 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86409FB1BA593F500D3C4E8 /* Range.swift */; };
|
||||
C8640A031BA5B12A00D3C4E8 /* Repeat.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8640A021BA5B12A00D3C4E8 /* Repeat.swift */; };
|
||||
C8640A041BA5B12A00D3C4E8 /* Repeat.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8640A021BA5B12A00D3C4E8 /* Repeat.swift */; };
|
||||
C86B1E221D42BF5200130546 /* SchedulerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86B1E211D42BF5200130546 /* SchedulerTests.swift */; };
|
||||
C86B1E231D42BF5200130546 /* SchedulerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86B1E211D42BF5200130546 /* SchedulerTests.swift */; };
|
||||
C86B1E241D42BF5200130546 /* SchedulerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86B1E211D42BF5200130546 /* SchedulerTests.swift */; };
|
||||
C88254161B8A752B00B02D69 /* RxCollectionViewReactiveArrayDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88253F11B8A752B00B02D69 /* RxCollectionViewReactiveArrayDataSource.swift */; };
|
||||
C88254171B8A752B00B02D69 /* RxTableViewReactiveArrayDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88253F21B8A752B00B02D69 /* RxTableViewReactiveArrayDataSource.swift */; };
|
||||
C88254181B8A752B00B02D69 /* ItemEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88253F41B8A752B00B02D69 /* ItemEvents.swift */; };
|
||||
|
|
@ -632,10 +668,10 @@
|
|||
C88E296C1BEB712E001CCB92 /* RunLoopLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88E296A1BEB712E001CCB92 /* RunLoopLock.swift */; };
|
||||
C88E296D1BEB712E001CCB92 /* RunLoopLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88E296A1BEB712E001CCB92 /* RunLoopLock.swift */; };
|
||||
C88E296E1BEB712E001CCB92 /* RunLoopLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88E296A1BEB712E001CCB92 /* RunLoopLock.swift */; };
|
||||
C88F76811CE5341700D5A014 /* RxTextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88F76801CE5341700D5A014 /* RxTextInput.swift */; };
|
||||
C88F76821CE5341700D5A014 /* RxTextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88F76801CE5341700D5A014 /* RxTextInput.swift */; };
|
||||
C88F76831CE5341700D5A014 /* RxTextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88F76801CE5341700D5A014 /* RxTextInput.swift */; };
|
||||
C88F76841CE5341700D5A014 /* RxTextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88F76801CE5341700D5A014 /* RxTextInput.swift */; };
|
||||
C88F76811CE5341700D5A014 /* TextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88F76801CE5341700D5A014 /* TextInput.swift */; };
|
||||
C88F76821CE5341700D5A014 /* TextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88F76801CE5341700D5A014 /* TextInput.swift */; };
|
||||
C88F76831CE5341700D5A014 /* TextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88F76801CE5341700D5A014 /* TextInput.swift */; };
|
||||
C88F76841CE5341700D5A014 /* TextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88F76801CE5341700D5A014 /* TextInput.swift */; };
|
||||
C8941BDF1BD5695C00A0E874 /* BlockingObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8941BDE1BD5695C00A0E874 /* BlockingObservable.swift */; };
|
||||
C8941BE01BD5695C00A0E874 /* BlockingObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8941BDE1BD5695C00A0E874 /* BlockingObservable.swift */; };
|
||||
C8941BE11BD5695C00A0E874 /* BlockingObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8941BDE1BD5695C00A0E874 /* BlockingObservable.swift */; };
|
||||
|
|
@ -773,6 +809,9 @@
|
|||
C8E7B36A1C30C6B800B34368 /* TestableObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E7B3681C30C6B800B34368 /* TestableObservable.swift */; };
|
||||
C8E7B36B1C30C6B800B34368 /* TestableObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E7B3681C30C6B800B34368 /* TestableObservable.swift */; };
|
||||
C8E7B36C1C30C6B800B34368 /* TestableObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E7B3681C30C6B800B34368 /* TestableObservable.swift */; };
|
||||
C8E9E42B1D43B26C0049644E /* Observable+DebugTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E9E42A1D43B26C0049644E /* Observable+DebugTest.swift */; };
|
||||
C8E9E42C1D43B26C0049644E /* Observable+DebugTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E9E42A1D43B26C0049644E /* Observable+DebugTest.swift */; };
|
||||
C8E9E42D1D43B26C0049644E /* Observable+DebugTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E9E42A1D43B26C0049644E /* Observable+DebugTest.swift */; };
|
||||
C8F0BF921BBBFB8B001B112F /* Observable+Creation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C981B8A72BE0088E94D /* Observable+Creation.swift */; };
|
||||
C8F0BF931BBBFB8B001B112F /* ConnectableObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C4D1B8A72BE0088E94D /* ConnectableObservableType.swift */; };
|
||||
C8F0BF941BBBFB8B001B112F /* Just.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C3DA021B9390C4004D233E /* Just.swift */; };
|
||||
|
|
@ -796,7 +835,7 @@
|
|||
C8F0BFA61BBBFB8B001B112F /* ReplaySubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093CC01B8A72BE0088E94D /* ReplaySubject.swift */; };
|
||||
C8F0BFA71BBBFB8B001B112F /* Zip+CollectionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C3D9FD1B935EDF004D233E /* Zip+CollectionType.swift */; };
|
||||
C8F0BFA81BBBFB8B001B112F /* Observable+Time.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C9D1B8A72BE0088E94D /* Observable+Time.swift */; };
|
||||
C8F0BFA91BBBFB8B001B112F /* Observable+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C671B8A72BE0088E94D /* Observable+Extensions.swift */; };
|
||||
C8F0BFA91BBBFB8B001B112F /* ObservableType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C671B8A72BE0088E94D /* ObservableType+Extensions.swift */; };
|
||||
C8F0BFAA1BBBFB8B001B112F /* Throttle.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C901B8A72BE0088E94D /* Throttle.swift */; };
|
||||
C8F0BFAC1BBBFB8B001B112F /* Catch.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C6E1B8A72BE0088E94D /* Catch.swift */; };
|
||||
C8F0BFAD1BBBFB8B001B112F /* CombineLatest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C711B8A72BE0088E94D /* CombineLatest.swift */; };
|
||||
|
|
@ -867,7 +906,6 @@
|
|||
C8F0BFF21BBBFB8B001B112F /* ObserverType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093CAB1B8A72BE0088E94D /* ObserverType.swift */; };
|
||||
C8F0BFF31BBBFB8B001B112F /* SubscribeOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C8B1B8A72BE0088E94D /* SubscribeOn.swift */; };
|
||||
C8F0BFF41BBBFB8B001B112F /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C681B8A72BE0088E94D /* Observable.swift */; };
|
||||
C8F0BFF51BBBFB8B001B112F /* NAryDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5A1B8A72BE0088E94D /* NAryDisposable.swift */; };
|
||||
C8F0BFF61BBBFB8B001B112F /* SerialDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5F1B8A72BE0088E94D /* SerialDisposable.swift */; };
|
||||
C8F0BFF71BBBFB8B001B112F /* Never.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C3DA0B1B93959F004D233E /* Never.swift */; };
|
||||
C8F0BFF91BBBFB8B001B112F /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C641B8A72BE0088E94D /* Event.swift */; };
|
||||
|
|
@ -978,6 +1016,10 @@
|
|||
CBEE77201BD649A000AD584C /* ToArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBEE771E1BD649A000AD584C /* ToArray.swift */; };
|
||||
CBEE77211BD649A000AD584C /* ToArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBEE771E1BD649A000AD584C /* ToArray.swift */; };
|
||||
CBEE77221BD649A000AD584C /* ToArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBEE771E1BD649A000AD584C /* ToArray.swift */; };
|
||||
CDDEF16A1D4FB40000CA8546 /* Disposables.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDDEF1691D4FB40000CA8546 /* Disposables.swift */; };
|
||||
CDDEF16B1D4FB40000CA8546 /* Disposables.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDDEF1691D4FB40000CA8546 /* Disposables.swift */; };
|
||||
CDDEF16C1D4FB40000CA8546 /* Disposables.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDDEF1691D4FB40000CA8546 /* Disposables.swift */; };
|
||||
CDDEF16D1D4FB40000CA8546 /* Disposables.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDDEF1691D4FB40000CA8546 /* Disposables.swift */; };
|
||||
D203C4F31BB9C4CA00D02D00 /* RxCollectionViewReactiveArrayDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88253F11B8A752B00B02D69 /* RxCollectionViewReactiveArrayDataSource.swift */; };
|
||||
D203C4F41BB9C52400D02D00 /* RxTableViewReactiveArrayDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88253F21B8A752B00B02D69 /* RxTableViewReactiveArrayDataSource.swift */; };
|
||||
D203C4F51BB9C52900D02D00 /* ItemEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88253F41B8A752B00B02D69 /* ItemEvents.swift */; };
|
||||
|
|
@ -1049,7 +1091,7 @@
|
|||
D2EBEAE01BB9B697003A27DC /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C641B8A72BE0088E94D /* Event.swift */; };
|
||||
D2EBEAE11BB9B697003A27DC /* ImmediateSchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C651B8A72BE0088E94D /* ImmediateSchedulerType.swift */; };
|
||||
D2EBEAE21BB9B697003A27DC /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C681B8A72BE0088E94D /* Observable.swift */; };
|
||||
D2EBEAE31BB9B697003A27DC /* Observable+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C671B8A72BE0088E94D /* Observable+Extensions.swift */; };
|
||||
D2EBEAE31BB9B697003A27DC /* ObservableType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C671B8A72BE0088E94D /* ObservableType+Extensions.swift */; };
|
||||
D2EBEAE41BB9B697003A27DC /* ObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C9E1B8A72BE0088E94D /* ObservableType.swift */; };
|
||||
D2EBEAE51BB9B697003A27DC /* AnyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093CA01B8A72BE0088E94D /* AnyObserver.swift */; };
|
||||
D2EBEAE61BB9B697003A27DC /* ObserverType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093CAB1B8A72BE0088E94D /* ObserverType.swift */; };
|
||||
|
|
@ -1066,7 +1108,6 @@
|
|||
D2EBEAF21BB9B6AE003A27DC /* CompositeDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C571B8A72BE0088E94D /* CompositeDisposable.swift */; };
|
||||
D2EBEAF31BB9B6AE003A27DC /* DisposeBag.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C581B8A72BE0088E94D /* DisposeBag.swift */; };
|
||||
D2EBEAF41BB9B6AE003A27DC /* DisposeBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C591B8A72BE0088E94D /* DisposeBase.swift */; };
|
||||
D2EBEAF51BB9B6AE003A27DC /* NAryDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5A1B8A72BE0088E94D /* NAryDisposable.swift */; };
|
||||
D2EBEAF61BB9B6B2003A27DC /* NopDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5C1B8A72BE0088E94D /* NopDisposable.swift */; };
|
||||
D2EBEAF71BB9B6B2003A27DC /* ScheduledDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5D1B8A72BE0088E94D /* ScheduledDisposable.swift */; };
|
||||
D2EBEAF91BB9B6B2003A27DC /* SerialDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8093C5F1B8A72BE0088E94D /* SerialDisposable.swift */; };
|
||||
|
|
@ -1351,6 +1392,12 @@
|
|||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
033C2EF41D081B2A0050C015 /* UIScrollView+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIScrollView+RxTests.swift"; sourceTree = "<group>"; };
|
||||
1AF67DA11CED420A00C310FA /* PublishSubjectTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublishSubjectTest.swift; sourceTree = "<group>"; };
|
||||
1AF67DA51CED430100C310FA /* ReplaySubjectTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReplaySubjectTest.swift; sourceTree = "<group>"; };
|
||||
271A97401CFC996B00D64125 /* UIViewController+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+Rx.swift"; sourceTree = "<group>"; };
|
||||
271A97421CFC99FE00D64125 /* UIViewControler+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewControler+RxTests.swift"; sourceTree = "<group>"; };
|
||||
46307D4D1CDE77D800E47A1C /* UIAlertAction+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIAlertAction+Rx.swift"; sourceTree = "<group>"; };
|
||||
54700C9E1CE37D1000EF3A8F /* UINavigationItem+RxTests.swift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UINavigationItem+RxTests.swift.swift"; sourceTree = "<group>"; };
|
||||
54D2138C1CE081890028D5B4 /* UINavigationItem+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UINavigationItem+Rx.swift"; sourceTree = "<group>"; };
|
||||
79E9DE881C3417FD009970AF /* DispatchQueueSchedulerQOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DispatchQueueSchedulerQOS.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -1359,6 +1406,9 @@
|
|||
7F600F3D1C5D0C0100535B1D /* UIRefreshControl+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIRefreshControl+Rx.swift"; sourceTree = "<group>"; };
|
||||
7F600F421C5D0D2D00535B1D /* UIRefreshControl+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIRefreshControl+RxTests.swift"; sourceTree = "<group>"; };
|
||||
842A5A281C357F7D003568D5 /* NSTextStorage+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSTextStorage+Rx.swift"; sourceTree = "<group>"; };
|
||||
844BC8AA1CE4FA5600F5C7CB /* RxPickerViewDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxPickerViewDelegateProxy.swift; sourceTree = "<group>"; };
|
||||
844BC8B31CE4FD7500F5C7CB /* UIPickerView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIPickerView+Rx.swift"; sourceTree = "<group>"; };
|
||||
844BC8B71CE5023200F5C7CB /* UIPickerView+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIPickerView+RxTests.swift"; sourceTree = "<group>"; };
|
||||
846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxSearchControllerDelegateProxy.swift; sourceTree = "<group>"; };
|
||||
8476A01F1C3D5D580040BA22 /* UIImagePickerController+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImagePickerController+RxTests.swift"; sourceTree = "<group>"; };
|
||||
8479BC441C3ACDA400FB8B54 /* RxImagePickerDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxImagePickerDelegateProxy.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -1366,6 +1416,11 @@
|
|||
84C225A21C33F00B008724EC /* RxTextStorageDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTextStorageDelegateProxy.swift; sourceTree = "<group>"; };
|
||||
84E4D3901C9AFCD500ADFDC9 /* UISearchController+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISearchController+Rx.swift"; sourceTree = "<group>"; };
|
||||
84E4D3951C9B011000ADFDC9 /* UISearchController+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISearchController+RxTests.swift"; sourceTree = "<group>"; };
|
||||
88718CFD1CE5D80000D88D60 /* UITabBar+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "UITabBar+Rx.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
88718D001CE5DE2500D88D60 /* UITabBar+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITabBar+RxTests.swift"; sourceTree = "<group>"; };
|
||||
88D98F2D1CE7549A00D50457 /* RxTabBarDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = RxTabBarDelegateProxy.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
914FCD661CCDB82E0058B304 /* UIPageControl+RxTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIPageControl+RxTest.swift"; sourceTree = "<group>"; };
|
||||
91BE429B1CBF7EC000F6B062 /* UIPageControl+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIPageControl+Rx.swift"; sourceTree = "<group>"; };
|
||||
9BA1CBD11C0F7C0A0044B50A /* UIActivityIndicatorView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIActivityIndicatorView+Rx.swift"; sourceTree = "<group>"; };
|
||||
A111CE961B91C97C00D0DCEE /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
AAE623751C82475700FC7801 /* UIProgressView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIProgressView+Rx.swift"; sourceTree = "<group>"; };
|
||||
|
|
@ -1389,8 +1444,6 @@
|
|||
C8093C571B8A72BE0088E94D /* CompositeDisposable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompositeDisposable.swift; sourceTree = "<group>"; };
|
||||
C8093C581B8A72BE0088E94D /* DisposeBag.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisposeBag.swift; sourceTree = "<group>"; };
|
||||
C8093C591B8A72BE0088E94D /* DisposeBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisposeBase.swift; sourceTree = "<group>"; };
|
||||
C8093C5A1B8A72BE0088E94D /* NAryDisposable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NAryDisposable.swift; sourceTree = "<group>"; };
|
||||
C8093C5B1B8A72BE0088E94D /* NAryDisposable.tt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NAryDisposable.tt; sourceTree = "<group>"; };
|
||||
C8093C5C1B8A72BE0088E94D /* NopDisposable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NopDisposable.swift; sourceTree = "<group>"; };
|
||||
C8093C5D1B8A72BE0088E94D /* ScheduledDisposable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScheduledDisposable.swift; sourceTree = "<group>"; };
|
||||
C8093C5F1B8A72BE0088E94D /* SerialDisposable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SerialDisposable.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -1400,7 +1453,7 @@
|
|||
C8093C641B8A72BE0088E94D /* Event.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Event.swift; sourceTree = "<group>"; };
|
||||
C8093C651B8A72BE0088E94D /* ImmediateSchedulerType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImmediateSchedulerType.swift; sourceTree = "<group>"; };
|
||||
C8093C661B8A72BE0088E94D /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
C8093C671B8A72BE0088E94D /* Observable+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Observable+Extensions.swift"; sourceTree = "<group>"; };
|
||||
C8093C671B8A72BE0088E94D /* ObservableType+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "ObservableType+Extensions.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C8093C681B8A72BE0088E94D /* Observable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Observable.swift; sourceTree = "<group>"; };
|
||||
C8093C6B1B8A72BE0088E94D /* Amb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Amb.swift; sourceTree = "<group>"; };
|
||||
C8093C6E1B8A72BE0088E94D /* Catch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Catch.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -1408,7 +1461,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>"; };
|
||||
|
|
@ -1456,7 +1509,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>"; };
|
||||
|
|
@ -1474,7 +1527,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>"; };
|
||||
|
|
@ -1495,7 +1548,7 @@
|
|||
C8093ECB1B8A732E0088E94D /* RxCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RxCocoa.h; sourceTree = "<group>"; };
|
||||
C8093F581B8A73A20088E94D /* ObservableConvertibleType+Blocking.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ObservableConvertibleType+Blocking.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C8093F591B8A73A20088E94D /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
C80D338E1B91EF9E0014629D /* Observable+Bind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Observable+Bind.swift"; sourceTree = "<group>"; };
|
||||
C80D338E1B91EF9E0014629D /* Observable+Bind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "Observable+Bind.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C80D33931B922FB00014629D /* ControlEvent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlEvent.swift; sourceTree = "<group>"; };
|
||||
C80D33941B922FB00014629D /* ControlProperty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ControlProperty.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C80D342D1B9245A40014629D /* CombineLatest+CollectionType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "CombineLatest+CollectionType.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
|
|
@ -1507,6 +1560,7 @@
|
|||
C80DDE921BCE69BA006A1832 /* ObservableConvertibleType+Driver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ObservableConvertibleType+Driver.swift"; sourceTree = "<group>"; };
|
||||
C80DDEAB1BCE83B2006A1832 /* Driver+Operators+arity.tt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Driver+Operators+arity.tt"; sourceTree = "<group>"; };
|
||||
C80DDEB01BCE8CA3006A1832 /* Driver+Operators+arity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Driver+Operators+arity.swift"; sourceTree = "<group>"; };
|
||||
C80EEC331D42D06E00131C39 /* DispatchQueueConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DispatchQueueConfiguration.swift; sourceTree = "<group>"; };
|
||||
C811C89C1C24D80100A2DDD4 /* DeallocObservable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeallocObservable.swift; sourceTree = "<group>"; };
|
||||
C821DBA11BA4DCAB008F3809 /* Buffer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Buffer.swift; sourceTree = "<group>"; };
|
||||
C83100631BF7D51600AAE3CD /* Sequence.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sequence.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -1520,8 +1574,8 @@
|
|||
C83508DC1C38706D0027C24C /* Control+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Control+RxTests.swift"; sourceTree = "<group>"; };
|
||||
C83508DD1C38706D0027C24C /* ControlEventTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlEventTests.swift; sourceTree = "<group>"; };
|
||||
C83508DE1C38706D0027C24C /* ControlPropertyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlPropertyTests.swift; sourceTree = "<group>"; };
|
||||
C83508DF1C38706D0027C24C /* DelegateProxyTest+Cocoa.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DelegateProxyTest+Cocoa.swift"; sourceTree = "<group>"; };
|
||||
C83508E01C38706D0027C24C /* DelegateProxyTest+UIKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DelegateProxyTest+UIKit.swift"; sourceTree = "<group>"; };
|
||||
C83508DF1C38706D0027C24C /* DelegateProxyTest+Cocoa.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "DelegateProxyTest+Cocoa.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C83508E01C38706D0027C24C /* DelegateProxyTest+UIKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "DelegateProxyTest+UIKit.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C83508E11C38706D0027C24C /* DelegateProxyTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DelegateProxyTest.swift; sourceTree = "<group>"; };
|
||||
C83508E21C38706D0027C24C /* Driver+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Driver+Extensions.swift"; sourceTree = "<group>"; };
|
||||
C83508E31C38706D0027C24C /* Driver+Test.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Driver+Test.swift"; sourceTree = "<group>"; };
|
||||
|
|
@ -1586,6 +1640,7 @@
|
|||
C83509231C38706E0027C24C /* XCTest+AllTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTest+AllTests.swift"; sourceTree = "<group>"; };
|
||||
C83509841C38740E0027C24C /* AllTests-tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AllTests-tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C83509941C38742C0027C24C /* AllTests-OSX.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AllTests-OSX.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C8379EF31D1DD326003EF8FC /* UIButton+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIButton+RxTests.swift"; sourceTree = "<group>"; };
|
||||
C839365E1C70E02200A9A09E /* UIApplication+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIApplication+Rx.swift"; sourceTree = "<group>"; };
|
||||
C83D73B31C1DBAEE003DC470 /* AnonymousInvocable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnonymousInvocable.swift; sourceTree = "<group>"; };
|
||||
C83D73B41C1DBAEE003DC470 /* InvocableScheduledItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InvocableScheduledItem.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -1607,37 +1662,38 @@
|
|||
C85BA04B1C3878740075D68E /* PerformanceTests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PerformanceTests.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C86409FB1BA593F500D3C4E8 /* Range.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Range.swift; sourceTree = "<group>"; };
|
||||
C8640A021BA5B12A00D3C4E8 /* Repeat.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Repeat.swift; sourceTree = "<group>"; };
|
||||
C86B1E211D42BF5200130546 /* SchedulerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SchedulerTests.swift; sourceTree = "<group>"; };
|
||||
C88253F11B8A752B00B02D69 /* RxCollectionViewReactiveArrayDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxCollectionViewReactiveArrayDataSource.swift; sourceTree = "<group>"; };
|
||||
C88253F21B8A752B00B02D69 /* RxTableViewReactiveArrayDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTableViewReactiveArrayDataSource.swift; sourceTree = "<group>"; };
|
||||
C88253F41B8A752B00B02D69 /* ItemEvents.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemEvents.swift; sourceTree = "<group>"; };
|
||||
C88253F71B8A752B00B02D69 /* RxCollectionViewDataSourceType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxCollectionViewDataSourceType.swift; sourceTree = "<group>"; };
|
||||
C88253F81B8A752B00B02D69 /* RxTableViewDataSourceType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTableViewDataSourceType.swift; sourceTree = "<group>"; };
|
||||
C88253FC1B8A752B00B02D69 /* RxCollectionViewDataSourceProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxCollectionViewDataSourceProxy.swift; sourceTree = "<group>"; };
|
||||
C88253FC1B8A752B00B02D69 /* RxCollectionViewDataSourceProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = RxCollectionViewDataSourceProxy.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C88253FD1B8A752B00B02D69 /* RxCollectionViewDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxCollectionViewDelegateProxy.swift; sourceTree = "<group>"; };
|
||||
C88253FE1B8A752B00B02D69 /* RxScrollViewDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxScrollViewDelegateProxy.swift; sourceTree = "<group>"; };
|
||||
C88253FF1B8A752B00B02D69 /* RxSearchBarDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxSearchBarDelegateProxy.swift; sourceTree = "<group>"; };
|
||||
C88254001B8A752B00B02D69 /* RxTableViewDataSourceProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTableViewDataSourceProxy.swift; sourceTree = "<group>"; };
|
||||
C88253FE1B8A752B00B02D69 /* RxScrollViewDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = RxScrollViewDelegateProxy.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C88253FF1B8A752B00B02D69 /* RxSearchBarDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = RxSearchBarDelegateProxy.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C88254001B8A752B00B02D69 /* RxTableViewDataSourceProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = RxTableViewDataSourceProxy.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C88254011B8A752B00B02D69 /* RxTableViewDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTableViewDelegateProxy.swift; sourceTree = "<group>"; };
|
||||
C88254021B8A752B00B02D69 /* RxTextViewDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTextViewDelegateProxy.swift; sourceTree = "<group>"; };
|
||||
C88254051B8A752B00B02D69 /* UIBarButtonItem+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "UIBarButtonItem+Rx.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C88254061B8A752B00B02D69 /* UIButton+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIButton+Rx.swift"; sourceTree = "<group>"; };
|
||||
C88254071B8A752B00B02D69 /* UICollectionView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UICollectionView+Rx.swift"; sourceTree = "<group>"; };
|
||||
C88254071B8A752B00B02D69 /* UICollectionView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "UICollectionView+Rx.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C88254081B8A752B00B02D69 /* UIControl+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "UIControl+Rx.swift"; sourceTree = "<group>"; };
|
||||
C88254091B8A752B00B02D69 /* UIDatePicker+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIDatePicker+Rx.swift"; sourceTree = "<group>"; };
|
||||
C882540A1B8A752B00B02D69 /* UIGestureRecognizer+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIGestureRecognizer+Rx.swift"; sourceTree = "<group>"; };
|
||||
C882540B1B8A752B00B02D69 /* UIImageView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImageView+Rx.swift"; sourceTree = "<group>"; };
|
||||
C882540C1B8A752B00B02D69 /* UILabel+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UILabel+Rx.swift"; sourceTree = "<group>"; };
|
||||
C882540D1B8A752B00B02D69 /* UIScrollView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIScrollView+Rx.swift"; sourceTree = "<group>"; };
|
||||
C882540E1B8A752B00B02D69 /* UISearchBar+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISearchBar+Rx.swift"; sourceTree = "<group>"; };
|
||||
C882540D1B8A752B00B02D69 /* UIScrollView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "UIScrollView+Rx.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C882540E1B8A752B00B02D69 /* UISearchBar+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "UISearchBar+Rx.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C882540F1B8A752B00B02D69 /* UISegmentedControl+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISegmentedControl+Rx.swift"; sourceTree = "<group>"; };
|
||||
C88254101B8A752B00B02D69 /* UISlider+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISlider+Rx.swift"; sourceTree = "<group>"; };
|
||||
C88254111B8A752B00B02D69 /* UISwitch+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISwitch+Rx.swift"; sourceTree = "<group>"; };
|
||||
C88254121B8A752B00B02D69 /* UITableView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITableView+Rx.swift"; sourceTree = "<group>"; };
|
||||
C88254121B8A752B00B02D69 /* UITableView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "UITableView+Rx.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C88254131B8A752B00B02D69 /* UITextField+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITextField+Rx.swift"; sourceTree = "<group>"; };
|
||||
C88254141B8A752B00B02D69 /* UITextView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITextView+Rx.swift"; sourceTree = "<group>"; };
|
||||
C88254141B8A752B00B02D69 /* UITextView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "UITextView+Rx.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
C88BB8711B07E5ED0064D411 /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C88E296A1BEB712E001CCB92 /* RunLoopLock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RunLoopLock.swift; sourceTree = "<group>"; };
|
||||
C88F76801CE5341700D5A014 /* RxTextInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTextInput.swift; sourceTree = "<group>"; };
|
||||
C88F76801CE5341700D5A014 /* TextInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextInput.swift; sourceTree = "<group>"; };
|
||||
C88FA50C1C25C44800CCFEA4 /* RxTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C88FA51D1C25C4B500CCFEA4 /* RxTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C88FA52E1C25C4C000CCFEA4 /* RxTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
|
|
@ -1663,13 +1719,14 @@
|
|||
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>"; };
|
||||
C8C4B4C01C17727000828BD5 /* MessageSentObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageSentObserver.swift; sourceTree = "<group>"; };
|
||||
C8D132431C42D15E00B59FFF /* SectionedViewDataSourceType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SectionedViewDataSourceType.swift; sourceTree = "<group>"; };
|
||||
C8D132521C42DA7F00B59FFF /* SectionedViewDataSourceMock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SectionedViewDataSourceMock.swift; sourceTree = "<group>"; };
|
||||
C8D2C1501D4F3CD6006E2431 /* Rx.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Rx.playground; sourceTree = "<group>"; };
|
||||
C8DB967D1BF7496C0084BD53 /* KVORepresentable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KVORepresentable.swift; sourceTree = "<group>"; };
|
||||
C8DB96821BF754C80084BD53 /* NSObject+Rx+KVORepresentable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSObject+Rx+KVORepresentable.swift"; sourceTree = "<group>"; };
|
||||
C8DB96871BF756F40084BD53 /* KVORepresentable+CoreGraphics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "KVORepresentable+CoreGraphics.swift"; sourceTree = "<group>"; };
|
||||
|
|
@ -1686,6 +1743,7 @@
|
|||
C8E3A7301C2606A900643FE6 /* Event+Equatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Event+Equatable.swift"; sourceTree = "<group>"; };
|
||||
C8E3A7351C26088C00643FE6 /* Any+Equatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Any+Equatable.swift"; sourceTree = "<group>"; };
|
||||
C8E7B3681C30C6B800B34368 /* TestableObservable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestableObservable.swift; sourceTree = "<group>"; };
|
||||
C8E9E42A1D43B26C0049644E /* Observable+DebugTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Observable+DebugTest.swift"; sourceTree = "<group>"; };
|
||||
C8F0C0021BBBFB8B001B112F /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C8F0C04B1BBBFBB9001B112F /* RxCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C8F0C0581BBBFBCE001B112F /* RxBlocking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxBlocking.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
|
|
@ -1704,6 +1762,7 @@
|
|||
CB883B441BE256D4000AC2EE /* BooleanDisposable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BooleanDisposable.swift; sourceTree = "<group>"; };
|
||||
CB883B491BE369AA000AC2EE /* AddRef.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddRef.swift; sourceTree = "<group>"; };
|
||||
CBEE771E1BD649A000AD584C /* ToArray.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToArray.swift; sourceTree = "<group>"; };
|
||||
CDDEF1691D4FB40000CA8546 /* Disposables.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Disposables.swift; sourceTree = "<group>"; };
|
||||
D2138C751BB9BE9800339B5C /* RxCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D2245A1A1BD5657300E7146F /* WithLatestFrom.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WithLatestFrom.swift; sourceTree = "<group>"; };
|
||||
D22B6D251BC8504A00BCE0AB /* SkipWhile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SkipWhile.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -1873,7 +1932,7 @@
|
|||
C8093C641B8A72BE0088E94D /* Event.swift */,
|
||||
C8093C651B8A72BE0088E94D /* ImmediateSchedulerType.swift */,
|
||||
C8093C681B8A72BE0088E94D /* Observable.swift */,
|
||||
C8093C671B8A72BE0088E94D /* Observable+Extensions.swift */,
|
||||
C8093C671B8A72BE0088E94D /* ObservableType+Extensions.swift */,
|
||||
C849BE2A1BAB5D070019AD27 /* ObservableConvertibleType.swift */,
|
||||
C8093C9E1B8A72BE0088E94D /* ObservableType.swift */,
|
||||
C8093CA01B8A72BE0088E94D /* AnyObserver.swift */,
|
||||
|
|
@ -1929,14 +1988,13 @@
|
|||
C8093C581B8A72BE0088E94D /* DisposeBag.swift */,
|
||||
C8093C591B8A72BE0088E94D /* DisposeBase.swift */,
|
||||
C84CC5661BDD08A500E06A64 /* SubscriptionDisposable.swift */,
|
||||
C8093C5A1B8A72BE0088E94D /* NAryDisposable.swift */,
|
||||
C8093C5B1B8A72BE0088E94D /* NAryDisposable.tt */,
|
||||
C8093C5C1B8A72BE0088E94D /* NopDisposable.swift */,
|
||||
CB883B3F1BE24C15000AC2EE /* RefCountDisposable.swift */,
|
||||
C8093C5D1B8A72BE0088E94D /* ScheduledDisposable.swift */,
|
||||
C8093C5F1B8A72BE0088E94D /* SerialDisposable.swift */,
|
||||
C8093C601B8A72BE0088E94D /* SingleAssignmentDisposable.swift */,
|
||||
C8093C611B8A72BE0088E94D /* StableCompositeDisposable.swift */,
|
||||
CDDEF1691D4FB40000CA8546 /* Disposables.swift */,
|
||||
);
|
||||
path = Disposables;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -2110,7 +2168,7 @@
|
|||
C8BCD3F31C14B6D1005F1280 /* NSLayoutConstraint+Rx.swift */,
|
||||
C8D132431C42D15E00B59FFF /* SectionedViewDataSourceType.swift */,
|
||||
D2F461001CD7ABE400527B4D /* Reactive.swift */,
|
||||
C88F76801CE5341700D5A014 /* RxTextInput.swift */,
|
||||
C88F76801CE5341700D5A014 /* TextInput.swift */,
|
||||
);
|
||||
path = Common;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -2254,8 +2312,10 @@
|
|||
C83508EF1C38706D0027C24C /* RxTests-tvOS-Bridging-Header.h */,
|
||||
C83508F01C38706D0027C24C /* SentMessageTest.swift */,
|
||||
C83508F11C38706D0027C24C /* UIView+RxTests.swift */,
|
||||
271A97421CFC99FE00D64125 /* UIViewControler+RxTests.swift */,
|
||||
7F600F421C5D0D2D00535B1D /* UIRefreshControl+RxTests.swift */,
|
||||
7EDBAEAB1C89B1A5006CBE67 /* UITabBarItem+RxTests.swift */,
|
||||
88718D001CE5DE2500D88D60 /* UITabBar+RxTests.swift */,
|
||||
C8B2908C1C94D6C500E923D0 /* UISearchBar+RxTests.swift */,
|
||||
84E4D3951C9B011000ADFDC9 /* UISearchController+RxTests.swift */,
|
||||
C8C217D41CB7100E0038A2E6 /* UITableView+RxTests.swift */,
|
||||
|
|
@ -2263,6 +2323,10 @@
|
|||
54700C9E1CE37D1000EF3A8F /* UINavigationItem+RxTests.swift.swift */,
|
||||
C8F27DAC1CE6710900D5FB4F /* UITextField+RxTests.swift */,
|
||||
C8F27DB11CE6711600D5FB4F /* UITextView+RxTests.swift */,
|
||||
844BC8B71CE5023200F5C7CB /* UIPickerView+RxTests.swift */,
|
||||
914FCD661CCDB82E0058B304 /* UIPageControl+RxTest.swift */,
|
||||
033C2EF41D081B2A0050C015 /* UIScrollView+RxTests.swift */,
|
||||
C8379EF31D1DD326003EF8FC /* UIButton+RxTests.swift */,
|
||||
);
|
||||
path = RxCocoaTests;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -2319,20 +2383,24 @@
|
|||
C835090C1C38706D0027C24C /* Observable+BlockingTest.swift */,
|
||||
C835090D1C38706D0027C24C /* Observable+ConcurrencyTest.swift */,
|
||||
C835090E1C38706D0027C24C /* Observable+CreationTest.swift */,
|
||||
C8E9E42A1D43B26C0049644E /* Observable+DebugTest.swift */,
|
||||
C83509131C38706D0027C24C /* Observable+MultipleTest.swift */,
|
||||
C835090F1C38706D0027C24C /* Observable+MultipleTest+CombineLatest.swift */,
|
||||
C83509101C38706D0027C24C /* Observable+MultipleTest+CombineLatest.tt */,
|
||||
C83509111C38706D0027C24C /* Observable+MultipleTest+Zip.swift */,
|
||||
C83509121C38706D0027C24C /* Observable+MultipleTest+Zip.tt */,
|
||||
C83509131C38706D0027C24C /* Observable+MultipleTest.swift */,
|
||||
C83509141C38706D0027C24C /* Observable+SingleTest.swift */,
|
||||
C83509151C38706D0027C24C /* Observable+StandardSequenceOperatorsTest.swift */,
|
||||
C83509161C38706D0027C24C /* Observable+SubscriptionTest.swift */,
|
||||
C83509171C38706D0027C24C /* Observable+TimeTest.swift */,
|
||||
C83509181C38706D0027C24C /* ObserverTests.swift */,
|
||||
1AF67DA11CED420A00C310FA /* PublishSubjectTest.swift */,
|
||||
C83509191C38706D0027C24C /* QueueTests.swift */,
|
||||
1AF67DA51CED430100C310FA /* ReplaySubjectTest.swift */,
|
||||
C835091A1C38706D0027C24C /* SubjectConcurrencyTest.swift */,
|
||||
C835091B1C38706D0027C24C /* VariableTest.swift */,
|
||||
C835091C1C38706D0027C24C /* VirtualSchedulerTest.swift */,
|
||||
C86B1E211D42BF5200130546 /* SchedulerTests.swift */,
|
||||
);
|
||||
path = Tests;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -2357,6 +2425,7 @@
|
|||
C83D73B51C1DBAEE003DC470 /* InvocableType.swift */,
|
||||
C83D73B61C1DBAEE003DC470 /* ScheduledItem.swift */,
|
||||
C83D73B71C1DBAEE003DC470 /* ScheduledItemType.swift */,
|
||||
C80EEC331D42D06E00131C39 /* DispatchQueueConfiguration.swift */,
|
||||
);
|
||||
path = Internal;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -2378,6 +2447,7 @@
|
|||
C88253F91B8A752B00B02D69 /* Proxies */,
|
||||
C88254051B8A752B00B02D69 /* UIBarButtonItem+Rx.swift */,
|
||||
C839365E1C70E02200A9A09E /* UIApplication+Rx.swift */,
|
||||
271A97401CFC996B00D64125 /* UIViewController+Rx.swift */,
|
||||
C88254061B8A752B00B02D69 /* UIButton+Rx.swift */,
|
||||
C88254071B8A752B00B02D69 /* UICollectionView+Rx.swift */,
|
||||
C88254081B8A752B00B02D69 /* UIControl+Rx.swift */,
|
||||
|
|
@ -2385,6 +2455,7 @@
|
|||
C882540A1B8A752B00B02D69 /* UIGestureRecognizer+Rx.swift */,
|
||||
C882540B1B8A752B00B02D69 /* UIImageView+Rx.swift */,
|
||||
C882540C1B8A752B00B02D69 /* UILabel+Rx.swift */,
|
||||
91BE429B1CBF7EC000F6B062 /* UIPageControl+Rx.swift */,
|
||||
AAE623751C82475700FC7801 /* UIProgressView+Rx.swift */,
|
||||
7F600F3D1C5D0C0100535B1D /* UIRefreshControl+Rx.swift */,
|
||||
C882540D1B8A752B00B02D69 /* UIScrollView+Rx.swift */,
|
||||
|
|
@ -2400,9 +2471,12 @@
|
|||
9BA1CBD11C0F7C0A0044B50A /* UIActivityIndicatorView+Rx.swift */,
|
||||
8479BC4A1C3ACED100FB8B54 /* UIImagePickerController+Rx.swift */,
|
||||
C8BCD3EC1C14B5FB005F1280 /* UIView+Rx.swift */,
|
||||
88718CFD1CE5D80000D88D60 /* UITabBar+Rx.swift */,
|
||||
7EDBAEB71C89B9B7006CBE67 /* UITabBarItem+Rx.swift */,
|
||||
84E4D3901C9AFCD500ADFDC9 /* UISearchController+Rx.swift */,
|
||||
54D2138C1CE081890028D5B4 /* UINavigationItem+Rx.swift */,
|
||||
844BC8B31CE4FD7500F5C7CB /* UIPickerView+Rx.swift */,
|
||||
46307D4D1CDE77D800E47A1C /* UIAlertAction+Rx.swift */,
|
||||
);
|
||||
path = iOS;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -2440,12 +2514,14 @@
|
|||
C88253FD1B8A752B00B02D69 /* RxCollectionViewDelegateProxy.swift */,
|
||||
C88253FE1B8A752B00B02D69 /* RxScrollViewDelegateProxy.swift */,
|
||||
C88253FF1B8A752B00B02D69 /* RxSearchBarDelegateProxy.swift */,
|
||||
88D98F2D1CE7549A00D50457 /* RxTabBarDelegateProxy.swift */,
|
||||
C88254001B8A752B00B02D69 /* RxTableViewDataSourceProxy.swift */,
|
||||
C88254011B8A752B00B02D69 /* RxTableViewDelegateProxy.swift */,
|
||||
C88254021B8A752B00B02D69 /* RxTextViewDelegateProxy.swift */,
|
||||
84C225A21C33F00B008724EC /* RxTextStorageDelegateProxy.swift */,
|
||||
8479BC441C3ACDA400FB8B54 /* RxImagePickerDelegateProxy.swift */,
|
||||
846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */,
|
||||
844BC8AA1CE4FA5600F5C7CB /* RxPickerViewDelegateProxy.swift */,
|
||||
);
|
||||
path = Proxies;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -2453,6 +2529,7 @@
|
|||
C8A56ACD1AD7424700B4673B = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C8D2C1501D4F3CD6006E2431 /* Rx.playground */,
|
||||
C8093C471B8A72BE0088E94D /* RxSwift */,
|
||||
C8093F571B8A73A20088E94D /* RxBlocking */,
|
||||
C8093E801B8A732E0088E94D /* RxCocoa */,
|
||||
|
|
@ -3063,23 +3140,48 @@
|
|||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0720;
|
||||
LastUpgradeCheck = 0720;
|
||||
LastUpgradeCheck = 0800;
|
||||
ORGANIZATIONNAME = "Krunoslav Zaher";
|
||||
TargetAttributes = {
|
||||
C80938F51B8A71760088E94D = {
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C809396F1B8A71840088E94D = {
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C8093B4B1B8A71F00088E94D = {
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C8093BC91B8A71FC0088E94D = {
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C83508C21C386F6F0027C24C = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C83509831C38740E0027C24C = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
};
|
||||
C83509931C38742C0027C24C = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C85BA04A1C3878740075D68E = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C88BB81A1B07E5ED0064D411 = {
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C88FA4FD1C25C44800CCFEA4 = {
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C88FA50E1C25C4B500CCFEA4 = {
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
C8A56AD61AD7424700B4673B = {
|
||||
CreatedOnToolsVersion = 6.3;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
D2138C741BB9BE9800339B5C = {
|
||||
CreatedOnToolsVersion = 7.1;
|
||||
|
|
@ -3162,7 +3264,6 @@
|
|||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C83509271C38706E0027C24C /* Info.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -3281,6 +3382,7 @@
|
|||
C88254321B8A752B00B02D69 /* UISlider+Rx.swift in Sources */,
|
||||
C8093ED91B8A732E0088E94D /* _RXKVOObserver.m in Sources */,
|
||||
C882542F1B8A752B00B02D69 /* UIScrollView+Rx.swift in Sources */,
|
||||
844BC8B41CE4FD7500F5C7CB /* UIPickerView+Rx.swift in Sources */,
|
||||
C80DDE9B1BCE69BA006A1832 /* Driver+Operators.swift in Sources */,
|
||||
C8093EE31B8A732E0088E94D /* DelegateProxyType.swift in Sources */,
|
||||
C8093EFD1B8A732E0088E94D /* RxTarget.swift in Sources */,
|
||||
|
|
@ -3310,15 +3412,18 @@
|
|||
C8C4B4A91C17722400828BD5 /* _RXObjCRuntime.m in Sources */,
|
||||
C8093EEF1B8A732E0088E94D /* KVOObserver.swift in Sources */,
|
||||
C882541F1B8A752B00B02D69 /* RxCollectionViewDelegateProxy.swift in Sources */,
|
||||
46307D4E1CDE77D800E47A1C /* UIAlertAction+Rx.swift in Sources */,
|
||||
C88254201B8A752B00B02D69 /* RxScrollViewDelegateProxy.swift in Sources */,
|
||||
C88F76811CE5341700D5A014 /* RxTextInput.swift in Sources */,
|
||||
C88F76811CE5341700D5A014 /* TextInput.swift in Sources */,
|
||||
C882542E1B8A752B00B02D69 /* UILabel+Rx.swift in Sources */,
|
||||
54D2138E1CE0824E0028D5B4 /* UINavigationItem+Rx.swift in Sources */,
|
||||
91BE429C1CBF7EC000F6B062 /* UIPageControl+Rx.swift in Sources */,
|
||||
C88254211B8A752B00B02D69 /* RxSearchBarDelegateProxy.swift in Sources */,
|
||||
C80DDEA71BCE69BA006A1832 /* ObservableConvertibleType+Driver.swift in Sources */,
|
||||
7EDBAEBC1C89B9B7006CBE67 /* UITabBarItem+Rx.swift in Sources */,
|
||||
C839365F1C70E02200A9A09E /* UIApplication+Rx.swift in Sources */,
|
||||
C80DDE9F1BCE69BA006A1832 /* Driver+Subscription.swift in Sources */,
|
||||
844BC8AC1CE4FA6300F5C7CB /* RxPickerViewDelegateProxy.swift in Sources */,
|
||||
C811C89D1C24D80100A2DDD4 /* DeallocObservable.swift in Sources */,
|
||||
C8BCD3ED1C14B5FB005F1280 /* UIView+Rx.swift in Sources */,
|
||||
C80D338F1B91EF9E0014629D /* Observable+Bind.swift in Sources */,
|
||||
|
|
@ -3326,6 +3431,7 @@
|
|||
C8093EED1B8A732E0088E94D /* KVOObservable.swift in Sources */,
|
||||
D2F461021CD7AC1F00527B4D /* Reactive.swift in Sources */,
|
||||
AAE623761C82475700FC7801 /* UIProgressView+Rx.swift in Sources */,
|
||||
271A97411CFC996B00D64125 /* UIViewController+Rx.swift in Sources */,
|
||||
C8DB968D1BF7595D0084BD53 /* KVORepresentable+Swift.swift in Sources */,
|
||||
C80DDEB11BCE8CA3006A1832 /* Driver+Operators+arity.swift in Sources */,
|
||||
C88254281B8A752B00B02D69 /* UIButton+Rx.swift in Sources */,
|
||||
|
|
@ -3344,7 +3450,9 @@
|
|||
C8BCD3F41C14B6D1005F1280 /* NSLayoutConstraint+Rx.swift in Sources */,
|
||||
C882542C1B8A752B00B02D69 /* UIGestureRecognizer+Rx.swift in Sources */,
|
||||
C8093EE11B8A732E0088E94D /* DelegateProxy.swift in Sources */,
|
||||
88718CFE1CE5D80000D88D60 /* UITabBar+Rx.swift in Sources */,
|
||||
C8093EF91B8A732E0088E94D /* RxCLLocationManagerDelegateProxy.swift in Sources */,
|
||||
88D98F2E1CE7549A00D50457 /* RxTabBarDelegateProxy.swift in Sources */,
|
||||
C88254331B8A752B00B02D69 /* UISwitch+Rx.swift in Sources */,
|
||||
8479BC4C1C3ACF6B00FB8B54 /* UIImagePickerController+Rx.swift in Sources */,
|
||||
C8DB96831BF754C80084BD53 /* NSObject+Rx+KVORepresentable.swift in Sources */,
|
||||
|
|
@ -3374,7 +3482,7 @@
|
|||
C8093EE41B8A732E0088E94D /* DelegateProxyType.swift in Sources */,
|
||||
C8093F481B8A732E0088E94D /* NSControl+Rx.swift in Sources */,
|
||||
C8093F4E1B8A732E0088E94D /* NSTextField+Rx.swift in Sources */,
|
||||
C88F76821CE5341700D5A014 /* RxTextInput.swift in Sources */,
|
||||
C88F76821CE5341700D5A014 /* TextInput.swift in Sources */,
|
||||
C8DB967F1BF7496C0084BD53 /* KVORepresentable.swift in Sources */,
|
||||
C8093EFE1B8A732E0088E94D /* RxTarget.swift in Sources */,
|
||||
C8093ED21B8A732E0088E94D /* _RX.m in Sources */,
|
||||
|
|
@ -3442,6 +3550,7 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
033C2EF61D081C460050C015 /* UIScrollView+RxTests.swift in Sources */,
|
||||
C835092A1C38706E0027C24C /* CLLocationManager+RxTests.swift in Sources */,
|
||||
C83509661C38706E0027C24C /* RxTest.swift in Sources */,
|
||||
C83509611C38706E0027C24C /* ObserverTests.swift in Sources */,
|
||||
|
|
@ -3449,17 +3558,22 @@
|
|||
C835094B1C38706E0027C24C /* AnonymousObservable+Test.swift in Sources */,
|
||||
C8C217D51CB7100E0038A2E6 /* UITableView+RxTests.swift in Sources */,
|
||||
C835092E1C38706E0027C24C /* ControlEventTests.swift in Sources */,
|
||||
844BC8BB1CE5024500F5C7CB /* UIPickerView+RxTests.swift in Sources */,
|
||||
C83509531C38706E0027C24C /* Observable+AggregateTest.swift in Sources */,
|
||||
C8B290891C94D64600E923D0 /* RxTest+Controls.swift in Sources */,
|
||||
C83509291C38706E0027C24C /* PerformanceTools.swift in Sources */,
|
||||
C8E9E42B1D43B26C0049644E /* Observable+DebugTest.swift in Sources */,
|
||||
C835096A1C38706E0027C24C /* TestErrors.swift in Sources */,
|
||||
1AF67DA61CED430100C310FA /* ReplaySubjectTest.swift in Sources */,
|
||||
C83509561C38706E0027C24C /* Observable+ConcurrencyTest.swift in Sources */,
|
||||
C835095A1C38706E0027C24C /* Observable+MultipleTest+Zip.swift in Sources */,
|
||||
C83509621C38706E0027C24C /* QueueTests.swift in Sources */,
|
||||
914FCD671CCDB82E0058B304 /* UIPageControl+RxTest.swift in Sources */,
|
||||
C83509551C38706E0027C24C /* Observable+BlockingTest.swift in Sources */,
|
||||
C83509351C38706E0027C24C /* KVOObservableTests.swift in Sources */,
|
||||
C83509421C38706E0027C24C /* MainThreadPrimitiveHotObservable.swift in Sources */,
|
||||
C835093A1C38706E0027C24C /* RuntimeStateSnapshot.swift in Sources */,
|
||||
C86B1E221D42BF5200130546 /* SchedulerTests.swift in Sources */,
|
||||
C83509441C38706E0027C24C /* MySubject.swift in Sources */,
|
||||
C835095F1C38706E0027C24C /* Observable+SubscriptionTest.swift in Sources */,
|
||||
C8C217D71CB710200038A2E6 /* UICollectionView+RxTests.swift in Sources */,
|
||||
|
|
@ -3477,9 +3591,11 @@
|
|||
C835095C1C38706E0027C24C /* Observable+MultipleTest.swift in Sources */,
|
||||
C83509331C38706E0027C24C /* Driver+Extensions.swift in Sources */,
|
||||
C835094F1C38706E0027C24C /* CurrentThreadSchedulerTest.swift in Sources */,
|
||||
1AF67DA21CED420A00C310FA /* PublishSubjectTest.swift in Sources */,
|
||||
C835093E1C38706E0027C24C /* UIView+RxTests.swift in Sources */,
|
||||
7EDBAEB41C89B1A6006CBE67 /* UITabBarItem+RxTests.swift in Sources */,
|
||||
C83509411C38706E0027C24C /* BackgroundThreadPrimitiveHotObservable.swift in Sources */,
|
||||
C8379EF41D1DD326003EF8FC /* UIButton+RxTests.swift in Sources */,
|
||||
C83509581C38706E0027C24C /* Observable+MultipleTest+CombineLatest.swift in Sources */,
|
||||
C83509651C38706E0027C24C /* VirtualSchedulerTest.swift in Sources */,
|
||||
8476A0211C3D5DC60040BA22 /* UIImagePickerController+RxTests.swift in Sources */,
|
||||
|
|
@ -3491,8 +3607,10 @@
|
|||
C83509601C38706E0027C24C /* Observable+TimeTest.swift in Sources */,
|
||||
C835093F1C38706E0027C24C /* ElementIndexPair.swift in Sources */,
|
||||
C83509381C38706E0027C24C /* NSObject+RxTests.swift in Sources */,
|
||||
271A97441CFC9F7B00D64125 /* UIViewControler+RxTests.swift in Sources */,
|
||||
C83509631C38706E0027C24C /* SubjectConcurrencyTest.swift in Sources */,
|
||||
84E4D3961C9B011000ADFDC9 /* UISearchController+RxTests.swift in Sources */,
|
||||
88718D011CE5DE2600D88D60 /* UITabBar+RxTests.swift in Sources */,
|
||||
C83509511C38706E0027C24C /* HistoricalSchedulerTest.swift in Sources */,
|
||||
C835096B1C38706E0027C24C /* XCTest+AllTests.swift in Sources */,
|
||||
C83509541C38706E0027C24C /* Observable+BindingTest.swift in Sources */,
|
||||
|
|
@ -3544,12 +3662,16 @@
|
|||
C83509BA1C38750D0027C24C /* Control+RxTests+UIKit.swift in Sources */,
|
||||
C83509E01C3875500027C24C /* Observable+Extensions.swift in Sources */,
|
||||
C83509C41C3875220027C24C /* NSLayoutConstraint+RxTests.swift in Sources */,
|
||||
88718D021CE5DE2600D88D60 /* UITabBar+RxTests.swift in Sources */,
|
||||
C83509BC1C38750D0027C24C /* ControlEventTests.swift in Sources */,
|
||||
C83509EC1C3875580027C24C /* MockDisposable.swift in Sources */,
|
||||
1AF67DA31CED427D00C310FA /* PublishSubjectTest.swift in Sources */,
|
||||
C8350A111C38756A0027C24C /* Observable+SingleTest.swift in Sources */,
|
||||
C8E9E42C1D43B26C0049644E /* Observable+DebugTest.swift in Sources */,
|
||||
C8350A2A1C3875B50027C24C /* RxMutableBox.swift in Sources */,
|
||||
C8350A151C38756A0027C24C /* ObserverTests.swift in Sources */,
|
||||
C83509B11C3874E20027C24C /* PerformanceTools.swift in Sources */,
|
||||
1AF67DA71CED430100C310FA /* ReplaySubjectTest.swift in Sources */,
|
||||
C83509AE1C3874D80027C24C /* Foundation+Extensions.swift in Sources */,
|
||||
C83509F11C3875580027C24C /* TestConnectableObservable.swift in Sources */,
|
||||
C83509AA1C3874D20027C24C /* TestErrors.swift in Sources */,
|
||||
|
|
@ -3571,6 +3693,7 @@
|
|||
C83509C31C3875220027C24C /* KVOObservableTests.swift in Sources */,
|
||||
C83509F91C38755D0027C24C /* MainSchedulerTests.swift in Sources */,
|
||||
7EDBAEC31C89BCB9006CBE67 /* UITabBarItem+RxTests.swift in Sources */,
|
||||
914FCD681CCDB82E0058B304 /* UIPageControl+RxTest.swift in Sources */,
|
||||
C83509AB1C3874D20027C24C /* XCTest+AllTests.swift in Sources */,
|
||||
C83509C11C3875220027C24C /* Driver+Extensions.swift in Sources */,
|
||||
C83509DD1C38754C0027C24C /* EquatableArray.swift in Sources */,
|
||||
|
|
@ -3582,6 +3705,7 @@
|
|||
C83509EA1C3875580027C24C /* BackgroundThreadPrimitiveHotObservable.swift in Sources */,
|
||||
C84CB1721C3876B800EB63CC /* UIView+RxTests.swift in Sources */,
|
||||
C83509F81C38755D0027C24C /* HistoricalSchedulerTest.swift in Sources */,
|
||||
C8379EF51D1DD326003EF8FC /* UIButton+RxTests.swift in Sources */,
|
||||
C83509F21C38755D0027C24C /* AnonymousObservable+Test.swift in Sources */,
|
||||
7FE849481C5D0D6B00845C0E /* UIRefreshControl+RxTests.swift in Sources */,
|
||||
C83509D31C3875390027C24C /* RXObjCRuntime+Testing.m in Sources */,
|
||||
|
|
@ -3591,6 +3715,7 @@
|
|||
C83509AF1C3874DC0027C24C /* RxTest.swift in Sources */,
|
||||
C83509F41C38755D0027C24C /* BagTest.swift in Sources */,
|
||||
C8F27DC11CE68DA700D5FB4F /* UITextView+RxTests.swift in Sources */,
|
||||
C86B1E231D42BF5200130546 /* SchedulerTests.swift in Sources */,
|
||||
C860EC961C42E26100A664B3 /* SectionedViewDataSourceMock.swift in Sources */,
|
||||
C8350A0F1C3875630027C24C /* Observable+MultipleTest+Zip.swift in Sources */,
|
||||
);
|
||||
|
|
@ -3601,6 +3726,7 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C8350A201C38756B0027C24C /* QueueTests.swift in Sources */,
|
||||
1AF67DA41CED427D00C310FA /* PublishSubjectTest.swift in Sources */,
|
||||
C83509E71C3875580027C24C /* PrimitiveHotObservable.swift in Sources */,
|
||||
C83509CE1C3875230027C24C /* NSObject+RxTests.swift in Sources */,
|
||||
C8350A011C38755E0027C24C /* AssumptionsTest.swift in Sources */,
|
||||
|
|
@ -3611,6 +3737,7 @@
|
|||
C8350A071C38755E0027C24C /* MainSchedulerTests.swift in Sources */,
|
||||
C83509B81C38750D0027C24C /* ControlEventTests.swift in Sources */,
|
||||
C83509CB1C3875230027C24C /* KVOObservableTests.swift in Sources */,
|
||||
C8E9E42D1D43B26C0049644E /* Observable+DebugTest.swift in Sources */,
|
||||
C83509AD1C3874D70027C24C /* Foundation+Extensions.swift in Sources */,
|
||||
C83509C81C3875230027C24C /* DelegateProxyTest.swift in Sources */,
|
||||
C8350A0D1C38755E0027C24C /* Observable+MultipleTest+CombineLatest.swift in Sources */,
|
||||
|
|
@ -3622,6 +3749,7 @@
|
|||
C83509A71C3874D10027C24C /* TestErrors.swift in Sources */,
|
||||
C83509D61C3875420027C24C /* SentMessageTest.swift in Sources */,
|
||||
C8350A021C38755E0027C24C /* BagTest.swift in Sources */,
|
||||
C86B1E241D42BF5200130546 /* SchedulerTests.swift in Sources */,
|
||||
C8350A081C38755E0027C24C /* Observable+AggregateTest.swift in Sources */,
|
||||
C83509E81C3875580027C24C /* PrimitiveMockObserver.swift in Sources */,
|
||||
C83509BE1C3875100027C24C /* DelegateProxyTest+Cocoa.swift in Sources */,
|
||||
|
|
@ -3644,6 +3772,7 @@
|
|||
C83509CA1C3875230027C24C /* Driver+Test.swift in Sources */,
|
||||
C83509E41C3875580027C24C /* MockDisposable.swift in Sources */,
|
||||
C83509D51C38753E0027C24C /* RxObjCRuntimeState.swift in Sources */,
|
||||
1AF67DA81CED430100C310FA /* ReplaySubjectTest.swift in Sources */,
|
||||
C8350A001C38755E0027C24C /* AnonymousObservable+Test.swift in Sources */,
|
||||
C83509E91C3875580027C24C /* TestConnectableObservable.swift in Sources */,
|
||||
C83509DF1C38754F0027C24C /* TestVirtualScheduler.swift in Sources */,
|
||||
|
|
@ -3690,6 +3819,7 @@
|
|||
C849BE2C1BAB5D070019AD27 /* ObservableConvertibleType.swift in Sources */,
|
||||
C8C3DA0A1B93941E004D233E /* Error.swift in Sources */,
|
||||
C8093D9C1B8A72BE0088E94D /* SchedulerServices+Emulation.swift in Sources */,
|
||||
C80EEC351D42D06E00131C39 /* DispatchQueueConfiguration.swift in Sources */,
|
||||
C80DA3391C30B20B00C588B9 /* VirtualTimeScheduler.swift in Sources */,
|
||||
C8093D6A1B8A72BE0088E94D /* AnyObserver.swift in Sources */,
|
||||
C8093D3C1B8A72BE0088E94D /* Skip.swift in Sources */,
|
||||
|
|
@ -3712,7 +3842,7 @@
|
|||
C8093DA41B8A72BE0088E94D /* ReplaySubject.swift in Sources */,
|
||||
C8C3D9FF1B935EDF004D233E /* Zip+CollectionType.swift in Sources */,
|
||||
C8093D641B8A72BE0088E94D /* Observable+Time.swift in Sources */,
|
||||
C8093CFC1B8A72BE0088E94D /* Observable+Extensions.swift in Sources */,
|
||||
C8093CFC1B8A72BE0088E94D /* ObservableType+Extensions.swift in Sources */,
|
||||
C8093D4A1B8A72BE0088E94D /* Throttle.swift in Sources */,
|
||||
C8B145011BD2D80100267DCE /* ImmediateScheduler.swift in Sources */,
|
||||
C8093D061B8A72BE0088E94D /* Catch.swift in Sources */,
|
||||
|
|
@ -3788,6 +3918,7 @@
|
|||
C8093D9E1B8A72BE0088E94D /* SerialDispatchQueueScheduler.swift in Sources */,
|
||||
C8093D341B8A72BE0088E94D /* RefCount.swift in Sources */,
|
||||
C8093D0E1B8A72BE0088E94D /* Concat.swift in Sources */,
|
||||
CDDEF16B1D4FB40000CA8546 /* Disposables.swift in Sources */,
|
||||
C8093CCA1B8A72BE0088E94D /* Lock.swift in Sources */,
|
||||
C8093D441B8A72BE0088E94D /* Take.swift in Sources */,
|
||||
C84CC5591BDCF51200E06A64 /* SynchronizedSubscribeType.swift in Sources */,
|
||||
|
|
@ -3812,7 +3943,6 @@
|
|||
CBEE77201BD649A000AD584C /* ToArray.swift in Sources */,
|
||||
C8093CFE1B8A72BE0088E94D /* Observable.swift in Sources */,
|
||||
C84CC55E1BDD010800E06A64 /* SynchronizedUnsubscribeType.swift in Sources */,
|
||||
C8093CE21B8A72BE0088E94D /* NAryDisposable.swift in Sources */,
|
||||
C8093CEC1B8A72BE0088E94D /* SerialDisposable.swift in Sources */,
|
||||
C8C3DA0D1B93959F004D233E /* Never.swift in Sources */,
|
||||
C84CC5681BDD08A500E06A64 /* SubscriptionDisposable.swift in Sources */,
|
||||
|
|
@ -3912,6 +4042,7 @@
|
|||
C849BE2B1BAB5D070019AD27 /* ObservableConvertibleType.swift in Sources */,
|
||||
C8C3DA091B93941E004D233E /* Error.swift in Sources */,
|
||||
C8093D9B1B8A72BE0088E94D /* SchedulerServices+Emulation.swift in Sources */,
|
||||
C80EEC341D42D06E00131C39 /* DispatchQueueConfiguration.swift in Sources */,
|
||||
C8093D691B8A72BE0088E94D /* AnyObserver.swift in Sources */,
|
||||
C8093D3B1B8A72BE0088E94D /* Skip.swift in Sources */,
|
||||
C8B144FB1BD2D44500267DCE /* ConcurrentMainScheduler.swift in Sources */,
|
||||
|
|
@ -3933,7 +4064,7 @@
|
|||
C8093DA31B8A72BE0088E94D /* ReplaySubject.swift in Sources */,
|
||||
C8C3D9FE1B935EDF004D233E /* Zip+CollectionType.swift in Sources */,
|
||||
C8093D631B8A72BE0088E94D /* Observable+Time.swift in Sources */,
|
||||
C8093CFB1B8A72BE0088E94D /* Observable+Extensions.swift in Sources */,
|
||||
C8093CFB1B8A72BE0088E94D /* ObservableType+Extensions.swift in Sources */,
|
||||
C8093D491B8A72BE0088E94D /* Throttle.swift in Sources */,
|
||||
C8B145001BD2D80100267DCE /* ImmediateScheduler.swift in Sources */,
|
||||
C8093D051B8A72BE0088E94D /* Catch.swift in Sources */,
|
||||
|
|
@ -4010,6 +4141,7 @@
|
|||
C8093D9D1B8A72BE0088E94D /* SerialDispatchQueueScheduler.swift in Sources */,
|
||||
C8093D331B8A72BE0088E94D /* RefCount.swift in Sources */,
|
||||
C8093D0D1B8A72BE0088E94D /* Concat.swift in Sources */,
|
||||
CDDEF16A1D4FB40000CA8546 /* Disposables.swift in Sources */,
|
||||
C8093CC91B8A72BE0088E94D /* Lock.swift in Sources */,
|
||||
C8093D431B8A72BE0088E94D /* Take.swift in Sources */,
|
||||
C84CC5581BDCF51200E06A64 /* SynchronizedSubscribeType.swift in Sources */,
|
||||
|
|
@ -4034,7 +4166,6 @@
|
|||
CBEE771F1BD649A000AD584C /* ToArray.swift in Sources */,
|
||||
C8093CFD1B8A72BE0088E94D /* Observable.swift in Sources */,
|
||||
C84CC55D1BDD010800E06A64 /* SynchronizedUnsubscribeType.swift in Sources */,
|
||||
C8093CE11B8A72BE0088E94D /* NAryDisposable.swift in Sources */,
|
||||
C8093CEB1B8A72BE0088E94D /* SerialDisposable.swift in Sources */,
|
||||
C8C3DA0C1B93959F004D233E /* Never.swift in Sources */,
|
||||
C84CC5671BDD08A500E06A64 /* SubscriptionDisposable.swift in Sources */,
|
||||
|
|
@ -4058,6 +4189,7 @@
|
|||
C89461751BC6C1210055219D /* ObservableConvertibleType.swift in Sources */,
|
||||
C8F0BF981BBBFB8B001B112F /* Error.swift in Sources */,
|
||||
C8F0BF991BBBFB8B001B112F /* SchedulerServices+Emulation.swift in Sources */,
|
||||
C80EEC371D42D06E00131C39 /* DispatchQueueConfiguration.swift in Sources */,
|
||||
C80DA33B1C30B20C00C588B9 /* VirtualTimeScheduler.swift in Sources */,
|
||||
C8F0BF9A1BBBFB8B001B112F /* AnyObserver.swift in Sources */,
|
||||
C8F0BF9B1BBBFB8B001B112F /* Skip.swift in Sources */,
|
||||
|
|
@ -4080,7 +4212,7 @@
|
|||
C8F0BFA61BBBFB8B001B112F /* ReplaySubject.swift in Sources */,
|
||||
C8F0BFA71BBBFB8B001B112F /* Zip+CollectionType.swift in Sources */,
|
||||
C8F0BFA81BBBFB8B001B112F /* Observable+Time.swift in Sources */,
|
||||
C8F0BFA91BBBFB8B001B112F /* Observable+Extensions.swift in Sources */,
|
||||
C8F0BFA91BBBFB8B001B112F /* ObservableType+Extensions.swift in Sources */,
|
||||
C8F0BFAA1BBBFB8B001B112F /* Throttle.swift in Sources */,
|
||||
C8B145031BD2D80100267DCE /* ImmediateScheduler.swift in Sources */,
|
||||
C8F0BFAC1BBBFB8B001B112F /* Catch.swift in Sources */,
|
||||
|
|
@ -4156,6 +4288,7 @@
|
|||
C8F0BFE01BBBFB8B001B112F /* SerialDispatchQueueScheduler.swift in Sources */,
|
||||
C8F0BFE11BBBFB8B001B112F /* RefCount.swift in Sources */,
|
||||
C8F0BFE21BBBFB8B001B112F /* Concat.swift in Sources */,
|
||||
CDDEF16D1D4FB40000CA8546 /* Disposables.swift in Sources */,
|
||||
C8F0BFE31BBBFB8B001B112F /* Lock.swift in Sources */,
|
||||
C8F0BFE41BBBFB8B001B112F /* Take.swift in Sources */,
|
||||
C84CC55B1BDCF51200E06A64 /* SynchronizedSubscribeType.swift in Sources */,
|
||||
|
|
@ -4180,7 +4313,6 @@
|
|||
CBEE77221BD649A000AD584C /* ToArray.swift in Sources */,
|
||||
C8F0BFF41BBBFB8B001B112F /* Observable.swift in Sources */,
|
||||
C84CC5601BDD010800E06A64 /* SynchronizedUnsubscribeType.swift in Sources */,
|
||||
C8F0BFF51BBBFB8B001B112F /* NAryDisposable.swift in Sources */,
|
||||
C8F0BFF61BBBFB8B001B112F /* SerialDisposable.swift in Sources */,
|
||||
C8F0BFF71BBBFB8B001B112F /* Never.swift in Sources */,
|
||||
C84CC56A1BDD08A500E06A64 /* SubscriptionDisposable.swift in Sources */,
|
||||
|
|
@ -4222,6 +4354,7 @@
|
|||
C8F0C0161BBBFBB9001B112F /* UITableView+Rx.swift in Sources */,
|
||||
84E4D3941C9AFD3600ADFDC9 /* UISearchController+Rx.swift in Sources */,
|
||||
C8F0C0171BBBFBB9001B112F /* RxCollectionViewReactiveArrayDataSource.swift in Sources */,
|
||||
844BC8B61CE4FD7500F5C7CB /* UIPickerView+Rx.swift in Sources */,
|
||||
54D213931CE08DDB0028D5B4 /* UINavigationItem+Rx.swift in Sources */,
|
||||
C8C4B4AC1C17722400828BD5 /* _RXObjCRuntime.m in Sources */,
|
||||
C8F0C0181BBBFBB9001B112F /* KVOObserver.swift in Sources */,
|
||||
|
|
@ -4244,6 +4377,7 @@
|
|||
C8F0C0261BBBFBB9001B112F /* _RXDelegateProxy.m in Sources */,
|
||||
C8F0C0271BBBFBB9001B112F /* NSObject+Rx.swift in Sources */,
|
||||
9BA1CBFE1C0F84C40044B50A /* UIActivityIndicatorView+Rx.swift in Sources */,
|
||||
87379AE01D61C6F50047CA88 /* Reactive.swift in Sources */,
|
||||
842A5A2E1C357F94003568D5 /* NSTextStorage+Rx.swift in Sources */,
|
||||
C8F0C0281BBBFBB9001B112F /* RxTextViewDelegateProxy.swift in Sources */,
|
||||
C8F0C0291BBBFBB9001B112F /* UIBarButtonItem+Rx.swift in Sources */,
|
||||
|
|
@ -4251,6 +4385,7 @@
|
|||
C8F0C02B1BBBFBB9001B112F /* ControlProperty.swift in Sources */,
|
||||
C8F0C02C1BBBFBB9001B112F /* UIDatePicker+Rx.swift in Sources */,
|
||||
C8F0C02D1BBBFBB9001B112F /* RxTableViewDataSourceProxy.swift in Sources */,
|
||||
844BC8AE1CE4FA6600F5C7CB /* RxPickerViewDelegateProxy.swift in Sources */,
|
||||
C8BCD3F71C14B6D1005F1280 /* NSLayoutConstraint+Rx.swift in Sources */,
|
||||
C8F0C0301BBBFBB9001B112F /* UIGestureRecognizer+Rx.swift in Sources */,
|
||||
C8F0C0311BBBFBB9001B112F /* DelegateProxy.swift in Sources */,
|
||||
|
|
@ -4261,12 +4396,13 @@
|
|||
C8F0C0341BBBFBB9001B112F /* Logging.swift in Sources */,
|
||||
C8F0C0351BBBFBB9001B112F /* UICollectionView+Rx.swift in Sources */,
|
||||
C8F0C0361BBBFBB9001B112F /* RxCollectionViewDataSourceType.swift in Sources */,
|
||||
91BE429F1CBF7F3D00F6B062 /* UIPageControl+Rx.swift in Sources */,
|
||||
846436E61C9AF6670035B40D /* RxSearchControllerDelegateProxy.swift in Sources */,
|
||||
C8F0C0371BBBFBB9001B112F /* NSNotificationCenter+Rx.swift in Sources */,
|
||||
C8F0C0381BBBFBB9001B112F /* UITextField+Rx.swift in Sources */,
|
||||
C8F0C0391BBBFBB9001B112F /* NSURLSession+Rx.swift in Sources */,
|
||||
C8F0C03A1BBBFBB9001B112F /* ControlTarget.swift in Sources */,
|
||||
C88F76841CE5341700D5A014 /* RxTextInput.swift in Sources */,
|
||||
C88F76841CE5341700D5A014 /* TextInput.swift in Sources */,
|
||||
C8F0C03B1BBBFBB9001B112F /* UISearchBar+Rx.swift in Sources */,
|
||||
C8F0C03C1BBBFBB9001B112F /* ItemEvents.swift in Sources */,
|
||||
7EDBAEBF1C89B9B7006CBE67 /* UITabBarItem+Rx.swift in Sources */,
|
||||
|
|
@ -4300,9 +4436,12 @@
|
|||
8479BC481C3ACDF700FB8B54 /* RxImagePickerDelegateProxy.swift in Sources */,
|
||||
D203C5081BB9C53E00D02D00 /* UIGestureRecognizer+Rx.swift in Sources */,
|
||||
D2138C931BB9BEDA00339B5C /* NSNotificationCenter+Rx.swift in Sources */,
|
||||
88D98F2F1CE7549A00D50457 /* RxTabBarDelegateProxy.swift in Sources */,
|
||||
C80DDE991BCE69BA006A1832 /* ControlProperty+Driver.swift in Sources */,
|
||||
844BC8B51CE4FD7500F5C7CB /* UIPickerView+Rx.swift in Sources */,
|
||||
C80DDE951BCE69BA006A1832 /* ControlEvent+Driver.swift in Sources */,
|
||||
D203C4F61BB9C52E00D02D00 /* RxCollectionViewDataSourceType.swift in Sources */,
|
||||
88718CFF1CE5D80000D88D60 /* UITabBar+Rx.swift in Sources */,
|
||||
84C225A41C33F00B008724EC /* RxTextStorageDelegateProxy.swift in Sources */,
|
||||
D203C5131BB9C53E00D02D00 /* UITextView+Rx.swift in Sources */,
|
||||
D203C4F41BB9C52400D02D00 /* RxTableViewReactiveArrayDataSource.swift in Sources */,
|
||||
|
|
@ -4328,13 +4467,14 @@
|
|||
C80DDEA91BCE69BA006A1832 /* ObservableConvertibleType+Driver.swift in Sources */,
|
||||
C80DDEA11BCE69BA006A1832 /* Driver+Subscription.swift in Sources */,
|
||||
D2138C891BB9BEBE00339B5C /* DelegateProxyType.swift in Sources */,
|
||||
C88F76831CE5341700D5A014 /* RxTextInput.swift in Sources */,
|
||||
C88F76831CE5341700D5A014 /* TextInput.swift in Sources */,
|
||||
C811C89F1C24D80100A2DDD4 /* DeallocObservable.swift in Sources */,
|
||||
54D213921CE08D0C0028D5B4 /* UINavigationItem+Rx.swift in Sources */,
|
||||
D2F461041CD7AC2100527B4D /* Reactive.swift in Sources */,
|
||||
C8BCD3EF1C14B5FB005F1280 /* UIView+Rx.swift in Sources */,
|
||||
D2138C921BB9BED600339B5C /* KVOObserver.swift in Sources */,
|
||||
D2138C831BB9BEBE00339B5C /* _RXKVOObserver.m in Sources */,
|
||||
46307D4F1CDE77D800E47A1C /* UIAlertAction+Rx.swift in Sources */,
|
||||
C80DDEB31BCE8CA3006A1832 /* Driver+Operators+arity.swift in Sources */,
|
||||
C8DB968F1BF7595D0084BD53 /* KVORepresentable+Swift.swift in Sources */,
|
||||
D203C5061BB9C53E00D02D00 /* UIControl+Rx.swift in Sources */,
|
||||
|
|
@ -4357,8 +4497,10 @@
|
|||
D203C4FA1BB9C53700D02D00 /* RxCollectionViewDataSourceProxy.swift in Sources */,
|
||||
D2138C7F1BB9BEBE00339B5C /* _RX.m in Sources */,
|
||||
8479BC4D1C3ACF6E00FB8B54 /* UIImagePickerController+Rx.swift in Sources */,
|
||||
91BE429D1CBF7EC000F6B062 /* UIPageControl+Rx.swift in Sources */,
|
||||
D203C4FE1BB9C53700D02D00 /* RxTableViewDataSourceProxy.swift in Sources */,
|
||||
D203C5001BB9C53700D02D00 /* RxTextViewDelegateProxy.swift in Sources */,
|
||||
844BC8AD1CE4FA6400F5C7CB /* RxPickerViewDelegateProxy.swift in Sources */,
|
||||
C8DB96851BF754C80084BD53 /* NSObject+Rx+KVORepresentable.swift in Sources */,
|
||||
D203C5091BB9C53E00D02D00 /* UIImageView+Rx.swift in Sources */,
|
||||
D2138C871BB9BEBE00339B5C /* CLLocationManager+Rx.swift in Sources */,
|
||||
|
|
@ -4389,6 +4531,7 @@
|
|||
C89461761BC6C1220055219D /* ObservableConvertibleType.swift in Sources */,
|
||||
D2EBEAF71BB9B6B2003A27DC /* ScheduledDisposable.swift in Sources */,
|
||||
D2EBEAE11BB9B697003A27DC /* ImmediateSchedulerType.swift in Sources */,
|
||||
C80EEC361D42D06E00131C39 /* DispatchQueueConfiguration.swift in Sources */,
|
||||
C80DA33A1C30B20B00C588B9 /* VirtualTimeScheduler.swift in Sources */,
|
||||
D2EBEB0B1BB9B6C1003A27DC /* Empty.swift in Sources */,
|
||||
D2EBEAF11BB9B6AE003A27DC /* BinaryDisposable.swift in Sources */,
|
||||
|
|
@ -4464,7 +4607,6 @@
|
|||
D2EBEAF61BB9B6B2003A27DC /* NopDisposable.swift in Sources */,
|
||||
CB30D9EB1BF0E3500084C1C0 /* SingleAsync.swift in Sources */,
|
||||
D2EBEAFF1BB9B6BA003A27DC /* Buffer.swift in Sources */,
|
||||
D2EBEAF51BB9B6AE003A27DC /* NAryDisposable.swift in Sources */,
|
||||
D2EBEB1D1BB9B6C1003A27DC /* Scan.swift in Sources */,
|
||||
D2EBEB261BB9B6C1003A27DC /* Throttle.swift in Sources */,
|
||||
D2EBEAE81BB9B697003A27DC /* Rx.swift in Sources */,
|
||||
|
|
@ -4480,7 +4622,7 @@
|
|||
D2EBEAE91BB9B697003A27DC /* RxMutableBox.swift in Sources */,
|
||||
D2EBEAFC1BB9B6BA003A27DC /* Amb.swift in Sources */,
|
||||
D2EBEB231BB9B6C1003A27DC /* Take.swift in Sources */,
|
||||
D2EBEAE31BB9B697003A27DC /* Observable+Extensions.swift in Sources */,
|
||||
D2EBEAE31BB9B697003A27DC /* ObservableType+Extensions.swift in Sources */,
|
||||
B1D899911BF653410027B05C /* Timeout.swift in Sources */,
|
||||
D2EBEB121BB9B6C1003A27DC /* Merge.swift in Sources */,
|
||||
D2EBEAEF1BB9B6A4003A27DC /* Queue.swift in Sources */,
|
||||
|
|
@ -4488,6 +4630,7 @@
|
|||
D2EBEB2B1BB9B6CA003A27DC /* Observable+Aggregate.swift in Sources */,
|
||||
D2EBEB291BB9B6C1003A27DC /* Zip+arity.swift in Sources */,
|
||||
D2EBEB241BB9B6C1003A27DC /* TakeUntil.swift in Sources */,
|
||||
CDDEF16C1D4FB40000CA8546 /* Disposables.swift in Sources */,
|
||||
C84CC55A1BDCF51200E06A64 /* SynchronizedSubscribeType.swift in Sources */,
|
||||
D2EBEB3B1BB9B6D8003A27DC /* OperationQueueScheduler.swift in Sources */,
|
||||
D2EBEAE51BB9B697003A27DC /* AnyObserver.swift in Sources */,
|
||||
|
|
@ -5102,8 +5245,10 @@
|
|||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
|
|
@ -5113,6 +5258,7 @@
|
|||
ENABLE_BITCODE = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "TRACE_RESOURCES=1";
|
||||
|
|
@ -5124,11 +5270,12 @@
|
|||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
OTHER_SWIFT_FLAGS = "-D TRACE_RESOURCES";
|
||||
SDKROOT = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
|
|
@ -5361,6 +5508,7 @@
|
|||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks";
|
||||
INFOPLIST_FILE = RxTests/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
|
|
@ -5382,6 +5530,7 @@
|
|||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks";
|
||||
INFOPLIST_FILE = RxTests/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
|
|
@ -5403,6 +5552,7 @@
|
|||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks";
|
||||
INFOPLIST_FILE = RxTests/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
|
|
@ -5493,8 +5643,10 @@
|
|||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
|
|
@ -5521,12 +5673,13 @@
|
|||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_SWIFT_FLAGS = "-D TRACE_RESOURCES -D DEBUG";
|
||||
SDKROOT = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
|
|
@ -5549,8 +5702,10 @@
|
|||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
|
|
@ -5560,6 +5715,7 @@
|
|||
ENABLE_BITCODE = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
|
|
@ -5570,11 +5726,12 @@
|
|||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
OTHER_SWIFT_FLAGS = "-D RELEASE";
|
||||
SDKROOT = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Rx.playground">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Package.swift">
|
||||
</FileRef>
|
||||
|
|
@ -10,6 +13,9 @@
|
|||
<FileRef
|
||||
location = "group:README.md">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:ISSUE_TEMPLATE.md">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:CHANGELOG.md">
|
||||
</FileRef>
|
||||
|
|
@ -32,33 +38,8 @@
|
|||
<Group
|
||||
location = "group:scripts"
|
||||
name = "scripts">
|
||||
<Group
|
||||
location = "group:automation-tests"
|
||||
name = "automation-tests">
|
||||
<FileRef
|
||||
location = "group:01_githubSignUp.js">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:02_searchWikipedia.js">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:03_masterDetail.js">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:04_controlsTests.js">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:05_reactivePartialUpdates.js">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:common.js">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:main.js">
|
||||
</FileRef>
|
||||
</Group>
|
||||
<FileRef
|
||||
location = "group:automation-tests.sh">
|
||||
location = "group:all-tests.sh">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:common.sh">
|
||||
|
|
@ -66,9 +47,6 @@
|
|||
<FileRef
|
||||
location = "group:/Users/kzaher/Projects/RxSwift/scripts/package-spm.swift">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:pre-release-tests.sh">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:test-linux.sh">
|
||||
</FileRef>
|
||||
|
|
@ -103,9 +81,6 @@
|
|||
<FileRef
|
||||
location = "group:HotAndColdObservables.md">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:IssueTemplate.md">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Linux.md">
|
||||
</FileRef>
|
||||
|
|
@ -128,9 +103,6 @@
|
|||
location = "group:Warnings.md">
|
||||
</FileRef>
|
||||
</Group>
|
||||
<FileRef
|
||||
location = "group:Rx.playground">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Rx.xcodeproj">
|
||||
</FileRef>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "RxBlocking"
|
||||
s.version = "2.5.0"
|
||||
s.version = "3.0.0.alpha.1"
|
||||
s.summary = "RxSwift Blocking operatos"
|
||||
s.description = <<-DESC
|
||||
Set of blocking operators for RxSwift. These operators are mostly intended for unit/integration tests
|
||||
|
|
@ -18,11 +18,11 @@ Waiting for observable sequence to complete before exiting command line applicat
|
|||
s.requires_arc = true
|
||||
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.osx.deployment_target = '10.9'
|
||||
s.osx.deployment_target = '10.10'
|
||||
s.watchos.deployment_target = '2.0'
|
||||
s.tvos.deployment_target = '9.0'
|
||||
|
||||
s.source_files = 'RxBlocking/**/*.swift'
|
||||
|
||||
s.dependency 'RxSwift', '~> 2.5'
|
||||
s.dependency 'RxSwift', '~> 3.0.0.alpha.1'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ extension BlockingObservable {
|
|||
public func toArray() throws -> [E] {
|
||||
var elements: [E] = Array<E>()
|
||||
|
||||
var error: ErrorType?
|
||||
var error: Swift.Error?
|
||||
|
||||
let lock = RunLoopLock()
|
||||
|
||||
|
|
@ -30,17 +30,17 @@ extension BlockingObservable {
|
|||
|
||||
lock.dispatch {
|
||||
d.disposable = self.source.subscribe { e in
|
||||
if d.disposed {
|
||||
if d.isDisposed {
|
||||
return
|
||||
}
|
||||
switch e {
|
||||
case .Next(let element):
|
||||
case .next(let element):
|
||||
elements.append(element)
|
||||
case .Error(let e):
|
||||
case .error(let e):
|
||||
error = e
|
||||
d.dispose()
|
||||
lock.stop()
|
||||
case .Completed:
|
||||
case .completed:
|
||||
d.dispose()
|
||||
lock.stop()
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ extension BlockingObservable {
|
|||
public func first() throws -> E? {
|
||||
var element: E?
|
||||
|
||||
var error: ErrorType?
|
||||
var error: Swift.Error?
|
||||
|
||||
let d = SingleAssignmentDisposable()
|
||||
|
||||
|
|
@ -78,17 +78,17 @@ extension BlockingObservable {
|
|||
|
||||
lock.dispatch {
|
||||
d.disposable = self.source.subscribe { e in
|
||||
if d.disposed {
|
||||
if d.isDisposed {
|
||||
return
|
||||
}
|
||||
|
||||
switch e {
|
||||
case .Next(let e):
|
||||
case .next(let e):
|
||||
if element == nil {
|
||||
element = e
|
||||
}
|
||||
break
|
||||
case .Error(let e):
|
||||
case .error(let e):
|
||||
error = e
|
||||
default:
|
||||
break
|
||||
|
|
@ -122,7 +122,7 @@ extension BlockingObservable {
|
|||
public func last() throws -> E? {
|
||||
var element: E?
|
||||
|
||||
var error: ErrorType?
|
||||
var error: Swift.Error?
|
||||
|
||||
let d = SingleAssignmentDisposable()
|
||||
|
||||
|
|
@ -130,14 +130,14 @@ extension BlockingObservable {
|
|||
|
||||
lock.dispatch {
|
||||
d.disposable = self.source.subscribe { e in
|
||||
if d.disposed {
|
||||
if d.isDisposed {
|
||||
return
|
||||
}
|
||||
switch e {
|
||||
case .Next(let e):
|
||||
case .next(let e):
|
||||
element = e
|
||||
return
|
||||
case .Error(let e):
|
||||
case .error(let e):
|
||||
error = e
|
||||
default:
|
||||
break
|
||||
|
|
@ -180,10 +180,10 @@ extension BlockingObservable {
|
|||
- parameter predicate: A function to test each source element for a condition.
|
||||
- returns: Returns the only element of an sequence that satisfies the condition in the predicate, and reports an error if there is not exactly one element in the sequence.
|
||||
*/
|
||||
public func single(predicate: (E) throws -> Bool) throws -> E? {
|
||||
public func single(_ predicate: @escaping (E) throws -> Bool) throws -> E? {
|
||||
var element: E?
|
||||
|
||||
var error: ErrorType?
|
||||
var error: Swift.Error?
|
||||
|
||||
let d = SingleAssignmentDisposable()
|
||||
|
||||
|
|
@ -191,11 +191,11 @@ extension BlockingObservable {
|
|||
|
||||
lock.dispatch {
|
||||
d.disposable = self.source.subscribe { e in
|
||||
if d.disposed {
|
||||
if d.isDisposed {
|
||||
return
|
||||
}
|
||||
switch e {
|
||||
case .Next(let e):
|
||||
case .next(let e):
|
||||
do {
|
||||
if try !predicate(e) {
|
||||
return
|
||||
|
|
@ -203,7 +203,7 @@ extension BlockingObservable {
|
|||
if element == nil {
|
||||
element = e
|
||||
} else {
|
||||
throw RxError.MoreThanOneElement
|
||||
throw RxError.moreThanOneElement
|
||||
}
|
||||
} catch (let err) {
|
||||
error = err
|
||||
|
|
@ -211,11 +211,11 @@ extension BlockingObservable {
|
|||
lock.stop()
|
||||
}
|
||||
return
|
||||
case .Error(let e):
|
||||
case .error(let e):
|
||||
error = e
|
||||
case .Completed:
|
||||
case .completed:
|
||||
if element == nil {
|
||||
error = RxError.NoElements
|
||||
error = RxError.noElements
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -17,8 +17,8 @@ extension ObservableConvertibleType {
|
|||
|
||||
- returns: `BlockingObservable` version of `self`
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func toBlocking() -> BlockingObservable<E> {
|
||||
return BlockingObservable(source: self.asObservable())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ typealias AtomicInt = Int32
|
|||
#endif
|
||||
|
||||
class RunLoopLock {
|
||||
let currentRunLoop: CFRunLoopRef
|
||||
let currentRunLoop: CFRunLoop
|
||||
|
||||
var calledRun: AtomicInt = 0
|
||||
var calledStop: AtomicInt = 0
|
||||
|
|
@ -38,12 +38,12 @@ class RunLoopLock {
|
|||
currentRunLoop = CFRunLoopGetCurrent()
|
||||
}
|
||||
|
||||
func dispatch(action: () -> ()) {
|
||||
CFRunLoopPerformBlock(currentRunLoop, kCFRunLoopDefaultMode) {
|
||||
func dispatch(_ action: @escaping () -> ()) {
|
||||
CFRunLoopPerformBlock(currentRunLoop, CFRunLoopMode.defaultMode.rawValue) {
|
||||
if CurrentThreadScheduler.isScheduleRequired {
|
||||
CurrentThreadScheduler.instance.schedule(()) { _ in
|
||||
_ = CurrentThreadScheduler.instance.schedule(()) { _ in
|
||||
action()
|
||||
return NopDisposable.instance
|
||||
return Disposables.create()
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -57,7 +57,7 @@ class RunLoopLock {
|
|||
if AtomicIncrement(&calledStop) != 1 {
|
||||
return
|
||||
}
|
||||
CFRunLoopPerformBlock(currentRunLoop, kCFRunLoopDefaultMode) {
|
||||
CFRunLoopPerformBlock(currentRunLoop, CFRunLoopMode.defaultMode.rawValue) {
|
||||
CFRunLoopStop(self.currentRunLoop)
|
||||
}
|
||||
CFRunLoopWakeUp(currentRunLoop)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "RxCocoa"
|
||||
s.version = "2.5.0"
|
||||
s.version = "3.0.0.alpha.1"
|
||||
s.summary = "RxSwift Cocoa extensions"
|
||||
s.description = <<-DESC
|
||||
* UI extensions
|
||||
|
|
@ -15,7 +15,7 @@ Pod::Spec.new do |s|
|
|||
s.requires_arc = true
|
||||
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.osx.deployment_target = '10.9'
|
||||
s.osx.deployment_target = '10.10'
|
||||
s.watchos.deployment_target = '2.0'
|
||||
s.tvos.deployment_target = '9.0'
|
||||
|
||||
|
|
@ -25,5 +25,5 @@ Pod::Spec.new do |s|
|
|||
s.watchos.source_files = 'RxCocoa/iOS/**/*.swift'
|
||||
s.tvos.source_files = 'RxCocoa/iOS/**/*.swift'
|
||||
|
||||
s.dependency 'RxSwift', '~> 2.5'
|
||||
s.dependency 'RxSwift', '~> 3.0.0.alpha.1'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,15 +12,15 @@ import RxSwift
|
|||
#endif
|
||||
|
||||
|
||||
extension CLLocationManager {
|
||||
extension Reactive where Base: CLLocationManager {
|
||||
|
||||
/**
|
||||
Reactive wrapper for `delegate`.
|
||||
|
||||
For more information take a look at `DelegateProxyType` protocol documentation.
|
||||
*/
|
||||
public var rx_delegate: DelegateProxy {
|
||||
return RxCLLocationManagerDelegateProxy.proxyForObject(self)
|
||||
public var delegate: DelegateProxy {
|
||||
return RxCLLocationManagerDelegateProxy.proxyForObject(base)
|
||||
}
|
||||
|
||||
// MARK: Responding to Location Events
|
||||
|
|
@ -28,8 +28,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didUpdateLocations: Observable<[CLLocation]> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didUpdateLocations:)))
|
||||
public var didUpdateLocations: Observable<[CLLocation]> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didUpdateLocations:)))
|
||||
.map { a in
|
||||
return try castOrThrow([CLLocation].self, a[1])
|
||||
}
|
||||
|
|
@ -38,8 +38,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didFailWithError: Observable<NSError> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didFailWithError:)))
|
||||
public var didFailWithError: Observable<NSError> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didFailWithError:)))
|
||||
.map { a in
|
||||
return try castOrThrow(NSError.self, a[1])
|
||||
}
|
||||
|
|
@ -49,8 +49,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didFinishDeferredUpdatesWithError: Observable<NSError?> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didFinishDeferredUpdatesWithError:)))
|
||||
public var didFinishDeferredUpdatesWithError: Observable<NSError?> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didFinishDeferredUpdatesWithError:)))
|
||||
.map { a in
|
||||
return try castOptionalOrThrow(NSError.self, a[1])
|
||||
}
|
||||
|
|
@ -64,8 +64,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didPauseLocationUpdates: Observable<Void> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManagerDidPauseLocationUpdates(_:)))
|
||||
public var didPauseLocationUpdates: Observable<Void> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManagerDidPauseLocationUpdates(_:)))
|
||||
.map { _ in
|
||||
return ()
|
||||
}
|
||||
|
|
@ -74,8 +74,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didResumeLocationUpdates: Observable<Void> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManagerDidResumeLocationUpdates(_:)))
|
||||
public var didResumeLocationUpdates: Observable<Void> {
|
||||
return delegate.observe( #selector(CLLocationManagerDelegate.locationManagerDidResumeLocationUpdates(_:)))
|
||||
.map { _ in
|
||||
return ()
|
||||
}
|
||||
|
|
@ -86,8 +86,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didUpdateHeading: Observable<CLHeading> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didUpdateHeading:)))
|
||||
public var didUpdateHeading: Observable<CLHeading> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didUpdateHeading:)))
|
||||
.map { a in
|
||||
return try castOrThrow(CLHeading.self, a[1])
|
||||
}
|
||||
|
|
@ -98,8 +98,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didEnterRegion: Observable<CLRegion> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didEnterRegion:)))
|
||||
public var didEnterRegion: Observable<CLRegion> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didEnterRegion:)))
|
||||
.map { a in
|
||||
return try castOrThrow(CLRegion.self, a[1])
|
||||
}
|
||||
|
|
@ -108,8 +108,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didExitRegion: Observable<CLRegion> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didExitRegion:)))
|
||||
public var didExitRegion: Observable<CLRegion> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didExitRegion:)))
|
||||
.map { a in
|
||||
return try castOrThrow(CLRegion.self, a[1])
|
||||
}
|
||||
|
|
@ -123,11 +123,11 @@ extension CLLocationManager {
|
|||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
@available(OSX 10.10, *)
|
||||
public var rx_didDetermineStateForRegion: Observable<(state: CLRegionState, region: CLRegion)> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didDetermineState:forRegion:)))
|
||||
public var didDetermineStateForRegion: Observable<(state: CLRegionState, region: CLRegion)> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didDetermineState:for:)))
|
||||
.map { a in
|
||||
let stateNumber = try castOrThrow(NSNumber.self, a[1])
|
||||
let state = CLRegionState(rawValue: stateNumber.integerValue) ?? CLRegionState.Unknown
|
||||
let state = CLRegionState(rawValue: stateNumber.intValue) ?? CLRegionState.unknown
|
||||
let region = try castOrThrow(CLRegion.self, a[2])
|
||||
return (state: state, region: region)
|
||||
}
|
||||
|
|
@ -136,8 +136,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_monitoringDidFailForRegionWithError: Observable<(region: CLRegion?, error: NSError)> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:monitoringDidFailForRegion:withError:)))
|
||||
public var monitoringDidFailForRegionWithError: Observable<(region: CLRegion?, error: NSError)> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:monitoringDidFailFor:withError:)))
|
||||
.map { a in
|
||||
let region = try castOptionalOrThrow(CLRegion.self, a[1])
|
||||
let error = try castOrThrow(NSError.self, a[2])
|
||||
|
|
@ -148,8 +148,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didStartMonitoringForRegion: Observable<CLRegion> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didStartMonitoringForRegion:)))
|
||||
public var didStartMonitoringForRegion: Observable<CLRegion> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didStartMonitoringFor:)))
|
||||
.map { a in
|
||||
return try castOrThrow(CLRegion.self, a[1])
|
||||
}
|
||||
|
|
@ -164,8 +164,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didRangeBeaconsInRegion: Observable<(beacons: [CLBeacon], region: CLBeaconRegion)> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didRangeBeacons:inRegion:)))
|
||||
public var didRangeBeaconsInRegion: Observable<(beacons: [CLBeacon], region: CLBeaconRegion)> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didRangeBeacons:in:)))
|
||||
.map { a in
|
||||
let beacons = try castOrThrow([CLBeacon].self, a[1])
|
||||
let region = try castOrThrow(CLBeaconRegion.self, a[2])
|
||||
|
|
@ -176,8 +176,8 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_rangingBeaconsDidFailForRegionWithError: Observable<(region: CLBeaconRegion, error: NSError)> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:rangingBeaconsDidFailForRegion:withError:)))
|
||||
public var rangingBeaconsDidFailForRegionWithError: Observable<(region: CLBeaconRegion, error: NSError)> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:rangingBeaconsDidFailFor:withError:)))
|
||||
.map { a in
|
||||
let region = try castOrThrow(CLBeaconRegion.self, a[1])
|
||||
let error = try castOrThrow(NSError.self, a[2])
|
||||
|
|
@ -191,8 +191,8 @@ extension CLLocationManager {
|
|||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
@available(iOS 8.0, *)
|
||||
public var rx_didVisit: Observable<CLVisit> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didVisit:)))
|
||||
public var didVisit: Observable<CLVisit> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didVisit:)))
|
||||
.map { a in
|
||||
return try castOrThrow(CLVisit.self, a[1])
|
||||
}
|
||||
|
|
@ -205,11 +205,11 @@ extension CLLocationManager {
|
|||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didChangeAuthorizationStatus: Observable<CLAuthorizationStatus> {
|
||||
return rx_delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didChangeAuthorizationStatus:)))
|
||||
public var didChangeAuthorizationStatus: Observable<CLAuthorizationStatus> {
|
||||
return delegate.observe(#selector(CLLocationManagerDelegate.locationManager(_:didChangeAuthorization:)))
|
||||
.map { a in
|
||||
let number = try castOrThrow(NSNumber.self, a[1])
|
||||
return CLAuthorizationStatus(rawValue: Int32(number.integerValue)) ?? .NotDetermined
|
||||
return CLAuthorizationStatus(rawValue: Int32(number.intValue)) ?? .notDetermined
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public struct ControlEvent<PropertyType> : ControlEventType {
|
|||
- parameter events: Observable sequence that represents events.
|
||||
- returns: Control event created with a observable sequence of events.
|
||||
*/
|
||||
public init<Ev: ObservableType where Ev.E == E>(events: Ev) {
|
||||
public init<Ev: ObservableType>(events: Ev) where Ev.E == E {
|
||||
_events = events.subscribeOn(ConcurrentMainScheduler.instance)
|
||||
}
|
||||
|
||||
|
|
@ -64,14 +64,14 @@ public struct ControlEvent<PropertyType> : ControlEventType {
|
|||
- parameter observer: Observer to subscribe to events.
|
||||
- returns: Disposable object that can be used to unsubscribe the observer from receiving control events.
|
||||
*/
|
||||
public func subscribe<O : ObserverType where O.E == E>(observer: O) -> Disposable {
|
||||
public func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.E == E {
|
||||
return _events.subscribe(observer)
|
||||
}
|
||||
|
||||
/**
|
||||
- returns: `Observable` interface.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asObservable() -> Observable<E> {
|
||||
return _events
|
||||
}
|
||||
|
|
@ -79,7 +79,7 @@ public struct ControlEvent<PropertyType> : ControlEventType {
|
|||
/**
|
||||
- returns: `ControlEvent` interface.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asControlEvent() -> ControlEvent<E> {
|
||||
return self
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public struct ControlProperty<PropertyType> : ControlPropertyType {
|
|||
- returns: Control property created with a observable sequence of values and an observer that enables binding values
|
||||
to property.
|
||||
*/
|
||||
public init<V: ObservableType, S: ObserverType where E == V.E, E == S.E>(values: V, valueSink: S) {
|
||||
public init<V: ObservableType, S: ObserverType>(values: V, valueSink: S) where E == V.E, E == S.E {
|
||||
_values = values.subscribeOn(ConcurrentMainScheduler.instance)
|
||||
_valueSink = valueSink.asObserver()
|
||||
}
|
||||
|
|
@ -70,14 +70,14 @@ public struct ControlProperty<PropertyType> : ControlPropertyType {
|
|||
- parameter observer: Observer to subscribe to property values.
|
||||
- returns: Disposable object that can be used to unsubscribe the observer from receiving control property values.
|
||||
*/
|
||||
public func subscribe<O : ObserverType where O.E == E>(observer: O) -> Disposable {
|
||||
public func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.E == E {
|
||||
return _values.subscribe(observer)
|
||||
}
|
||||
|
||||
/**
|
||||
- returns: `Observable` interface.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asObservable() -> Observable<E> {
|
||||
return _values
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ public struct ControlProperty<PropertyType> : ControlPropertyType {
|
|||
/**
|
||||
- returns: `ControlProperty` interface.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asControlProperty() -> ControlProperty<E> {
|
||||
return self
|
||||
}
|
||||
|
|
@ -97,13 +97,13 @@ public struct ControlProperty<PropertyType> : ControlPropertyType {
|
|||
- In case error is received, DEBUG buids raise fatal error, RELEASE builds log event to standard output.
|
||||
- In case sequence completes, nothing happens.
|
||||
*/
|
||||
public func on(event: Event<E>) {
|
||||
public func on(_ event: Event<E>) {
|
||||
switch event {
|
||||
case .Error(let error):
|
||||
case .error(let error):
|
||||
bindingErrorToInterface(error)
|
||||
case .Next:
|
||||
case .next:
|
||||
_valueSink.on(event)
|
||||
case .Completed:
|
||||
case .completed:
|
||||
_valueSink.on(event)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ extension ControlEvent {
|
|||
|
||||
`ControlEvent` already can't fail, so no special case needs to be handled.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asDriver() -> Driver<E> {
|
||||
return self.asDriver { (error) -> Driver<E> in
|
||||
#if DEBUG
|
||||
|
|
@ -27,4 +27,4 @@ extension ControlEvent {
|
|||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ extension ControlProperty {
|
|||
|
||||
`ControlProperty` already can't fail, so no special case needs to be handled.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asDriver() -> Driver<E> {
|
||||
return self.asDriver { (error) -> Driver<E> in
|
||||
#if DEBUG
|
||||
|
|
@ -27,4 +27,4 @@ extension ControlProperty {
|
|||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func zip<O1: DriverConvertibleType, O2: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, resultSelector: (O1.E, O2.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.zip(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(),
|
||||
|
|
@ -43,9 +43,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke whenever any of the sources produces an element.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func combineLatest<O1: DriverConvertibleType, O2: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, resultSelector: (O1.E, O2.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.combineLatest(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(),
|
||||
|
|
@ -67,9 +67,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func zip<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, resultSelector: (O1.E, O2.E, O3.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.zip(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(),
|
||||
|
|
@ -87,9 +87,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke whenever any of the sources produces an element.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func combineLatest<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, resultSelector: (O1.E, O2.E, O3.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.combineLatest(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(),
|
||||
|
|
@ -111,9 +111,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func zip<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: (O1.E, O2.E, O3.E, O4.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.zip(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(),
|
||||
|
|
@ -131,9 +131,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke whenever any of the sources produces an element.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func combineLatest<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: (O1.E, O2.E, O3.E, O4.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.combineLatest(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(),
|
||||
|
|
@ -155,9 +155,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func zip<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType, O5: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.zip(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(), source5.asDriver().asObservable(),
|
||||
|
|
@ -175,9 +175,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke whenever any of the sources produces an element.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func combineLatest<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType, O5: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.combineLatest(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(), source5.asDriver().asObservable(),
|
||||
|
|
@ -199,9 +199,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func zip<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType, O5: DriverConvertibleType, O6: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.zip(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(), source5.asDriver().asObservable(), source6.asDriver().asObservable(),
|
||||
|
|
@ -219,9 +219,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke whenever any of the sources produces an element.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func combineLatest<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType, O5: DriverConvertibleType, O6: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.combineLatest(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(), source5.asDriver().asObservable(), source6.asDriver().asObservable(),
|
||||
|
|
@ -243,9 +243,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func zip<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType, O5: DriverConvertibleType, O6: DriverConvertibleType, O7: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.zip(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(), source5.asDriver().asObservable(), source6.asDriver().asObservable(), source7.asDriver().asObservable(),
|
||||
|
|
@ -263,9 +263,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke whenever any of the sources produces an element.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func combineLatest<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType, O5: DriverConvertibleType, O6: DriverConvertibleType, O7: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.combineLatest(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(), source5.asDriver().asObservable(), source6.asDriver().asObservable(), source7.asDriver().asObservable(),
|
||||
|
|
@ -287,9 +287,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func zip<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType, O5: DriverConvertibleType, O6: DriverConvertibleType, O7: DriverConvertibleType, O8: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.zip(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(), source5.asDriver().asObservable(), source6.asDriver().asObservable(), source7.asDriver().asObservable(), source8.asDriver().asObservable(),
|
||||
|
|
@ -307,9 +307,9 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke whenever any of the sources produces an element.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func combineLatest<O1: DriverConvertibleType, O2: DriverConvertibleType, O3: DriverConvertibleType, O4: DriverConvertibleType, O5: DriverConvertibleType, O6: DriverConvertibleType, O7: DriverConvertibleType, O8: DriverConvertibleType>
|
||||
(source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E)
|
||||
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.combineLatest(
|
||||
source1.asDriver().asObservable(), source2.asDriver().asObservable(), source3.asDriver().asObservable(), source4.asDriver().asObservable(), source5.asDriver().asObservable(), source6.asDriver().asObservable(), source7.asDriver().asObservable(), source8.asDriver().asObservable(),
|
||||
|
|
@ -320,3 +320,4 @@ extension Driver {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public static func zip<<%= (Array(1...i).map { "O\($0): DriverConvertibleType" }).joinWithSeparator(", ") %>>
|
||||
(<%= (Array(1...i).map { "source\($0): O\($0)" }).joinWithSeparator(", _ ") %>, resultSelector: (<%= (Array(1...i).map { "O\($0).E" }).joinWithSeparator(", ") %>) throws -> E)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func zip<<%= (Array(1...i).map { "O\($0): DriverConvertibleType" }).joined(separator: ", ") %>>
|
||||
(<%= (Array(1...i).map { "_ source\($0): O\($0)" }).joined(separator: ", ") %>, resultSelector: @escaping (<%= (Array(1...i).map { "O\($0).E" }).joined(separator: ", ") %>) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.zip(
|
||||
<%= (Array(1...i).map { "source\($0).asDriver().asObservable()" }).joinWithSeparator(", ") %>,
|
||||
<%= (Array(1...i).map { "source\($0).asDriver().asObservable()" }).joined(separator: ", ") %>,
|
||||
resultSelector: resultSelector
|
||||
)
|
||||
|
||||
|
|
@ -42,12 +42,12 @@ extension Driver {
|
|||
- parameter resultSelector: Function to invoke whenever any of the sources produces an element.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public static func combineLatest<<%= (Array(1...i).map { "O\($0): DriverConvertibleType" }).joinWithSeparator(", ") %>>
|
||||
(<%= (Array(1...i).map { "source\($0): O\($0)" }).joinWithSeparator(", _ ") %>, resultSelector: (<%= (Array(1...i).map { "O\($0).E" }).joinWithSeparator(", ") %>) throws -> E)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func combineLatest<<%= (Array(1...i).map { "O\($0): DriverConvertibleType" }).joined(separator: ", ") %>>
|
||||
(<%= (Array(1...i).map { "_ source\($0): O\($0)" }).joined(separator: ", ") %>, resultSelector: @escaping (<%= (Array(1...i).map { "O\($0).E" }).joined(separator: ", ") %>) throws -> E)
|
||||
-> Driver<E> {
|
||||
let source = Observable.combineLatest(
|
||||
<%= (Array(1...i).map { "source\($0).asDriver().asObservable()" }).joinWithSeparator(", ") %>,
|
||||
<%= (Array(1...i).map { "source\($0).asDriver().asObservable()" }).joined(separator: ", ") %>,
|
||||
resultSelector: resultSelector
|
||||
)
|
||||
|
||||
|
|
@ -55,4 +55,4 @@ extension Driver {
|
|||
}
|
||||
}
|
||||
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ extension DriverConvertibleType {
|
|||
- parameter selector: A transform function to apply to each source element.
|
||||
- returns: An observable sequence whose elements are the result of invoking the transform function on each element of source.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func map<R>(selector: E -> R) -> Driver<R> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func map<R>(_ selector: @escaping (E) -> R) -> Driver<R> {
|
||||
let source = self
|
||||
.asObservable()
|
||||
.map(selector)
|
||||
|
|
@ -37,8 +37,8 @@ extension DriverConvertibleType {
|
|||
- parameter predicate: A function to test each source element for a condition.
|
||||
- returns: An observable sequence that contains elements from the input sequence that satisfy the condition.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func filter(predicate: (E) -> Bool) -> Driver<E> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func filter(_ predicate: @escaping (E) -> Bool) -> Driver<E> {
|
||||
let source = self
|
||||
.asObservable()
|
||||
.filter(predicate)
|
||||
|
|
@ -58,7 +58,7 @@ extension DriverConvertibleType where E : DriverConvertibleType {
|
|||
|
||||
- returns: The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func switchLatest() -> Driver<E.E> {
|
||||
let source: Observable<E.E> = self
|
||||
.asObservable()
|
||||
|
|
@ -80,8 +80,8 @@ extension DriverConvertibleType {
|
|||
- returns: An observable sequence whose elements are the result of invoking the transform function on each element of source producing an
|
||||
Observable of Observable sequences and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func flatMapLatest<R>(selector: (E) -> Driver<R>)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func flatMapLatest<R>(_ selector: @escaping (E) -> Driver<R>)
|
||||
-> Driver<R> {
|
||||
let source: Observable<R> = self
|
||||
.asObservable()
|
||||
|
|
@ -100,8 +100,8 @@ extension DriverConvertibleType {
|
|||
- parameter selector: A transform function to apply to element that was observed while no observable is executing in parallel.
|
||||
- returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence that was received while no other sequence was being calculated.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func flatMapFirst<R>(selector: (E) -> Driver<R>)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func flatMapFirst<R>(_ selector: @escaping (E) -> Driver<R>)
|
||||
-> Driver<R> {
|
||||
let source: Observable<R> = self
|
||||
.asObservable()
|
||||
|
|
@ -119,11 +119,12 @@ extension DriverConvertibleType {
|
|||
- parameter eventHandler: Action to invoke for each event in the observable sequence.
|
||||
- returns: The source sequence with the side-effecting behavior applied.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func doOn(eventHandler: (Event<E>) -> Void)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
@available(*, deprecated, renamed: "do(onNext:onError:onCompleted:)")
|
||||
public func doOn(_ eventHandler: @escaping (Event<E>) -> Void)
|
||||
-> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.doOn(eventHandler)
|
||||
.doOn(eventHandler)
|
||||
|
||||
return Driver(source)
|
||||
}
|
||||
|
|
@ -136,8 +137,9 @@ extension DriverConvertibleType {
|
|||
- parameter onCompleted: Action to invoke upon graceful termination of the observable sequence.
|
||||
- returns: The source sequence with the side-effecting behavior applied.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func doOn(onNext onNext: (E -> Void)? = nil, onError: (ErrorType -> Void)? = nil, onCompleted: (() -> Void)? = nil)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
@available(*, deprecated, renamed: "do(onNext:onError:onCompleted:)")
|
||||
public func doOn(onNext: ((E) -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil, onCompleted: (() -> Void)? = nil)
|
||||
-> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.doOn(onNext: onNext, onError: onError, onCompleted: onCompleted)
|
||||
|
|
@ -151,10 +153,11 @@ extension DriverConvertibleType {
|
|||
- parameter onNext: Action to invoke for each element in the observable sequence.
|
||||
- returns: The source sequence with the side-effecting behavior applied.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func doOnNext(onNext: (E -> Void))
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
@available(*, deprecated, renamed: "do(onNext:)")
|
||||
public func doOnNext(_ onNext: @escaping (E) -> Void)
|
||||
-> Driver<E> {
|
||||
return self.doOn(onNext: onNext)
|
||||
return self.do(onNext: onNext)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -163,10 +166,30 @@ extension DriverConvertibleType {
|
|||
- parameter onCompleted: Action to invoke upon graceful termination of the observable sequence.
|
||||
- returns: The source sequence with the side-effecting behavior applied.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func doOnCompleted(onCompleted: (() -> Void))
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
@available(*, deprecated, renamed: "do(onCompleted:)")
|
||||
public func doOnCompleted(_ onCompleted: @escaping () -> Void)
|
||||
-> Driver<E> {
|
||||
return self.doOn(onCompleted: onCompleted)
|
||||
return self.do(onCompleted: onCompleted)
|
||||
}
|
||||
|
||||
/**
|
||||
Invokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence.
|
||||
|
||||
- parameter onNext: Action to invoke for each element in the observable sequence.
|
||||
- parameter onError: Action to invoke upon errored termination of the observable sequence. This callback will never be invoked since driver can't error out.
|
||||
- parameter onCompleted: Action to invoke upon graceful termination of the observable sequence.
|
||||
- parameter onSubscribe: Action to invoke before subscribing to source observable sequence.
|
||||
- parameter onDispose: Action to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed.
|
||||
- returns: The source sequence with the side-effecting behavior applied.
|
||||
*/
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func `do`(onNext: ((E) -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onSubscribe: (() -> ())? = nil, onDispose: (() -> ())? = nil)
|
||||
-> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.do(onNext: onNext, onError: onError, onCompleted: onCompleted, onSubscribe: onSubscribe, onDispose: onDispose)
|
||||
|
||||
return Driver(source)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -179,8 +202,8 @@ extension DriverConvertibleType {
|
|||
- parameter identifier: Identifier that is printed together with event description to standard output.
|
||||
- returns: An observable sequence whose events are printed to standard output.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func debug(identifier: String? = nil, file: String = #file, line: UInt = #line, function: String = #function) -> Driver<E> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func debug(_ identifier: String? = nil, file: String = #file, line: UInt = #line, function: String = #function) -> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.debug(identifier, file: file, line: line, function: function)
|
||||
return Driver(source)
|
||||
|
|
@ -195,7 +218,7 @@ extension DriverConvertibleType where E: Equatable {
|
|||
|
||||
- returns: An observable sequence only containing the distinct contiguous elements, based on equality operator, from the source sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func distinctUntilChanged()
|
||||
-> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
|
|
@ -213,8 +236,8 @@ extension DriverConvertibleType {
|
|||
- parameter keySelector: A function to compute the comparison key for each element.
|
||||
- returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func distinctUntilChanged<K: Equatable>(keySelector: (E) -> K) -> Driver<E> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func distinctUntilChanged<K: Equatable>(_ keySelector: @escaping (E) -> K) -> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.distinctUntilChanged(keySelector, comparer: { $0 == $1 })
|
||||
return Driver(source)
|
||||
|
|
@ -226,8 +249,8 @@ extension DriverConvertibleType {
|
|||
- parameter comparer: Equality comparer for computed key values.
|
||||
- returns: An observable sequence only containing the distinct contiguous elements, based on `comparer`, from the source sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func distinctUntilChanged(comparer: (lhs: E, rhs: E) -> Bool) -> Driver<E> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func distinctUntilChanged(_ comparer: @escaping (E, E) -> Bool) -> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.distinctUntilChanged({ $0 }, comparer: comparer)
|
||||
return Driver(source)
|
||||
|
|
@ -240,8 +263,8 @@ extension DriverConvertibleType {
|
|||
- parameter comparer: Equality comparer for computed key values.
|
||||
- returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value and the comparer, from the source sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func distinctUntilChanged<K>(keySelector: (E) -> K, comparer: (lhs: K, rhs: K) -> Bool) -> Driver<E> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func distinctUntilChanged<K>(_ keySelector: @escaping (E) -> K, comparer: @escaping (K, K) -> Bool) -> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.distinctUntilChanged(keySelector, comparer: comparer)
|
||||
return Driver(source)
|
||||
|
|
@ -258,8 +281,8 @@ extension DriverConvertibleType {
|
|||
- parameter selector: A transform function to apply to each element.
|
||||
- returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func flatMap<R>(selector: (E) -> Driver<R>) -> Driver<R> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func flatMap<R>(_ selector: @escaping (E) -> Driver<R>) -> Driver<R> {
|
||||
let source = self.asObservable()
|
||||
.flatMap(selector)
|
||||
|
||||
|
|
@ -276,7 +299,7 @@ extension DriverConvertibleType where E : DriverConvertibleType {
|
|||
- parameter maxConcurrent: Maximum number of inner observable sequences being subscribed to concurrently.
|
||||
- returns: The observable sequence that merges the elements of the observable sequences.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func merge() -> Driver<E.E> {
|
||||
let source = self.asObservable()
|
||||
.map { $0.asDriver() }
|
||||
|
|
@ -289,8 +312,8 @@ extension DriverConvertibleType where E : DriverConvertibleType {
|
|||
|
||||
- returns: The observable sequence that merges the elements of the inner sequences.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func merge(maxConcurrent maxConcurrent: Int)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func merge(maxConcurrent: Int)
|
||||
-> Driver<E.E> {
|
||||
let source = self.asObservable()
|
||||
.map { $0.asDriver() }
|
||||
|
|
@ -310,8 +333,8 @@ extension DriverConvertibleType {
|
|||
- parameter dueTime: Throttling duration for each element.
|
||||
- returns: The throttled sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func throttle(dueTime: RxTimeInterval)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func throttle(_ dueTime: RxTimeInterval)
|
||||
-> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.throttle(dueTime, scheduler: driverObserveOnScheduler)
|
||||
|
|
@ -327,8 +350,8 @@ extension DriverConvertibleType {
|
|||
- parameter dueTime: Throttling duration for each element.
|
||||
- returns: The throttled sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func debounce(dueTime: RxTimeInterval)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func debounce(_ dueTime: RxTimeInterval)
|
||||
-> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.debounce(dueTime, scheduler: driverObserveOnScheduler)
|
||||
|
|
@ -348,8 +371,8 @@ extension DriverConvertibleType {
|
|||
- parameter accumulator: An accumulator function to be invoked on each element.
|
||||
- returns: An observable sequence containing the accumulated values.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func scan<A>(seed: A, accumulator: (A, E) -> A)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func scan<A>(_ seed: A, accumulator: @escaping (A, E) -> A)
|
||||
-> Driver<A> {
|
||||
let source = self.asObservable()
|
||||
.scan(seed, accumulator: accumulator)
|
||||
|
|
@ -358,29 +381,29 @@ extension DriverConvertibleType {
|
|||
}
|
||||
|
||||
// MARK: concat
|
||||
extension SequenceType where Generator.Element : DriverConvertibleType {
|
||||
extension Sequence where Iterator.Element : DriverConvertibleType {
|
||||
|
||||
/**
|
||||
Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully.
|
||||
|
||||
- returns: An observable sequence that contains the elements of each given sequence, in sequential order.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func concat()
|
||||
-> Driver<Generator.Element.E> {
|
||||
-> Driver<Iterator.Element.E> {
|
||||
let source = self.lazy.map { $0.asDriver().asObservable() }.concat()
|
||||
return Driver<Generator.Element.E>(source)
|
||||
return Driver<Iterator.Element.E>(source)
|
||||
}
|
||||
}
|
||||
|
||||
extension CollectionType where Generator.Element : DriverConvertibleType {
|
||||
extension Collection where Iterator.Element : DriverConvertibleType {
|
||||
|
||||
/**
|
||||
Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully.
|
||||
|
||||
- returns: An observable sequence that contains the elements of each given sequence, in sequential order.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func concat()
|
||||
-> Driver<Generator.Element.E> {
|
||||
let source = self.map { $0.asDriver().asObservable() }.concat()
|
||||
|
|
@ -389,7 +412,7 @@ extension CollectionType where Generator.Element : DriverConvertibleType {
|
|||
}
|
||||
|
||||
// MARK: zip
|
||||
extension CollectionType where Generator.Element : DriverConvertibleType {
|
||||
extension Collection where Iterator.Element : DriverConvertibleType {
|
||||
|
||||
/**
|
||||
Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
|
||||
|
|
@ -397,15 +420,15 @@ extension CollectionType where Generator.Element : DriverConvertibleType {
|
|||
- parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func zip<R>(resultSelector: [Generator.Element.E] throws -> R) -> Driver<R> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func zip<R>(_ resultSelector: @escaping ([Generator.Element.E]) throws -> R) -> Driver<R> {
|
||||
let source = self.map { $0.asDriver().asObservable() }.zip(resultSelector)
|
||||
return Driver<R>(source)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: combineLatest
|
||||
extension CollectionType where Generator.Element : DriverConvertibleType {
|
||||
extension Collection where Iterator.Element : DriverConvertibleType {
|
||||
|
||||
/**
|
||||
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
|
||||
|
|
@ -413,8 +436,8 @@ extension CollectionType where Generator.Element : DriverConvertibleType {
|
|||
- parameter resultSelector: Function to invoke whenever any of the sources produces an element.
|
||||
- returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func combineLatest<R>(resultSelector: [Generator.Element.E] throws -> R) -> Driver<R> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func combineLatest<R>(_ resultSelector: @escaping ([Generator.Element.E]) throws -> R) -> Driver<R> {
|
||||
let source = self.map { $0.asDriver().asObservable() }.combineLatest(resultSelector)
|
||||
return Driver<R>(source)
|
||||
}
|
||||
|
|
@ -430,7 +453,7 @@ extension DriverConvertibleType {
|
|||
- parameter resultSelector: Function to invoke for each element from the self combined with the latest element from the second source, if any.
|
||||
- returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function.
|
||||
*/
|
||||
public func withLatestFrom<SecondO: DriverConvertibleType, ResultType>(second: SecondO, resultSelector: (E, SecondO.E) -> ResultType) -> Driver<ResultType> {
|
||||
public func withLatestFrom<SecondO: DriverConvertibleType, ResultType>(_ second: SecondO, resultSelector: @escaping (E, SecondO.E) -> ResultType) -> Driver<ResultType> {
|
||||
let source = self.asObservable()
|
||||
.withLatestFrom(second.asDriver(), resultSelector: resultSelector)
|
||||
|
||||
|
|
@ -443,7 +466,7 @@ extension DriverConvertibleType {
|
|||
- parameter second: Second observable source.
|
||||
- returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function.
|
||||
*/
|
||||
public func withLatestFrom<SecondO: DriverConvertibleType>(second: SecondO) -> Driver<SecondO.E> {
|
||||
public func withLatestFrom<SecondO: DriverConvertibleType>(_ second: SecondO) -> Driver<SecondO.E> {
|
||||
let source = self.asObservable()
|
||||
.withLatestFrom(second.asDriver())
|
||||
|
||||
|
|
@ -462,8 +485,8 @@ extension DriverConvertibleType {
|
|||
- parameter count: The number of elements to skip before returning the remaining elements.
|
||||
- returns: An observable sequence that contains the elements that occur after the specified index in the input sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func skip(count: Int)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func skip(_ count: Int)
|
||||
-> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.skip(count)
|
||||
|
|
@ -482,12 +505,12 @@ extension DriverConvertibleType {
|
|||
- parameter element: Element to prepend to the specified sequence.
|
||||
- returns: The source sequence prepended with the specified values.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func startWith(element: E)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func startWith(_ element: E)
|
||||
-> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.startWith(element)
|
||||
|
||||
return Driver(source)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,29 +11,35 @@ import Foundation
|
|||
import RxSwift
|
||||
#endif
|
||||
|
||||
private let driverErrorMessage = "`drive*` family of methods can be only called from `MainThread`.\n" +
|
||||
"This is required to ensure that the last replayed `Driver` element is delivered on `MainThread`.\n"
|
||||
|
||||
extension DriverConvertibleType {
|
||||
/**
|
||||
Creates new subscription and sends elements to observer.
|
||||
This method can be only called from `MainThread`.
|
||||
|
||||
In this form it's equivalent to `subscribe` method, but it communicates intent better.
|
||||
|
||||
- parameter observer: Observer that receives events.
|
||||
- returns: Disposable object that can be used to unsubscribe the observer from the subject.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func drive<O: ObserverType where O.E == E>(observer: O) -> Disposable {
|
||||
MainScheduler.ensureExecutingOnScheduler()
|
||||
// @warn_unused_result(message:"http://git.io/rxs.ud")
|
||||
public func drive<O: ObserverType>(_ observer: O) -> Disposable where O.E == E {
|
||||
MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage)
|
||||
return self.asObservable().subscribe(observer)
|
||||
}
|
||||
|
||||
/**
|
||||
Creates new subscription and sends elements to variable.
|
||||
This method can be only called from `MainThread`.
|
||||
|
||||
- parameter variable: Target variable for sequence elements.
|
||||
- returns: Disposable object that can be used to unsubscribe the observer from the variable.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func drive(variable: Variable<E>) -> Disposable {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.ud")
|
||||
public func drive(_ variable: Variable<E>) -> Disposable {
|
||||
MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage)
|
||||
return drive(onNext: { e in
|
||||
variable.value = e
|
||||
})
|
||||
|
|
@ -41,13 +47,14 @@ extension DriverConvertibleType {
|
|||
|
||||
/**
|
||||
Subscribes to observable sequence using custom binder function.
|
||||
This method can be only called from `MainThread`.
|
||||
|
||||
- parameter with: Function used to bind elements from `self`.
|
||||
- returns: Object representing subscription.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func drive<R>(transformation: Observable<E> -> R) -> R {
|
||||
MainScheduler.ensureExecutingOnScheduler()
|
||||
// @warn_unused_result(message:"http://git.io/rxs.ud")
|
||||
public func drive<R>(_ transformation: (Observable<E>) -> R) -> R {
|
||||
MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage)
|
||||
return transformation(self.asObservable())
|
||||
}
|
||||
|
||||
|
|
@ -59,18 +66,21 @@ extension DriverConvertibleType {
|
|||
return with(self)(curriedArgument)
|
||||
}
|
||||
|
||||
This method can be only called from `MainThread`.
|
||||
|
||||
- parameter with: Function used to bind elements from `self`.
|
||||
- parameter curriedArgument: Final argument passed to `binder` to finish binding process.
|
||||
- returns: Object representing subscription.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func drive<R1, R2>(with: Observable<E> -> R1 -> R2, curriedArgument: R1) -> R2 {
|
||||
MainScheduler.ensureExecutingOnScheduler()
|
||||
// @warn_unused_result(message:"http://git.io/rxs.ud")
|
||||
public func drive<R1, R2>(_ with: (Observable<E>) -> (R1) -> R2, curriedArgument: R1) -> R2 {
|
||||
MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage)
|
||||
return with(self.asObservable())(curriedArgument)
|
||||
}
|
||||
|
||||
/**
|
||||
Subscribes an element handler, a completion handler and disposed handler to an observable sequence.
|
||||
This method can be only called from `MainThread`.
|
||||
|
||||
Error callback is not exposed because `Driver` can't error out.
|
||||
|
||||
|
|
@ -81,22 +91,24 @@ extension DriverConvertibleType {
|
|||
gracefully completed, errored, or if the generation is cancelled by disposing subscription)
|
||||
- returns: Subscription object used to unsubscribe from the observable sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func drive(onNext onNext: ((E) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) -> Disposable {
|
||||
MainScheduler.ensureExecutingOnScheduler()
|
||||
// @warn_unused_result(message:"http://git.io/rxs.ud")
|
||||
public func drive(onNext: ((E) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) -> Disposable {
|
||||
MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage)
|
||||
return self.asObservable().subscribe(onNext: onNext, onCompleted: onCompleted, onDisposed: onDisposed)
|
||||
}
|
||||
|
||||
/**
|
||||
Subscribes an element handler to an observable sequence.
|
||||
This method can be only called from `MainThread`.
|
||||
|
||||
- parameter onNext: Action to invoke for each element in the observable sequence.
|
||||
- returns: Subscription object used to unsubscribe from the observable sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func driveNext(onNext: E -> Void) -> Disposable {
|
||||
MainScheduler.ensureExecutingOnScheduler()
|
||||
return self.asObservable().subscribeNext(onNext)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.ud")
|
||||
@available(*, deprecated, renamed: "drive(onNext:)")
|
||||
public func driveNext(_ onNext: @escaping (E) -> Void) -> Disposable {
|
||||
MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage)
|
||||
return self.asObservable().subscribe(onNext: onNext)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ public protocol DriverConvertibleType : ObservableConvertibleType {
|
|||
/**
|
||||
Converts self to `Driver`.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
func asDriver() -> Driver<E>
|
||||
}
|
||||
|
||||
extension DriverConvertibleType {
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asObservable() -> Observable<E> {
|
||||
return asDriver().asObservable()
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ public struct Driver<Element> : DriverConvertibleType {
|
|||
/**
|
||||
- returns: Built observable sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asObservable() -> Observable<E> {
|
||||
return _source
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ public struct Driver<Element> : DriverConvertibleType {
|
|||
/**
|
||||
- returns: `self`
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asDriver() -> Driver<E> {
|
||||
return self
|
||||
}
|
||||
|
|
@ -97,9 +97,9 @@ extension Driver {
|
|||
|
||||
- returns: An observable sequence with no elements.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func empty() -> Driver<E> {
|
||||
return Driver(raw: Observable.empty().subscribeOn(driverSubscribeOnScheduler))
|
||||
return Driver(Observable.empty().subscribeOn(driverSubscribeOnScheduler))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -107,9 +107,9 @@ extension Driver {
|
|||
|
||||
- returns: An observable sequence whose observers will never get called.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func never() -> Driver<E> {
|
||||
return Driver(raw: Observable.never().subscribeOn(driverSubscribeOnScheduler))
|
||||
return Driver(Observable.never().subscribeOn(driverSubscribeOnScheduler))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -118,9 +118,9 @@ extension Driver {
|
|||
- parameter element: Single element in the resulting observable sequence.
|
||||
- returns: An observable sequence containing the single specified element.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public static func just(element: E) -> Driver<E> {
|
||||
return Driver(raw: Observable.just(element).subscribeOn(driverSubscribeOnScheduler))
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func just(_ element: E) -> Driver<E> {
|
||||
return Driver(Observable.just(element).subscribeOn(driverSubscribeOnScheduler))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -129,8 +129,8 @@ extension Driver {
|
|||
- parameter observableFactory: Observable factory function to invoke for each observer that subscribes to the resulting sequence.
|
||||
- returns: An observable sequence whose observers trigger an invocation of the given observable factory function.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public static func deferred(observableFactory: () -> Driver<E>)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func deferred(_ observableFactory: @escaping () -> Driver<E>)
|
||||
-> Driver<E> {
|
||||
return Driver(Observable.deferred { observableFactory().asObservable() })
|
||||
}
|
||||
|
|
@ -143,14 +143,14 @@ extension Driver {
|
|||
- parameter elements: Elements to generate.
|
||||
- returns: The observable sequence whose elements are pulled from the given arguments.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public static func of(elements: E ...) -> Driver<E> {
|
||||
let source = elements.toObservable(driverSubscribeOnScheduler)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func of(_ elements: E ...) -> Driver<E> {
|
||||
let source = Observable.from(elements, scheduler: driverSubscribeOnScheduler)
|
||||
return Driver(raw: source)
|
||||
}
|
||||
}
|
||||
|
||||
extension Driver where Element : SignedIntegerType {
|
||||
extension Driver where Element : SignedInteger {
|
||||
/**
|
||||
Returns an observable sequence that produces a value after each period, using the specified scheduler to run timers and to send out observer messages.
|
||||
|
||||
|
|
@ -159,8 +159,8 @@ extension Driver where Element : SignedIntegerType {
|
|||
- parameter period: Period for producing the values in the resulting sequence.
|
||||
- returns: An observable sequence that produces a value after each period.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public static func interval(period: RxTimeInterval)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func interval(_ period: RxTimeInterval)
|
||||
-> Driver<E> {
|
||||
return Driver(Observable.interval(period, scheduler: driverObserveOnScheduler))
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ extension Driver where Element : SignedIntegerType {
|
|||
|
||||
// MARK: timer
|
||||
|
||||
extension Driver where Element: SignedIntegerType {
|
||||
extension Driver where Element: SignedInteger {
|
||||
/**
|
||||
Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed, using the specified scheduler to run timers.
|
||||
|
||||
|
|
@ -178,8 +178,8 @@ extension Driver where Element: SignedIntegerType {
|
|||
- parameter period: Period to produce subsequent values.
|
||||
- returns: An observable sequence that produces a value after due time has elapsed and then each period.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public static func timer(dueTime: RxTimeInterval, period: RxTimeInterval)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public static func timer(_ dueTime: RxTimeInterval, period: RxTimeInterval)
|
||||
-> Driver<E> {
|
||||
return Driver(Observable.timer(dueTime, period: period, scheduler: driverObserveOnScheduler))
|
||||
}
|
||||
|
|
@ -187,11 +187,11 @@ extension Driver where Element: SignedIntegerType {
|
|||
|
||||
/**
|
||||
This method can be used in unit tests to ensure that driver is using mock schedulers instead of
|
||||
maind schedulers.
|
||||
main schedulers.
|
||||
|
||||
**This shouldn't be used in normal release builds.**
|
||||
*/
|
||||
public func driveOnScheduler(scheduler: SchedulerType, action: () -> ()) {
|
||||
public func driveOnScheduler(_ scheduler: SchedulerType, action: () -> ()) {
|
||||
let originalObserveOnScheduler = driverObserveOnScheduler
|
||||
let originalSubscribeOnScheduler = driverSubscribeOnScheduler
|
||||
|
||||
|
|
@ -209,9 +209,9 @@ public func driveOnScheduler(scheduler: SchedulerType, action: () -> ()) {
|
|||
driverSubscribeOnScheduler = originalSubscribeOnScheduler
|
||||
}
|
||||
|
||||
func _forceCompilerToStopDoingInsaneOptimizationsThatBreakCode(scheduler: SchedulerType) {
|
||||
func _forceCompilerToStopDoingInsaneOptimizationsThatBreakCode(_ scheduler: SchedulerType) {
|
||||
let a: Int32 = 1
|
||||
let b = 314 + Int32(rand() & 1)
|
||||
let b = 314 + Int32(arc4random() & 1)
|
||||
if a == b {
|
||||
print(scheduler)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ extension ObservableConvertibleType {
|
|||
- parameter onErrorJustReturn: Element to return in case of error and after that complete the sequence.
|
||||
- returns: Driving observable sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func asDriver(onErrorJustReturn onErrorJustReturn: E) -> Driver<E> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asDriver(onErrorJustReturn: E) -> Driver<E> {
|
||||
let source = self
|
||||
.asObservable()
|
||||
.observeOn(driverObserveOnScheduler)
|
||||
|
|
@ -33,8 +33,8 @@ extension ObservableConvertibleType {
|
|||
- parameter onErrorDriveWith: Driver that continues to drive the sequence in case of error.
|
||||
- returns: Driving observable sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func asDriver(onErrorDriveWith onErrorDriveWith: Driver<E>) -> Driver<E> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asDriver(onErrorDriveWith: Driver<E>) -> Driver<E> {
|
||||
let source = self
|
||||
.asObservable()
|
||||
.observeOn(driverObserveOnScheduler)
|
||||
|
|
@ -50,14 +50,14 @@ extension ObservableConvertibleType {
|
|||
- parameter onErrorRecover: Calculates driver that continues to drive the sequence in case of error.
|
||||
- returns: Driving observable sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func asDriver(onErrorRecover onErrorRecover: (error: ErrorType) -> Driver<E>) -> Driver<E> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asDriver(onErrorRecover: @escaping (_ error: Swift.Error) -> Driver<E>) -> Driver<E> {
|
||||
let source = self
|
||||
.asObservable()
|
||||
.observeOn(driverObserveOnScheduler)
|
||||
.catchError { error in
|
||||
onErrorRecover(error: error).asObservable()
|
||||
onErrorRecover(error).asObservable()
|
||||
}
|
||||
return Driver(source)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ extension Variable {
|
|||
|
||||
- returns: Driving observable sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func asDriver() -> Driver<E> {
|
||||
let source = self.asObservable()
|
||||
.observeOn(driverObserveOnScheduler)
|
||||
return Driver(source)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
public class UIBindingObserver<UIElementType, Value where UIElementType: AnyObject> : ObserverType {
|
||||
public class UIBindingObserver<UIElementType, Value> : ObserverType where UIElementType: AnyObject {
|
||||
public typealias E = Value
|
||||
|
||||
weak var UIElement: UIElementType?
|
||||
|
|
@ -28,7 +28,7 @@ public class UIBindingObserver<UIElementType, Value where UIElementType: AnyObje
|
|||
/**
|
||||
Initializes `ViewBindingObserver` using
|
||||
*/
|
||||
public init(UIElement: UIElementType, binding: (UIElementType, Value) -> Void) {
|
||||
public init(UIElement: UIElementType, binding: @escaping (UIElementType, Value) -> Void) {
|
||||
self.UIElement = UIElement
|
||||
self.binding = binding
|
||||
}
|
||||
|
|
@ -36,17 +36,17 @@ public class UIBindingObserver<UIElementType, Value where UIElementType: AnyObje
|
|||
/**
|
||||
Binds next element to owner view as described in `binding`.
|
||||
*/
|
||||
public func on(event: Event<Value>) {
|
||||
MainScheduler.ensureExecutingOnScheduler()
|
||||
public func on(_ event: Event<Value>) {
|
||||
MainScheduler.ensureExecutingOnScheduler(errorMessage: "Element can be bound to user interface only on MainThread.")
|
||||
|
||||
switch event {
|
||||
case .Next(let element):
|
||||
case .next(let element):
|
||||
if let view = self.UIElement {
|
||||
binding(view, element)
|
||||
}
|
||||
case .Error(let error):
|
||||
case .error(let error):
|
||||
bindingErrorToInterface(error)
|
||||
case .Completed:
|
||||
case .completed:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Base class for `DelegateProxyType` protocol.
|
|||
|
||||
This implementation is not thread safe and can be used only from one thread (Main thread).
|
||||
*/
|
||||
public class DelegateProxy : _RXDelegateProxy {
|
||||
open class DelegateProxy : _RXDelegateProxy {
|
||||
|
||||
private var subjectsForSelector = [Selector: PublishSubject<[AnyObject]>]()
|
||||
|
||||
|
|
@ -66,15 +66,15 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
let internalSubject = PublishSubject<CGPoint>
|
||||
|
||||
public func requiredDelegateMethod(scrollView: UIScrollView, arg1: CGPoint) -> Bool {
|
||||
internalSubject.on(.Next(arg1))
|
||||
internalSubject.on(.next(arg1))
|
||||
return self._forwardToDelegate?.requiredDelegateMethod?(scrollView, arg1: arg1) ?? defaultReturnValue
|
||||
}
|
||||
|
||||
....
|
||||
|
||||
// reactive property implementation in a real class (`UIScrollView`)
|
||||
public var rx_property: Observable<CGPoint> {
|
||||
let proxy = RxScrollViewDelegateProxy.proxyForObject(self)
|
||||
public var property: Observable<CGPoint> {
|
||||
let proxy = RxScrollViewDelegateProxy.proxyForObject(base)
|
||||
return proxy.internalSubject.asObservable()
|
||||
}
|
||||
|
||||
|
|
@ -85,12 +85,12 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
- parameter selector: Selector used to filter observed invocations of delegate methods.
|
||||
- returns: Observable sequence of arguments passed to `selector` method.
|
||||
*/
|
||||
public func observe(selector: Selector) -> Observable<[AnyObject]> {
|
||||
if hasWiredImplementationForSelector(selector) {
|
||||
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.")
|
||||
}
|
||||
|
||||
if !self.respondsToSelector(selector) {
|
||||
if !self.responds(to: selector) {
|
||||
rxFatalError("This class doesn't respond to selector \(selector)")
|
||||
}
|
||||
|
||||
|
|
@ -108,8 +108,8 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
|
||||
// proxy
|
||||
|
||||
public override func interceptedSelector(selector: Selector, withArguments arguments: [AnyObject]!) {
|
||||
subjectsForSelector[selector]?.on(.Next(arguments))
|
||||
open override func interceptedSelector(_ selector: Selector, withArguments arguments: [Any]) {
|
||||
subjectsForSelector[selector]?.on(.next(arguments as [AnyObject]))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -117,7 +117,7 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
|
||||
- returns: Associated object tag.
|
||||
*/
|
||||
public class func delegateAssociatedObjectTag() -> UnsafePointer<Void> {
|
||||
public class func delegateAssociatedObjectTag() -> UnsafeRawPointer {
|
||||
return _pointer(&delegateAssociatedTag)
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
|
||||
- returns: Initialized instance of `self`.
|
||||
*/
|
||||
public class func createProxyForObject(object: AnyObject) -> AnyObject {
|
||||
public class func createProxyForObject(_ object: AnyObject) -> AnyObject {
|
||||
return self.init(parentObject: object)
|
||||
}
|
||||
|
||||
|
|
@ -136,9 +136,9 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
- parameter object: Object that can have assigned delegate proxy.
|
||||
- returns: Assigned delegate proxy or `nil` if no delegate proxy is assigned.
|
||||
*/
|
||||
public class func assignedProxyFor(object: AnyObject) -> AnyObject? {
|
||||
let maybeDelegate: AnyObject? = objc_getAssociatedObject(object, self.delegateAssociatedObjectTag())
|
||||
return castOptionalOrFatalError(maybeDelegate)
|
||||
public class func assignedProxyFor(_ object: AnyObject) -> AnyObject? {
|
||||
let maybeDelegate = objc_getAssociatedObject(object, self.delegateAssociatedObjectTag())
|
||||
return castOptionalOrFatalError(maybeDelegate.map { $0 as AnyObject })
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -147,8 +147,8 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
- parameter object: Object that can have assigned delegate proxy.
|
||||
- parameter proxy: Delegate proxy object to assign to `object`.
|
||||
*/
|
||||
public class func assignProxy(proxy: AnyObject, toObject object: AnyObject) {
|
||||
precondition(proxy.isKindOfClass(self.classForCoder()))
|
||||
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,8 +160,8 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
- parameter forwardToDelegate: Reference of delegate that receives all messages through `self`.
|
||||
- parameter retainDelegate: Should `self` retain `forwardToDelegate`.
|
||||
*/
|
||||
public func setForwardToDelegate(delegate: AnyObject?, retainDelegate: Bool) {
|
||||
self._setForwardToDelegate(delegate, retainDelegate: retainDelegate)
|
||||
public func setForwardToDelegate(_ delegate: AnyObject?, retainDelegate: Bool) {
|
||||
self._setForward(toDelegate: delegate, retainDelegate: retainDelegate)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -176,7 +176,7 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
|
||||
deinit {
|
||||
for v in subjectsForSelector.values {
|
||||
v.on(.Completed)
|
||||
v.on(.completed)
|
||||
}
|
||||
#if TRACE_RESOURCES
|
||||
OSAtomicDecrement32(&resourceCount)
|
||||
|
|
@ -185,7 +185,7 @@ public class DelegateProxy : _RXDelegateProxy {
|
|||
|
||||
// MARK: Pointer
|
||||
|
||||
class func _pointer(p: UnsafePointer<Void>) -> UnsafePointer<Void> {
|
||||
class func _pointer(_ p: UnsafeRawPointer) -> UnsafeRawPointer {
|
||||
return p
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ every view has a corresponding delegate virtual factory method.
|
|||
In case of UITableView / UIScrollView, there is
|
||||
|
||||
extension UIScrollView {
|
||||
public func rx_createDelegateProxy() -> RxScrollViewDelegateProxy {
|
||||
return RxScrollViewDelegateProxy(parentObject: self)
|
||||
public func createRxDelegateProxy() -> RxScrollViewDelegateProxy {
|
||||
return RxScrollViewDelegateProxy(parentObject: base)
|
||||
}
|
||||
....
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ In case of UITableView / UIScrollView, there is
|
|||
and override in UITableView
|
||||
|
||||
extension UITableView {
|
||||
public override func rx_createDelegateProxy() -> RxScrollViewDelegateProxy {
|
||||
public override func createRxDelegateProxy() -> RxScrollViewDelegateProxy {
|
||||
....
|
||||
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ public protocol DelegateProxyType : AnyObject {
|
|||
/**
|
||||
Creates new proxy for target object.
|
||||
*/
|
||||
static func createProxyForObject(object: AnyObject) -> AnyObject
|
||||
static func createProxyForObject(_ object: AnyObject) -> AnyObject
|
||||
|
||||
/**
|
||||
Returns assigned proxy for object.
|
||||
|
|
@ -95,7 +95,7 @@ public protocol DelegateProxyType : AnyObject {
|
|||
- parameter object: Object that can have assigned delegate proxy.
|
||||
- returns: Assigned delegate proxy or `nil` if no delegate proxy is assigned.
|
||||
*/
|
||||
static func assignedProxyFor(object: AnyObject) -> AnyObject?
|
||||
static func assignedProxyFor(_ object: AnyObject) -> AnyObject?
|
||||
|
||||
/**
|
||||
Assigns proxy to object.
|
||||
|
|
@ -103,7 +103,7 @@ public protocol DelegateProxyType : AnyObject {
|
|||
- parameter object: Object that can have assigned delegate proxy.
|
||||
- parameter proxy: Delegate proxy object to assign to `object`.
|
||||
*/
|
||||
static func assignProxy(proxy: AnyObject, toObject object: AnyObject)
|
||||
static func assignProxy(_ proxy: AnyObject, toObject object: AnyObject)
|
||||
|
||||
/**
|
||||
Returns designated delegate property for object.
|
||||
|
|
@ -115,7 +115,7 @@ public protocol DelegateProxyType : AnyObject {
|
|||
- parameter object: Object that has delegate property.
|
||||
- returns: Value of delegate property.
|
||||
*/
|
||||
static func currentDelegateFor(object: AnyObject) -> AnyObject?
|
||||
static func currentDelegateFor(_ object: AnyObject) -> AnyObject?
|
||||
|
||||
/**
|
||||
Sets designated delegate property for object.
|
||||
|
|
@ -127,7 +127,7 @@ public protocol DelegateProxyType : AnyObject {
|
|||
- parameter toObject: Object that has delegate property.
|
||||
- parameter delegate: Delegate value.
|
||||
*/
|
||||
static func setCurrentDelegate(delegate: AnyObject?, toObject object: AnyObject)
|
||||
static func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject)
|
||||
|
||||
/**
|
||||
Returns reference of normal delegate that receives all forwarded messages
|
||||
|
|
@ -144,11 +144,11 @@ public protocol DelegateProxyType : AnyObject {
|
|||
- parameter forwardToDelegate: Reference of delegate that receives all messages through `self`.
|
||||
- parameter retainDelegate: Should `self` retain `forwardToDelegate`.
|
||||
*/
|
||||
func setForwardToDelegate(forwardToDelegate: AnyObject?, retainDelegate: Bool)
|
||||
func setForwardToDelegate(_ forwardToDelegate: AnyObject?, retainDelegate: Bool)
|
||||
}
|
||||
|
||||
@available(*, deprecated=2.5, renamed="DelegateProxyType.proxyForObject", message="You can just use normal static protocol extension. E.g. `RxScrollViewDelegateProxy.proxyForObject`")
|
||||
public func proxyForObject<P: DelegateProxyType>(type: P.Type, _ object: AnyObject) -> P {
|
||||
@available(*, deprecated:2.5, renamed:"DelegateProxyType.proxyForObject", message:"You can just use normal static protocol extension. E.g. `RxScrollViewDelegateProxy.proxyForObject`")
|
||||
public func proxyForObject<P: DelegateProxyType>(_ type: P.Type, _ object: AnyObject) -> P {
|
||||
return P.proxyForObject(object)
|
||||
}
|
||||
|
||||
|
|
@ -160,37 +160,38 @@ extension DelegateProxyType {
|
|||
- returns: Installed instance of delegate proxy.
|
||||
|
||||
|
||||
extension UISearchBar {
|
||||
extension Reactive where Base: UISearchBar {
|
||||
|
||||
public var rx_delegate: DelegateProxy {
|
||||
return RxSearchBarDelegateProxy.proxyForObject(self)
|
||||
public var delegate: DelegateProxy {
|
||||
return RxSearchBarDelegateProxy.proxyForObject(base)
|
||||
}
|
||||
|
||||
public var rx_text: ControlProperty<String> {
|
||||
let source: Observable<String> = self.rx_delegate.observe(#selector(UISearchBarDelegate.searchBar(_:textDidChange:)))
|
||||
public var text: ControlProperty<String> {
|
||||
let source: Observable<String> = self.delegate.observe(#selector(UISearchBarDelegate.searchBar(_:textDidChange:)))
|
||||
...
|
||||
}
|
||||
}
|
||||
*/
|
||||
public static func proxyForObject(object: AnyObject) -> Self {
|
||||
public static func proxyForObject(_ object: AnyObject) -> Self {
|
||||
MainScheduler.ensureExecutingOnScheduler()
|
||||
|
||||
let maybeProxy = Self.assignedProxyFor(object) as? Self
|
||||
|
||||
let proxy: Self
|
||||
if maybeProxy == nil {
|
||||
if let existingProxy = maybeProxy {
|
||||
proxy = existingProxy
|
||||
}
|
||||
else {
|
||||
proxy = Self.createProxyForObject(object) as! Self
|
||||
Self.assignProxy(proxy, toObject: object)
|
||||
assert(Self.assignedProxyFor(object) === proxy)
|
||||
}
|
||||
else {
|
||||
proxy = maybeProxy!
|
||||
}
|
||||
|
||||
let currentDelegate: AnyObject? = Self.currentDelegateFor(object)
|
||||
|
||||
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)
|
||||
|
|
@ -208,7 +209,7 @@ extension DelegateProxyType {
|
|||
- parameter onProxyForObject: Object that has `delegate` property.
|
||||
- returns: Disposable object that can be used to clear forward delegate.
|
||||
*/
|
||||
public static func installForwardDelegate(forwardDelegate: AnyObject, retainDelegate: Bool, onProxyForObject object: AnyObject) -> Disposable {
|
||||
public static func installForwardDelegate(_ forwardDelegate: AnyObject, retainDelegate: Bool, onProxyForObject object: AnyObject) -> Disposable {
|
||||
weak var weakForwardDelegate: AnyObject? = forwardDelegate
|
||||
|
||||
let proxy = Self.proxyForObject(object)
|
||||
|
|
@ -226,9 +227,9 @@ 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 AnonymousDisposable {
|
||||
return Disposables.create {
|
||||
MainScheduler.ensureExecutingOnScheduler()
|
||||
|
||||
let delegate: AnyObject? = weakForwardDelegate
|
||||
|
|
@ -241,13 +242,17 @@ extension DelegateProxyType {
|
|||
}
|
||||
|
||||
extension ObservableType {
|
||||
func subscribeProxyDataSourceForObject<P: DelegateProxyType>(object: AnyObject, dataSource: AnyObject, retainDataSource: Bool, binding: (P, Event<E>) -> Void)
|
||||
func subscribeProxyDataSource<P: DelegateProxyType>(ofObject object: AnyObject, dataSource: AnyObject, retainDataSource: Bool, binding: @escaping (P, Event<E>) -> Void)
|
||||
-> Disposable {
|
||||
let proxy = P.proxyForObject(object)
|
||||
let disposable = P.installForwardDelegate(dataSource, retainDelegate: retainDataSource, onProxyForObject: object)
|
||||
|
||||
let subscription = self.asObservable()
|
||||
// source can never end, otherwise it would release the subscriber
|
||||
.catchError { error in
|
||||
bindingErrorToInterface(error)
|
||||
return Observable.empty()
|
||||
}
|
||||
// source can never end, otherwise it would release the subscriber, and deallocate the data source
|
||||
.concat(Observable.never())
|
||||
.subscribe { [weak object] (event: Event<E>) in
|
||||
MainScheduler.ensureExecutingOnScheduler()
|
||||
|
|
@ -259,16 +264,16 @@ extension ObservableType {
|
|||
binding(proxy, event)
|
||||
|
||||
switch event {
|
||||
case .Error(let error):
|
||||
case .error(let error):
|
||||
bindingErrorToInterface(error)
|
||||
disposable.dispose()
|
||||
case .Completed:
|
||||
case .completed:
|
||||
disposable.dispose()
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return StableCompositeDisposable.create(subscription, disposable)
|
||||
return Disposables.create(subscription, disposable)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ extension Int : KVORepresentable {
|
|||
Constructs `Self` using KVO value.
|
||||
*/
|
||||
public init?(KVOValue: KVOType) {
|
||||
self.init(KVOValue.integerValue)
|
||||
self.init(KVOValue.int32Value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ extension Int32 : KVORepresentable {
|
|||
Constructs `Self` using KVO value.
|
||||
*/
|
||||
public init?(KVOValue: KVOType) {
|
||||
self.init(KVOValue.intValue)
|
||||
self.init(KVOValue.int32Value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ extension Int64 : KVORepresentable {
|
|||
Constructs `Self` using KVO value.
|
||||
*/
|
||||
public init?(KVOValue: KVOType) {
|
||||
self.init(KVOValue.longLongValue)
|
||||
self.init(KVOValue.int64Value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ extension UInt : KVORepresentable {
|
|||
Constructs `Self` using KVO value.
|
||||
*/
|
||||
public init?(KVOValue: KVOType) {
|
||||
self.init(KVOValue.unsignedLongValue)
|
||||
self.init(KVOValue.uintValue)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ extension UInt32 : KVORepresentable {
|
|||
Constructs `Self` using KVO value.
|
||||
*/
|
||||
public init?(KVOValue: KVOType) {
|
||||
self.init(KVOValue.unsignedIntValue)
|
||||
self.init(KVOValue.uint32Value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ extension UInt64 : KVORepresentable {
|
|||
Constructs `Self` using KVO value.
|
||||
*/
|
||||
public init?(KVOValue: KVOType) {
|
||||
self.init(KVOValue.unsignedLongLongValue)
|
||||
self.init(KVOValue.uint64Value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -90,4 +90,4 @@ extension RawRepresentable where RawValue: KVORepresentable {
|
|||
|
||||
self.init(rawValue: rawValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import Foundation
|
|||
Simple logging settings for RxCocoa library.
|
||||
*/
|
||||
public struct Logging {
|
||||
public typealias LogURLRequest = (NSURLRequest) -> Bool
|
||||
public typealias LogURLRequest = (URLRequest) -> Bool
|
||||
|
||||
/**
|
||||
Log URL requests to standard output in curl format.
|
||||
|
|
@ -24,4 +24,4 @@ public struct Logging {
|
|||
return false
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ import RxSwift
|
|||
#endif
|
||||
|
||||
#if os(iOS) || os(OSX) || os(tvOS)
|
||||
extension NSLayoutConstraint {
|
||||
extension Reactive where Base: NSLayoutConstraint {
|
||||
/**
|
||||
Bindable sink for `constant` property.
|
||||
*/
|
||||
public var rx_constant: AnyObserver<CGFloat> {
|
||||
return UIBindingObserver(UIElement: self) { constraint, constant in
|
||||
public var constant: AnyObserver<CGFloat> {
|
||||
return UIBindingObserver(UIElement: self.base) { constraint, constant in
|
||||
constraint.constant = constant
|
||||
}.asObserver()
|
||||
}
|
||||
|
|
@ -33,9 +33,9 @@ extension NSLayoutConstraint {
|
|||
Bindable sink for `active` property.
|
||||
*/
|
||||
@available(iOS 8, OSX 10.10, *)
|
||||
public var rx_active: AnyObserver<Bool> {
|
||||
return UIBindingObserver(UIElement: self) { constraint, value in
|
||||
constraint.active = value
|
||||
public var active: AnyObserver<Bool> {
|
||||
return UIBindingObserver(UIElement: self.base) { constraint, value in
|
||||
constraint.isActive = value
|
||||
}.asObserver()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ extension ObservableType {
|
|||
- parameter observer: Observer that receives events.
|
||||
- returns: Disposable object that can be used to unsubscribe the observer.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func bindTo<O: ObserverType where O.E == E>(observer: O) -> Disposable {
|
||||
// @warn_unused_result(message: "http://git.io/rxs.ud")
|
||||
public func bindTo<O: ObserverType>(_ observer: O) -> Disposable where O.E == E {
|
||||
return self.subscribe(observer)
|
||||
}
|
||||
|
||||
|
|
@ -36,20 +36,20 @@ extension ObservableType {
|
|||
- parameter variable: Target variable for sequence elements.
|
||||
- returns: Disposable object that can be used to unsubscribe the observer.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func bindTo(variable: Variable<E>) -> Disposable {
|
||||
// @warn_unused_result(message: "http://git.io/rxs.ud")
|
||||
public func bindTo(_ variable: Variable<E>) -> Disposable {
|
||||
return subscribe { e in
|
||||
switch e {
|
||||
case let .Next(element):
|
||||
case let .next(element):
|
||||
variable.value = element
|
||||
case let .Error(error):
|
||||
case let .error(error):
|
||||
let error = "Binding error to variable: \(error)"
|
||||
#if DEBUG
|
||||
rxFatalError(error)
|
||||
#else
|
||||
print(error)
|
||||
#endif
|
||||
case .Completed:
|
||||
case .completed:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -61,8 +61,8 @@ extension ObservableType {
|
|||
- parameter binder: Function used to bind elements from `self`.
|
||||
- returns: Object representing subscription.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func bindTo<R>(binder: Self -> R) -> R {
|
||||
// @warn_unused_result(message: "http://git.io/rxs.ud")
|
||||
public func bindTo<R>(_ binder: (Self) -> R) -> R {
|
||||
return binder(self)
|
||||
}
|
||||
|
||||
|
|
@ -78,8 +78,8 @@ extension ObservableType {
|
|||
- parameter curriedArgument: Final argument passed to `binder` to finish binding process.
|
||||
- returns: Object representing subscription.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func bindTo<R1, R2>(binder: Self -> R1 -> R2, curriedArgument: R1) -> R2 {
|
||||
// @warn_unused_result(message: "http://git.io/rxs.ud")
|
||||
public func bindTo<R1, R2>(_ binder: (Self) -> (R1) -> R2, curriedArgument: R1) -> R2 {
|
||||
return binder(self)(curriedArgument)
|
||||
}
|
||||
|
||||
|
|
@ -93,8 +93,8 @@ extension ObservableType {
|
|||
- parameter onNext: Action to invoke for each element in the observable sequence.
|
||||
- returns: Subscription object used to unsubscribe from the observable sequence.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func bindNext(onNext: E -> Void) -> Disposable {
|
||||
// @warn_unused_result(message: "http://git.io/rxs.ud")
|
||||
public func bindNext(_ onNext: @escaping (E) -> Void) -> Disposable {
|
||||
return subscribe(onNext: onNext, onError: { error in
|
||||
let error = "Binding error: \(error)"
|
||||
#if DEBUG
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ class ControlTarget: RxTarget {
|
|||
|
||||
super.init()
|
||||
|
||||
control.addTarget(self, action: selector, forControlEvents: controlEvents)
|
||||
control.addTarget(self, action: selector, for: controlEvents)
|
||||
|
||||
let method = self.methodForSelector(selector)
|
||||
let method = self.method(for: selector)
|
||||
if method == nil {
|
||||
rxFatalError("Can't find method")
|
||||
}
|
||||
|
|
@ -64,15 +64,15 @@ class ControlTarget: RxTarget {
|
|||
control.target = self
|
||||
control.action = selector
|
||||
|
||||
let method = self.methodForSelector(selector)
|
||||
let method = self.method(for: selector)
|
||||
if method == nil {
|
||||
rxFatalError("Can't find method")
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
func eventHandler(sender: Control!) {
|
||||
if let callback = self.callback, control = self.control {
|
||||
func eventHandler(_ sender: Control!) {
|
||||
if let callback = self.callback, let control = self.control {
|
||||
callback(control)
|
||||
}
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ class ControlTarget: RxTarget {
|
|||
override func dispose() {
|
||||
super.dispose()
|
||||
#if os(iOS) || os(tvOS)
|
||||
self.control?.removeTarget(self, action: self.selector, forControlEvents: self.controlEvents)
|
||||
self.control?.removeTarget(self, action: self.selector, for: self.controlEvents)
|
||||
#elseif os(OSX)
|
||||
self.control?.target = nil
|
||||
self.control?.action = nil
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@ import RxSwift
|
|||
#endif
|
||||
|
||||
class DeallocObservable {
|
||||
let _subject = ReplaySubject<Void>.create(bufferSize: 1)
|
||||
let _subject = ReplaySubject<Void>.create(bufferSize:1)
|
||||
|
||||
init() {
|
||||
}
|
||||
|
||||
deinit {
|
||||
_subject.on(.Next(()))
|
||||
_subject.on(.Completed)
|
||||
_subject.on(.next(()))
|
||||
_subject.on(.completed)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,29 +33,29 @@ class KVOObservable<Element>
|
|||
}
|
||||
}
|
||||
|
||||
func subscribe<O : ObserverType where O.E == Element?>(observer: O) -> Disposable {
|
||||
func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.E == Element? {
|
||||
let observer = KVOObserver(parent: self) { (value) in
|
||||
if value as? NSNull != nil {
|
||||
observer.on(.Next(nil))
|
||||
observer.on(.next(nil))
|
||||
return
|
||||
}
|
||||
observer.on(.Next(value as? Element))
|
||||
observer.on(.next(value as? Element))
|
||||
}
|
||||
|
||||
return AnonymousDisposable(observer.dispose)
|
||||
return Disposables.create(with: observer.dispose)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if !DISABLE_SWIZZLING
|
||||
|
||||
func observeWeaklyKeyPathFor(target: NSObject, keyPath: String, options: NSKeyValueObservingOptions) -> Observable<AnyObject?> {
|
||||
let components = keyPath.componentsSeparatedByString(".").filter { $0 != "self" }
|
||||
func observeWeaklyKeyPathFor(_ target: NSObject, keyPath: String, options: NSKeyValueObservingOptions) -> Observable<AnyObject?> {
|
||||
let components = keyPath.components(separatedBy: ".").filter { $0 != "self" }
|
||||
|
||||
let observable = observeWeaklyKeyPathFor(target, keyPathSections: components, options: options)
|
||||
.finishWithNilWhenDealloc(target)
|
||||
|
||||
if !options.intersect(.Initial).isEmpty {
|
||||
if !options.intersection(.initial).isEmpty {
|
||||
return observable
|
||||
}
|
||||
else {
|
||||
|
|
@ -68,14 +68,14 @@ func observeWeaklyKeyPathFor(target: NSObject, keyPath: String, options: NSKeyVa
|
|||
// Identifiers can't contain `,`, so the only place where `,` can appear
|
||||
// is as a delimiter.
|
||||
// This means there is `W` as element in an array of property attributes.
|
||||
func isWeakProperty(properyRuntimeInfo: String) -> Bool {
|
||||
return properyRuntimeInfo.rangeOfString(",W,") != nil
|
||||
func isWeakProperty(_ properyRuntimeInfo: String) -> Bool {
|
||||
return properyRuntimeInfo.range(of: ",W,") != nil
|
||||
}
|
||||
|
||||
extension ObservableType where E == AnyObject? {
|
||||
func finishWithNilWhenDealloc(target: NSObject)
|
||||
func finishWithNilWhenDealloc(_ target: NSObject)
|
||||
-> Observable<AnyObject?> {
|
||||
let deallocating = target.rx_deallocating
|
||||
let deallocating = target.rx.deallocating
|
||||
|
||||
return deallocating
|
||||
.map { _ in
|
||||
|
|
@ -87,7 +87,7 @@ extension ObservableType where E == AnyObject? {
|
|||
}
|
||||
|
||||
func observeWeaklyKeyPathFor(
|
||||
target: NSObject,
|
||||
_ target: NSObject,
|
||||
keyPathSections: [String],
|
||||
options: NSKeyValueObservingOptions
|
||||
) -> Observable<AnyObject?> {
|
||||
|
|
@ -99,13 +99,13 @@ func observeWeaklyKeyPathFor(
|
|||
|
||||
let property = class_getProperty(object_getClass(target), propertyName)
|
||||
if property == nil {
|
||||
return Observable.error(RxCocoaError.InvalidPropertyName(object: target, propertyName: propertyName))
|
||||
return Observable.error(RxCocoaError.invalidPropertyName(object: target, propertyName: propertyName))
|
||||
}
|
||||
let propertyAttributes = property_getAttributes(property)
|
||||
|
||||
// should dealloc hook be in place if week property, or just create strong reference because it doesn't matter
|
||||
let isWeak = isWeakProperty(String.fromCString(propertyAttributes) ?? "")
|
||||
let propertyObservable = KVOObservable(object: target, keyPath: propertyName, options: options.union(.Initial), retainTarget: false) as KVOObservable<AnyObject>
|
||||
let isWeak = isWeakProperty(propertyAttributes.map(String.init) ?? "")
|
||||
let propertyObservable = KVOObservable(object: target, keyPath: propertyName, options: options.union(.initial), retainTarget: false) as KVOObservable<AnyObject>
|
||||
|
||||
// KVO recursion for value changes
|
||||
return propertyObservable
|
||||
|
|
@ -118,7 +118,7 @@ func observeWeaklyKeyPathFor(
|
|||
let strongTarget: AnyObject? = weakTarget
|
||||
|
||||
if nextObject == nil {
|
||||
return Observable.error(RxCocoaError.InvalidObjectOnKeyPath(object: nextTarget!, sourceObject: strongTarget ?? NSNull(), propertyName: propertyName))
|
||||
return Observable.error(RxCocoaError.invalidObjectOnKeyPath(object: nextTarget!, sourceObject: strongTarget ?? NSNull(), propertyName: propertyName))
|
||||
}
|
||||
|
||||
// if target is alive, then send change
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ protocol KVOObservableProtocol {
|
|||
|
||||
class KVOObserver : _RXKVOObserver
|
||||
, Disposable {
|
||||
typealias Callback = (AnyObject?) -> Void
|
||||
typealias Callback = @escaping (Any?) -> Void
|
||||
|
||||
var retainSelf: KVOObserver? = nil
|
||||
|
||||
|
|
@ -43,4 +43,4 @@ class KVOObserver : _RXKVOObserver
|
|||
OSAtomicDecrement32(&resourceCount)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ import Foundation
|
|||
init() {
|
||||
}
|
||||
|
||||
@objc func messageSentWithParameters(parameters: [AnyObject]) -> Void {
|
||||
_subject.on(.Next())
|
||||
@objc func messageSent(withParameters parameters: [Any]) -> Void {
|
||||
_subject.on(.next())
|
||||
}
|
||||
|
||||
func asObservable() -> Observable<()> {
|
||||
|
|
@ -38,7 +38,7 @@ import Foundation
|
|||
}
|
||||
|
||||
deinit {
|
||||
_subject.on(.Completed)
|
||||
_subject.on(.completed)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -58,8 +58,8 @@ import Foundation
|
|||
init() {
|
||||
}
|
||||
|
||||
@objc func messageSentWithParameters(parameters: [AnyObject]) -> Void {
|
||||
_subject.on(.Next(parameters))
|
||||
@objc func messageSent(withParameters parameters: [Any]) -> Void {
|
||||
_subject.on(.next(parameters as [AnyObject]))
|
||||
}
|
||||
|
||||
func asObservable() -> Observable<[AnyObject]> {
|
||||
|
|
@ -67,7 +67,7 @@ import Foundation
|
|||
}
|
||||
|
||||
deinit {
|
||||
_subject.on(.Completed)
|
||||
_subject.on(.completed)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import Foundation
|
|||
import RxSwift
|
||||
#endif
|
||||
|
||||
extension NSNotificationCenter {
|
||||
extension Reactive where Base: NotificationCenter {
|
||||
/**
|
||||
Transforms notifications posted to notification center to observable sequence of notifications.
|
||||
|
||||
|
|
@ -19,16 +19,16 @@ extension NSNotificationCenter {
|
|||
- parameter object: Optional object used to filter notifications.
|
||||
- returns: Observable sequence of posted notifications.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_notification(name: String?, object: AnyObject? = nil) -> Observable<NSNotification> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func notification(_ name: Notification.Name, object: AnyObject? = nil) -> Observable<Notification> {
|
||||
return Observable.create { [weak object] observer in
|
||||
let nsObserver = self.addObserverForName(name, object: object, queue: nil) { notification in
|
||||
observer.on(.Next(notification))
|
||||
let nsObserver = self.base.addObserver(forName: name, object: object, queue: nil) { notification in
|
||||
observer.on(.next(notification))
|
||||
}
|
||||
|
||||
return AnonymousDisposable {
|
||||
self.removeObserver(nsObserver)
|
||||
return Disposables.create {
|
||||
self.base.removeObserver(nsObserver)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,34 +11,34 @@ import Foundation
|
|||
import RxSwift
|
||||
#endif
|
||||
|
||||
extension NSObject {
|
||||
extension Reactive where Base: NSObject {
|
||||
|
||||
/**
|
||||
Specialization of generic `rx_observe` method.
|
||||
Specialization of generic `observe` method.
|
||||
|
||||
This is a special overload because to observe values of some type (for example `Int`), first values of KVO type
|
||||
need to be observed (`NSNumber`), and then converted to result type.
|
||||
|
||||
For more information take a look at `rx_observe` method.
|
||||
For more information take a look at `observe` method.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_observe<E: KVORepresentable>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial], retainSelf: Bool = true) -> Observable<E?> {
|
||||
return rx_observe(E.KVOType.self, keyPath, options: options, retainSelf: retainSelf)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func observe<E: KVORepresentable>(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial], retainSelf: Bool = true) -> Observable<E?> {
|
||||
return observe(E.KVOType.self, keyPath, options: options, retainSelf: retainSelf)
|
||||
.map(E.init)
|
||||
}
|
||||
}
|
||||
|
||||
#if !DISABLE_SWIZZLING
|
||||
// KVO
|
||||
extension NSObject {
|
||||
extension Reactive where Base: NSObject {
|
||||
/**
|
||||
Specialization of generic `rx_observeWeakly` method.
|
||||
Specialization of generic `observeWeakly` method.
|
||||
|
||||
For more information take a look at `rx_observeWeakly` method.
|
||||
For more information take a look at `observeWeakly` method.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_observeWeakly<E: KVORepresentable>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial]) -> Observable<E?> {
|
||||
return rx_observeWeakly(E.KVOType.self, keyPath, options: options)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func observeWeakly<E: KVORepresentable>(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial]) -> Observable<E?> {
|
||||
return observeWeakly(E.KVOType.self, keyPath, options: options)
|
||||
.map(E.init)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,40 +11,40 @@ import Foundation
|
|||
import RxSwift
|
||||
#endif
|
||||
|
||||
extension NSObject {
|
||||
extension Reactive where Base: NSObject {
|
||||
/**
|
||||
Specialization of generic `rx_observe` method.
|
||||
Specialization of generic `observe` method.
|
||||
|
||||
This specialization first observes `KVORepresentable` value and then converts it to `RawRepresentable` value.
|
||||
|
||||
It is useful for observing bridged ObjC enum values.
|
||||
|
||||
For more information take a look at `rx_observe` method.
|
||||
For more information take a look at `observe` method.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_observe<E: RawRepresentable where E.RawValue: KVORepresentable>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial], retainSelf: Bool = true) -> Observable<E?> {
|
||||
return rx_observe(E.RawValue.KVOType.self, keyPath, options: options, retainSelf: retainSelf)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func observe<E: RawRepresentable>(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial], retainSelf: Bool = true) -> Observable<E?> where E.RawValue: KVORepresentable {
|
||||
return observe(E.RawValue.KVOType.self, keyPath, options: options, retainSelf: retainSelf)
|
||||
.map(E.init)
|
||||
}
|
||||
}
|
||||
|
||||
#if !DISABLE_SWIZZLING
|
||||
|
||||
// rx_observeWeakly + RawRepresentable
|
||||
extension NSObject {
|
||||
// observeWeakly + RawRepresentable
|
||||
extension Reactive where Base: NSObject {
|
||||
|
||||
/**
|
||||
Specialization of generic `rx_observeWeakly` method.
|
||||
Specialization of generic `observeWeakly` method.
|
||||
|
||||
This specialization first observes `KVORepresentable` value and then converts it to `RawRepresentable` value.
|
||||
|
||||
It is useful for observing bridged ObjC enum values.
|
||||
|
||||
For more information take a look at `rx_observeWeakly` method.
|
||||
For more information take a look at `observeWeakly` method.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_observeWeakly<E: RawRepresentable where E.RawValue: KVORepresentable>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial]) -> Observable<E?> {
|
||||
return rx_observeWeakly(E.RawValue.KVOType.self, keyPath, options: options)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func observeWeakly<E: RawRepresentable>(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial]) -> Observable<E?> where E.RawValue: KVORepresentable {
|
||||
return observeWeakly(E.RawValue.KVOType.self, keyPath, options: options)
|
||||
.map(E.init)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,39 +38,39 @@ Both approaches can fail in certain scenarios:
|
|||
Second approach is chosen. It can fail in case there are multiple libraries dynamically trying
|
||||
to replace dealloc method. In case that isn't the case, it should be ok.
|
||||
*/
|
||||
extension NSObject {
|
||||
extension Reactive where Base: NSObject {
|
||||
|
||||
|
||||
/**
|
||||
Observes values on `keyPath` starting from `self` with `options` and retains `self` if `retainSelf` is set.
|
||||
|
||||
`rx_observe` is just a simple and performant wrapper around KVO mechanism.
|
||||
`observe` is just a simple and performant wrapper around KVO mechanism.
|
||||
|
||||
* it can be used to observe paths starting from `self` or from ancestors in ownership graph (`retainSelf = false`)
|
||||
* it can be used to observe paths starting from descendants in ownership graph (`retainSelf = true`)
|
||||
* the paths have to consist only of `strong` properties, otherwise you are risking crashing the system by not unregistering KVO observer before dealloc.
|
||||
|
||||
If support for weak properties is needed or observing arbitrary or unknown relationships in the
|
||||
ownership tree, `rx_observeWeakly` is the preferred option.
|
||||
ownership tree, `observeWeakly` is the preferred option.
|
||||
|
||||
- parameter keyPath: Key path of property names to observe.
|
||||
- parameter options: KVO mechanism notification options.
|
||||
- parameter retainSelf: Retains self during observation if set `true`.
|
||||
- returns: Observable sequence of objects on `keyPath`.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_observe<E>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial], retainSelf: Bool = true) -> Observable<E?> {
|
||||
return KVOObservable(object: self, keyPath: keyPath, options: options, retainTarget: retainSelf).asObservable()
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func observe<E>(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial], retainSelf: Bool = true) -> Observable<E?> {
|
||||
return KVOObservable(object: base, keyPath: keyPath, options: options, retainTarget: retainSelf).asObservable()
|
||||
}
|
||||
}
|
||||
|
||||
#if !DISABLE_SWIZZLING
|
||||
// KVO
|
||||
extension NSObject {
|
||||
extension Reactive where Base: NSObject {
|
||||
/**
|
||||
Observes values on `keyPath` starting from `self` with `options` and doesn't retain `self`.
|
||||
|
||||
It can be used in all cases where `rx_observe` can be used and additionally
|
||||
It can be used in all cases where `observe` can be used and additionally
|
||||
|
||||
* because it won't retain observed target, it can be used to observe arbitrary object graph whose ownership relation is unknown
|
||||
* it can be used to observe `weak` properties
|
||||
|
|
@ -81,9 +81,9 @@ extension NSObject {
|
|||
- parameter options: KVO mechanism notification options.
|
||||
- returns: Observable sequence of objects on `keyPath`.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_observeWeakly<E>(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial]) -> Observable<E?> {
|
||||
return observeWeaklyKeyPathFor(self, keyPath: keyPath, options: options)
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func observeWeakly<E>(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial]) -> Observable<E?> {
|
||||
return observeWeaklyKeyPathFor(base, keyPath: keyPath, options: options)
|
||||
.map { n in
|
||||
return n as? E
|
||||
}
|
||||
|
|
@ -92,7 +92,7 @@ extension NSObject {
|
|||
#endif
|
||||
|
||||
// Dealloc
|
||||
extension NSObject {
|
||||
extension Reactive where Base: AnyObject {
|
||||
|
||||
/**
|
||||
Observable sequence of object deallocated events.
|
||||
|
|
@ -101,15 +101,15 @@ extension NSObject {
|
|||
|
||||
- returns: Observable sequence of object deallocated events.
|
||||
*/
|
||||
public var rx_deallocated: Observable<Void> {
|
||||
return rx_synchronized {
|
||||
if let deallocObservable = objc_getAssociatedObject(self, &deallocatedSubjectContext) as? DeallocObservable {
|
||||
public var deallocated: Observable<Void> {
|
||||
return synchronized {
|
||||
if let deallocObservable = objc_getAssociatedObject(base, &deallocatedSubjectContext) as? DeallocObservable {
|
||||
return deallocObservable._subject
|
||||
}
|
||||
|
||||
let deallocObservable = DeallocObservable()
|
||||
|
||||
objc_setAssociatedObject(self, &deallocatedSubjectContext, deallocObservable, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
|
||||
objc_setAssociatedObject(base, &deallocatedSubjectContext, deallocObservable, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
|
||||
return deallocObservable._subject
|
||||
}
|
||||
}
|
||||
|
|
@ -125,24 +125,24 @@ extension NSObject {
|
|||
|
||||
- returns: Observable sequence of object deallocating events.
|
||||
*/
|
||||
public func rx_sentMessage(selector: Selector) -> Observable<[AnyObject]> {
|
||||
return rx_synchronized {
|
||||
public func sentMessage(_ selector: Selector) -> Observable<[AnyObject]> {
|
||||
return synchronized {
|
||||
// in case of dealloc selector replay subject behavior needs to be used
|
||||
if selector == deallocSelector {
|
||||
return rx_deallocating.map { _ in [] }
|
||||
return deallocating.map { _ in [] }
|
||||
}
|
||||
|
||||
let rxSelector = RX_selector(selector)
|
||||
let selectorReference = RX_reference_from_selector(rxSelector)
|
||||
|
||||
let subject: MessageSentObservable
|
||||
if let existingSubject = objc_getAssociatedObject(self, selectorReference) as? MessageSentObservable {
|
||||
if let existingSubject = objc_getAssociatedObject(base, selectorReference) as? MessageSentObservable {
|
||||
subject = existingSubject
|
||||
}
|
||||
else {
|
||||
subject = MessageSentObservable()
|
||||
objc_setAssociatedObject(
|
||||
self,
|
||||
base,
|
||||
selectorReference,
|
||||
subject,
|
||||
.OBJC_ASSOCIATION_RETAIN_NONATOMIC
|
||||
|
|
@ -150,17 +150,16 @@ extension NSObject {
|
|||
}
|
||||
|
||||
if subject.isActive {
|
||||
return subject.asObservable()
|
||||
return subject.asObservable().map { $0 }
|
||||
}
|
||||
|
||||
var error: NSError?
|
||||
let targetImplementation = RX_ensure_observing(self, selector, &error)
|
||||
if targetImplementation == nil {
|
||||
return Observable.error(error?.rxCocoaErrorForTarget(self) ?? RxCocoaError.Unknown)
|
||||
guard let targetImplementation = RX_ensure_observing(base, selector, &error) else {
|
||||
return Observable.error(error?.rxCocoaErrorForTarget(base) ?? RxCocoaError.unknown)
|
||||
}
|
||||
|
||||
subject.targetImplementation = targetImplementation
|
||||
return subject.asObservable()
|
||||
return subject.asObservable().map { $0 }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -174,17 +173,17 @@ extension NSObject {
|
|||
|
||||
- returns: Observable sequence of object deallocating events.
|
||||
*/
|
||||
public var rx_deallocating: Observable<()> {
|
||||
return rx_synchronized {
|
||||
public var deallocating: Observable<()> {
|
||||
return synchronized {
|
||||
|
||||
let subject: DeallocatingObservable
|
||||
if let existingSubject = objc_getAssociatedObject(self, rxDeallocatingSelectorReference) as? DeallocatingObservable {
|
||||
if let existingSubject = objc_getAssociatedObject(base, rxDeallocatingSelectorReference) as? DeallocatingObservable {
|
||||
subject = existingSubject
|
||||
}
|
||||
else {
|
||||
subject = DeallocatingObservable()
|
||||
objc_setAssociatedObject(
|
||||
self,
|
||||
base,
|
||||
rxDeallocatingSelectorReference,
|
||||
subject,
|
||||
.OBJC_ASSOCIATION_RETAIN_NONATOMIC
|
||||
|
|
@ -196,12 +195,12 @@ extension NSObject {
|
|||
}
|
||||
|
||||
var error: NSError?
|
||||
let targetImplementation = RX_ensure_observing(self, deallocSelector, &error)
|
||||
let targetImplementation = RX_ensure_observing(base, deallocSelector, &error)
|
||||
if targetImplementation == nil {
|
||||
return Observable.error(error?.rxCocoaErrorForTarget(self) ?? RxCocoaError.Unknown)
|
||||
return Observable.error(error?.rxCocoaErrorForTarget(base) ?? RxCocoaError.unknown)
|
||||
}
|
||||
|
||||
subject.targetImplementation = targetImplementation
|
||||
subject.targetImplementation = targetImplementation!
|
||||
return subject.asObservable()
|
||||
}
|
||||
}
|
||||
|
|
@ -212,29 +211,29 @@ let deallocSelector = NSSelectorFromString("dealloc")
|
|||
let rxDeallocatingSelector = RX_selector(deallocSelector)
|
||||
let rxDeallocatingSelectorReference = RX_reference_from_selector(rxDeallocatingSelector)
|
||||
|
||||
extension NSObject {
|
||||
func rx_synchronized<T>(@noescape action: () -> T) -> T {
|
||||
objc_sync_enter(self)
|
||||
extension Reactive where Base: AnyObject {
|
||||
func synchronized<T>( _ action: () -> T) -> T {
|
||||
objc_sync_enter(self.base)
|
||||
let result = action()
|
||||
objc_sync_exit(self)
|
||||
objc_sync_exit(self.base)
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
extension NSObject {
|
||||
extension Reactive where Base: AnyObject {
|
||||
/**
|
||||
Helper to make sure that `Observable` returned from `createCachedObservable` is only created once.
|
||||
This is important because there is only one `target` and `action` properties on `NSControl` or `UIBarButtonItem`.
|
||||
*/
|
||||
func rx_lazyInstanceObservable<T: AnyObject>(key: UnsafePointer<Void>, createCachedObservable: () -> T) -> T {
|
||||
if let value = objc_getAssociatedObject(self, key) {
|
||||
func lazyInstanceObservable<T: AnyObject>(_ key: UnsafeRawPointer, createCachedObservable: () -> T) -> T {
|
||||
if let value = objc_getAssociatedObject(base, key) {
|
||||
return value as! T
|
||||
}
|
||||
|
||||
let observable = createCachedObservable()
|
||||
|
||||
objc_setAssociatedObject(self, key, observable, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
|
||||
objc_setAssociatedObject(base, key, observable, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
|
||||
|
||||
return observable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,24 +15,24 @@ import RxSwift
|
|||
RxCocoa URL errors.
|
||||
*/
|
||||
public enum RxCocoaURLError
|
||||
: ErrorType
|
||||
: Swift.Error
|
||||
, CustomDebugStringConvertible {
|
||||
/**
|
||||
Unknown error occurred.
|
||||
*/
|
||||
case Unknown
|
||||
case unknown
|
||||
/**
|
||||
Response is not NSHTTPURLResponse
|
||||
*/
|
||||
case NonHTTPResponse(response: NSURLResponse)
|
||||
case nonHTTPResponse(response: URLResponse)
|
||||
/**
|
||||
Response is not successful. (not in `200 ..< 300` range)
|
||||
*/
|
||||
case HTTPRequestFailed(response: NSHTTPURLResponse, data: NSData?)
|
||||
case httpRequestFailed(response: HTTPURLResponse, data: Data?)
|
||||
/**
|
||||
Deserialization error.
|
||||
*/
|
||||
case DeserializationError(error: ErrorType)
|
||||
case deserializationError(error: Swift.Error)
|
||||
}
|
||||
|
||||
public extension RxCocoaURLError {
|
||||
|
|
@ -41,40 +41,40 @@ public extension RxCocoaURLError {
|
|||
*/
|
||||
public var debugDescription: String {
|
||||
switch self {
|
||||
case .Unknown:
|
||||
case .unknown:
|
||||
return "Unknown error has occurred."
|
||||
case let .NonHTTPResponse(response):
|
||||
case let .nonHTTPResponse(response):
|
||||
return "Response is not NSHTTPURLResponse `\(response)`."
|
||||
case let .HTTPRequestFailed(response, _):
|
||||
case let .httpRequestFailed(response, _):
|
||||
return "HTTP request failed with `\(response.statusCode)`."
|
||||
case let .DeserializationError(error):
|
||||
case let .deserializationError(error):
|
||||
return "Error during deserialization of the response: \(error)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func escapeTerminalString(value: String) -> String {
|
||||
return value.stringByReplacingOccurrencesOfString("\"", withString: "\\\"", options:[], range: nil)
|
||||
func escapeTerminalString(_ value: String) -> String {
|
||||
return value.replacingOccurrences(of: "\"", with: "\\\"", options:[], range: nil)
|
||||
}
|
||||
|
||||
func convertURLRequestToCurlCommand(request: NSURLRequest) -> String {
|
||||
let method = request.HTTPMethod ?? "GET"
|
||||
func convertURLRequestToCurlCommand(_ request: URLRequest) -> String {
|
||||
let method = request.httpMethod ?? "GET"
|
||||
var returnValue = "curl -X \(method) "
|
||||
|
||||
if request.HTTPMethod == "POST" && request.HTTPBody != nil {
|
||||
let maybeBody = NSString(data: request.HTTPBody!, encoding: NSUTF8StringEncoding) as? String
|
||||
if request.httpMethod == "POST" && request.httpBody != nil {
|
||||
let maybeBody = NSString(data: request.httpBody!, encoding: String.Encoding.utf8.rawValue) as? String
|
||||
if let body = maybeBody {
|
||||
returnValue += "-d \"\(escapeTerminalString(body))\" "
|
||||
}
|
||||
}
|
||||
|
||||
for (key, value) in request.allHTTPHeaderFields ?? [:] {
|
||||
let escapedKey = escapeTerminalString((key as String) ?? "")
|
||||
let escapedValue = escapeTerminalString((value as String) ?? "")
|
||||
let escapedKey = escapeTerminalString(key as String)
|
||||
let escapedValue = escapeTerminalString(value as String)
|
||||
returnValue += "\n -H \"\(escapedKey): \(escapedValue)\" "
|
||||
}
|
||||
|
||||
let URLString = request.URL?.absoluteString ?? "<unknown url>"
|
||||
let URLString = request.url?.absoluteString ?? "<unknown url>"
|
||||
|
||||
returnValue += "\n\"\(escapeTerminalString(URLString))\""
|
||||
|
||||
|
|
@ -83,10 +83,10 @@ func convertURLRequestToCurlCommand(request: NSURLRequest) -> String {
|
|||
return returnValue
|
||||
}
|
||||
|
||||
func convertResponseToString(data: NSData!, _ response: NSURLResponse!, _ error: NSError!, _ interval: NSTimeInterval) -> String {
|
||||
func convertResponseToString(_ data: Data!, _ response: URLResponse!, _ error: NSError!, _ interval: TimeInterval) -> String {
|
||||
let ms = Int(interval * 1000)
|
||||
|
||||
if let response = response as? NSHTTPURLResponse {
|
||||
if let response = response as? HTTPURLResponse {
|
||||
if 200 ..< 300 ~= response.statusCode {
|
||||
return "Success (\(ms)ms): Status \(response.statusCode)"
|
||||
}
|
||||
|
|
@ -105,7 +105,7 @@ func convertResponseToString(data: NSData!, _ response: NSURLResponse!, _ error:
|
|||
return "<Unhandled response from server>"
|
||||
}
|
||||
|
||||
extension NSURLSession {
|
||||
extension Reactive where Base: URLSession {
|
||||
/**
|
||||
Observable sequence of responses for URL request.
|
||||
|
||||
|
|
@ -118,44 +118,44 @@ extension NSURLSession {
|
|||
- parameter request: URL request.
|
||||
- returns: Observable sequence of URL responses.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_response(request: NSURLRequest) -> Observable<(NSData, NSHTTPURLResponse)> {
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func response(_ request: URLRequest) -> Observable<(Data, HTTPURLResponse)> {
|
||||
return Observable.create { observer in
|
||||
|
||||
// smart compiler should be able to optimize this out
|
||||
var d: NSDate?
|
||||
var d: Date?
|
||||
|
||||
if Logging.URLRequests(request) {
|
||||
d = NSDate()
|
||||
d = Date()
|
||||
}
|
||||
|
||||
let task = self.dataTaskWithRequest(request) { (data, response, error) in
|
||||
let task = self.base.dataTask(with: request) { (data, response, error) in
|
||||
|
||||
if Logging.URLRequests(request) {
|
||||
let interval = NSDate().timeIntervalSinceDate(d ?? NSDate())
|
||||
let interval = Date().timeIntervalSince(d ?? Date())
|
||||
print(convertURLRequestToCurlCommand(request))
|
||||
print(convertResponseToString(data, response, error, interval))
|
||||
print(convertResponseToString(data, response, error as NSError!, interval))
|
||||
}
|
||||
|
||||
guard let response = response, data = data else {
|
||||
observer.on(.Error(error ?? RxCocoaURLError.Unknown))
|
||||
guard let response = response, let data = data else {
|
||||
observer.on(.error(error ?? RxCocoaURLError.unknown))
|
||||
return
|
||||
}
|
||||
|
||||
guard let httpResponse = response as? NSHTTPURLResponse else {
|
||||
observer.on(.Error(RxCocoaURLError.NonHTTPResponse(response: response)))
|
||||
guard let httpResponse = response as? HTTPURLResponse else {
|
||||
observer.on(.error(RxCocoaURLError.nonHTTPResponse(response: response)))
|
||||
return
|
||||
}
|
||||
|
||||
observer.on(.Next(data, httpResponse))
|
||||
observer.on(.Completed)
|
||||
observer.on(.next(data, httpResponse))
|
||||
observer.on(.completed)
|
||||
}
|
||||
|
||||
|
||||
let t = task
|
||||
t.resume()
|
||||
|
||||
return AnonymousDisposable(task.cancel)
|
||||
return Disposables.create(with: task.cancel)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -174,14 +174,14 @@ extension NSURLSession {
|
|||
- parameter request: URL request.
|
||||
- returns: Observable sequence of response data.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_data(request: NSURLRequest) -> Observable<NSData> {
|
||||
return rx_response(request).map { (data, response) -> NSData in
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func data(_ request: URLRequest) -> Observable<Data> {
|
||||
return response(request).map { (data, response) -> Data in
|
||||
if 200 ..< 300 ~= response.statusCode {
|
||||
return data
|
||||
}
|
||||
else {
|
||||
throw RxCocoaURLError.HTTPRequestFailed(response: response, data: data)
|
||||
throw RxCocoaURLError.httpRequestFailed(response: response, data: data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -203,13 +203,13 @@ extension NSURLSession {
|
|||
- parameter request: URL request.
|
||||
- returns: Observable sequence of response JSON.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_JSON(request: NSURLRequest) -> Observable<AnyObject> {
|
||||
return rx_data(request).map { (data) -> AnyObject in
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func JSON(_ request: URLRequest) -> Observable<AnyObject> {
|
||||
return data(request).map { (data) -> AnyObject in
|
||||
do {
|
||||
return try NSJSONSerialization.JSONObjectWithData(data, options: [])
|
||||
return try JSONSerialization.jsonObject(with: data, options: []) as AnyObject
|
||||
} catch let error {
|
||||
throw RxCocoaURLError.DeserializationError(error: error)
|
||||
throw RxCocoaURLError.deserializationError(error: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -231,8 +231,8 @@ extension NSURLSession {
|
|||
- parameter URL: URL of `NSURLRequest` request.
|
||||
- returns: Observable sequence of response JSON.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_JSON(URL: NSURL) -> Observable<AnyObject> {
|
||||
return rx_JSON(NSURLRequest(URL: URL))
|
||||
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
||||
public func JSON(_ URL: Foundation.URL) -> Observable<AnyObject> {
|
||||
return JSON(URLRequest(url: URL))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@ class RxCLLocationManagerDelegateProxy : DelegateProxy
|
|||
, CLLocationManagerDelegate
|
||||
, DelegateProxyType {
|
||||
|
||||
class func currentDelegateFor(object: AnyObject) -> AnyObject? {
|
||||
class func currentDelegateFor(_ object: AnyObject) -> AnyObject? {
|
||||
let locationManager: CLLocationManager = castOrFatalError(object)
|
||||
return locationManager.delegate
|
||||
}
|
||||
|
||||
class func setCurrentDelegate(delegate: AnyObject?, toObject object: AnyObject) {
|
||||
class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) {
|
||||
let locationManager: CLLocationManager = castOrFatalError(object)
|
||||
locationManager.delegate = castOptionalOrFatalError(delegate)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,27 +7,52 @@
|
|||
//
|
||||
|
||||
/**
|
||||
We can use `Reactive` protocol as customization point for constrained protocol extensions.
|
||||
Use `Reactive` proxy as customization point for constrained protocol extensions.
|
||||
|
||||
General pattern would be:
|
||||
General pattern would be:
|
||||
|
||||
// 1. Extend Reactive protocol with constrain on Self
|
||||
// Read as: Reactive Extension where Self is a SomeType
|
||||
extension Reactive where Self: SomeType {
|
||||
// 2. Put any specific reactive extension for SomeType here
|
||||
}
|
||||
|
||||
// 1. Conform SomeType to Reactive protocol
|
||||
extension SomeType: Reactive {}
|
||||
With this approach we can have more specialized methods and properties using
|
||||
`Self` and not just specialized on common base type.
|
||||
|
||||
// 2. Extend Reactive protocol with constrain on Self
|
||||
// Read as: Reactive Extension where Self is a SomeType
|
||||
extension Reactive where Self: SomeType {
|
||||
// 3. Put any specific reactive extension for SomeType here
|
||||
*/
|
||||
|
||||
public struct Reactive<Base> {
|
||||
/**
|
||||
Base object to extend.
|
||||
*/
|
||||
public let base: Base
|
||||
|
||||
/**
|
||||
Creates extensions with base object.
|
||||
|
||||
- parameter base: Base object.
|
||||
*/
|
||||
public init(_ base: Base) {
|
||||
self.base = base
|
||||
}
|
||||
|
||||
|
||||
With this approach we can have more specialized methods and properties using
|
||||
`Self` and not just specialized on common base type.
|
||||
|
||||
See UIGestureRecognizer+Rx.swift as an example
|
||||
*/
|
||||
|
||||
public protocol Reactive {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
A type that has reactive extensions.
|
||||
*/
|
||||
public protocol ReactiveCompatible {
|
||||
associatedtype CompatibleType
|
||||
var rx: Reactive<CompatibleType> { get }
|
||||
}
|
||||
|
||||
public extension ReactiveCompatible {
|
||||
public var rx: Reactive<Self> {
|
||||
return Reactive(self)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Extend NSObject with `rx` proxy.
|
||||
*/
|
||||
extension NSObject: ReactiveCompatible { }
|
||||
|
|
|
|||
|
|
@ -18,36 +18,36 @@ import RxSwift
|
|||
RxCocoa errors.
|
||||
*/
|
||||
public enum RxCocoaError
|
||||
: ErrorType
|
||||
: Swift.Error
|
||||
, CustomDebugStringConvertible {
|
||||
/**
|
||||
Unknown error has occurred.
|
||||
*/
|
||||
case Unknown
|
||||
case unknown
|
||||
/**
|
||||
Invalid operation was attempted.
|
||||
*/
|
||||
case InvalidOperation(object: AnyObject)
|
||||
case invalidOperation(object: AnyObject)
|
||||
/**
|
||||
Items are not yet bound to user interface but have been requested.
|
||||
*/
|
||||
case ItemsNotYetBound(object: AnyObject)
|
||||
case itemsNotYetBound(object: AnyObject)
|
||||
/**
|
||||
Invalid KVO Path.
|
||||
*/
|
||||
case InvalidPropertyName(object: AnyObject, propertyName: String)
|
||||
case invalidPropertyName(object: AnyObject, propertyName: String)
|
||||
/**
|
||||
Invalid object on key path.
|
||||
*/
|
||||
case InvalidObjectOnKeyPath(object: AnyObject, sourceObject: AnyObject, propertyName: String)
|
||||
case invalidObjectOnKeyPath(object: AnyObject, sourceObject: AnyObject, propertyName: String)
|
||||
/**
|
||||
Error during swizzling.
|
||||
*/
|
||||
case ErrorDuringSwizzling
|
||||
case errorDuringSwizzling
|
||||
/*
|
||||
Casting error.
|
||||
*/
|
||||
case CastingError(object: AnyObject, targetType: Any.Type)
|
||||
case castingError(object: AnyObject, targetType: Any.Type)
|
||||
}
|
||||
|
||||
#if !DISABLE_SWIZZLING
|
||||
|
|
@ -58,31 +58,31 @@ public enum RxCocoaInterceptionMechanism {
|
|||
/**
|
||||
Unknown message interception mechanism.
|
||||
*/
|
||||
case Unknown
|
||||
case unknown
|
||||
/**
|
||||
Key value observing interception mechanism.
|
||||
*/
|
||||
case KVO
|
||||
case kvo
|
||||
}
|
||||
|
||||
/**
|
||||
RxCocoa ObjC runtime modification errors.
|
||||
*/
|
||||
public enum RxCocoaObjCRuntimeError
|
||||
: ErrorType
|
||||
: Swift.Error
|
||||
, CustomDebugStringConvertible {
|
||||
/**
|
||||
Unknown error has occurred.
|
||||
*/
|
||||
case Unknown(target: AnyObject)
|
||||
case unknown(target: AnyObject)
|
||||
|
||||
/**
|
||||
If the object is reporting a different class then it's real class, that means that there is probably
|
||||
already some interception mechanism in place or something weird is happening.
|
||||
|
||||
The most common case when this would happen is when using a combination of KVO (`rx_observe`) and `rx_sentMessage`.
|
||||
The most common case when this would happen is when using a combination of KVO (`observe`) and `sentMessage`.
|
||||
|
||||
This error is easily resolved by just using `rx_sentMessage` observing before `rx_observe`.
|
||||
This error is easily resolved by just using `sentMessage` observing before `observe`.
|
||||
|
||||
The reason why the other way around could create issues is because KVO will unregister it's interceptor
|
||||
class and restore original class. Unfortunately that will happen no matter was there another interceptor
|
||||
|
|
@ -90,7 +90,7 @@ public enum RxCocoaObjCRuntimeError
|
|||
|
||||
Failure scenario:
|
||||
* KVO sets class to be `__KVO__OriginalClass` (subclass of `OriginalClass`)
|
||||
* `rx_sentMessage` sets object class to be `_RX_namespace___KVO__OriginalClass` (subclass of `__KVO__OriginalClass`)
|
||||
* `sentMessage` sets object class to be `_RX_namespace___KVO__OriginalClass` (subclass of `__KVO__OriginalClass`)
|
||||
* then unobserving with KVO will restore class to be `OriginalClass` -> failure point (possibly a bug in KVO)
|
||||
|
||||
The reason why changing order of observing works is because any interception method on unregistration
|
||||
|
|
@ -101,12 +101,12 @@ public enum RxCocoaObjCRuntimeError
|
|||
it's highly unlikely it would have any benefit in real world use cases, and it's even more
|
||||
dangerous.
|
||||
*/
|
||||
case ObjectMessagesAlreadyBeingIntercepted(target: AnyObject, interceptionMechanism: RxCocoaInterceptionMechanism)
|
||||
case objectMessagesAlreadyBeingIntercepted(target: AnyObject, interceptionMechanism: RxCocoaInterceptionMechanism)
|
||||
|
||||
/**
|
||||
Trying to observe messages for selector that isn't implemented.
|
||||
*/
|
||||
case SelectorNotImplemented(target: AnyObject)
|
||||
case selectorNotImplemented(target: AnyObject)
|
||||
|
||||
/**
|
||||
Core Foundation classes are usually toll free bridged. Those classes crash the program in case
|
||||
|
|
@ -115,7 +115,7 @@ public enum RxCocoaObjCRuntimeError
|
|||
There is a possibility to just swizzle methods on original object, but since those won't be usual use
|
||||
cases for this library, then an error will just be reported for now.
|
||||
*/
|
||||
case CantInterceptCoreFoundationTollFreeBridgedObjects(target: AnyObject)
|
||||
case cantInterceptCoreFoundationTollFreeBridgedObjects(target: AnyObject)
|
||||
|
||||
/**
|
||||
Two libraries have simultaneously tried to modify ObjC runtime and that was detected. This can only
|
||||
|
|
@ -124,17 +124,17 @@ public enum RxCocoaObjCRuntimeError
|
|||
To synchronize other libraries intercepting messages for an object, use `synchronized` on target object and
|
||||
it's meta-class.
|
||||
*/
|
||||
case ThreadingCollisionWithOtherInterceptionMechanism(target: AnyObject)
|
||||
case threadingCollisionWithOtherInterceptionMechanism(target: AnyObject)
|
||||
|
||||
/**
|
||||
For some reason saving original method implementation under RX namespace failed.
|
||||
*/
|
||||
case SavingOriginalForwardingMethodFailed(target: AnyObject)
|
||||
case savingOriginalForwardingMethodFailed(target: AnyObject)
|
||||
|
||||
/**
|
||||
Intercepting a sent message by replacing a method implementation with `_objc_msgForward` failed for some reason.
|
||||
*/
|
||||
case ReplacingMethodWithForwardingImplementation(target: AnyObject)
|
||||
case replacingMethodWithForwardingImplementation(target: AnyObject)
|
||||
|
||||
/**
|
||||
Attempt to intercept one of the performance sensitive methods:
|
||||
|
|
@ -143,7 +143,7 @@ public enum RxCocoaObjCRuntimeError
|
|||
* methodSignatureForSelector:
|
||||
* forwardingTargetForSelector:
|
||||
*/
|
||||
case ObservingPerformanceSensitiveMessages(target: AnyObject)
|
||||
case observingPerformanceSensitiveMessages(target: AnyObject)
|
||||
|
||||
/**
|
||||
Message implementation has unsupported return type (for example large struct). The reason why this is a error
|
||||
|
|
@ -152,7 +152,7 @@ public enum RxCocoaObjCRuntimeError
|
|||
|
||||
The unsupported cases should be fairly uncommon.
|
||||
*/
|
||||
case ObservingMessagesWithUnsupportedReturnType(target: AnyObject)
|
||||
case observingMessagesWithUnsupportedReturnType(target: AnyObject)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -165,19 +165,19 @@ public extension RxCocoaError {
|
|||
*/
|
||||
public var debugDescription: String {
|
||||
switch self {
|
||||
case .Unknown:
|
||||
case .unknown:
|
||||
return "Unknown error occurred."
|
||||
case let .InvalidOperation(object):
|
||||
case let .invalidOperation(object):
|
||||
return "Invalid operation was attempted on `\(object)`."
|
||||
case let .ItemsNotYetBound(object):
|
||||
case let .itemsNotYetBound(object):
|
||||
return "Data source is set, but items are not yet bound to user interface for `\(object)`."
|
||||
case let .InvalidPropertyName(object, propertyName):
|
||||
case let .invalidPropertyName(object, propertyName):
|
||||
return "Object `\(object)` dosn't have a property named `\(propertyName)`."
|
||||
case let .InvalidObjectOnKeyPath(object, sourceObject, propertyName):
|
||||
case let .invalidObjectOnKeyPath(object, sourceObject, propertyName):
|
||||
return "Unobservable object `\(object)` was observed as `\(propertyName)` of `\(sourceObject)`."
|
||||
case .ErrorDuringSwizzling:
|
||||
case .errorDuringSwizzling:
|
||||
return "Error during swizzling."
|
||||
case .CastingError(let object, let targetType):
|
||||
case .castingError(let object, let targetType):
|
||||
return "Error casting `\(object)` to `\(targetType)`"
|
||||
}
|
||||
}
|
||||
|
|
@ -191,25 +191,25 @@ public extension RxCocoaObjCRuntimeError {
|
|||
*/
|
||||
public var debugDescription: String {
|
||||
switch self {
|
||||
case let .Unknown(target):
|
||||
case let .unknown(target):
|
||||
return "Unknown error occurred.\nTarget: `\(target)`"
|
||||
case let ObjectMessagesAlreadyBeingIntercepted(target, interceptionMechanism):
|
||||
let interceptionMechanismDescription = interceptionMechanism == .KVO ? "KVO" : "other interception mechanism"
|
||||
case let .objectMessagesAlreadyBeingIntercepted(target, interceptionMechanism):
|
||||
let interceptionMechanismDescription = interceptionMechanism == .kvo ? "KVO" : "other interception mechanism"
|
||||
return "Collision between RxCocoa interception mechanism and \(interceptionMechanismDescription)."
|
||||
+ " To resolve this conflict please use this interception mechanism first.\nTarget: \(target)"
|
||||
case let SelectorNotImplemented(target):
|
||||
case let .selectorNotImplemented(target):
|
||||
return "Trying to observe messages for selector that isn't implemented.\nTarget: \(target)"
|
||||
case let CantInterceptCoreFoundationTollFreeBridgedObjects(target):
|
||||
case let .cantInterceptCoreFoundationTollFreeBridgedObjects(target):
|
||||
return "Interception of messages sent to Core Foundation isn't supported.\nTarget: \(target)"
|
||||
case let ThreadingCollisionWithOtherInterceptionMechanism(target):
|
||||
case let .threadingCollisionWithOtherInterceptionMechanism(target):
|
||||
return "Detected a conflict while modifying ObjC runtime.\nTarget: \(target)"
|
||||
case let SavingOriginalForwardingMethodFailed(target):
|
||||
case let .savingOriginalForwardingMethodFailed(target):
|
||||
return "Saving original method implementation failed.\nTarget: \(target)"
|
||||
case let ReplacingMethodWithForwardingImplementation(target):
|
||||
case let .replacingMethodWithForwardingImplementation(target):
|
||||
return "Intercepting a sent message by replacing a method implementation with `_objc_msgForward` failed for some reason.\nTarget: \(target)"
|
||||
case let ObservingPerformanceSensitiveMessages(target):
|
||||
case let .observingPerformanceSensitiveMessages(target):
|
||||
return "Attempt to intercept one of the performance sensitive methods. \nTarget: \(target)"
|
||||
case let ObservingMessagesWithUnsupportedReturnType(target):
|
||||
case let .observingMessagesWithUnsupportedReturnType(target):
|
||||
return "Attempt to intercept a method with unsupported return type. \nTarget: \(target)"
|
||||
}
|
||||
}
|
||||
|
|
@ -219,7 +219,7 @@ public extension RxCocoaObjCRuntimeError {
|
|||
|
||||
// MARK: Error binding policies
|
||||
|
||||
func bindingErrorToInterface(error: ErrorType) {
|
||||
func bindingErrorToInterface(_ error: Swift.Error) {
|
||||
let error = "Binding error to UI: \(error)"
|
||||
#if DEBUG
|
||||
rxFatalError(error)
|
||||
|
|
@ -230,18 +230,18 @@ func bindingErrorToInterface(error: ErrorType) {
|
|||
|
||||
// MARK: Abstract methods
|
||||
|
||||
@noreturn func rxAbstractMethodWithMessage(message: String) {
|
||||
func rxAbstractMethodWithMessage(_ message: String) -> Swift.Never {
|
||||
rxFatalError(message)
|
||||
}
|
||||
|
||||
@noreturn func rxAbstractMethod() {
|
||||
func rxAbstractMethod() -> Swift.Never {
|
||||
rxFatalError("Abstract method")
|
||||
}
|
||||
|
||||
// MARK: casts or fatal error
|
||||
|
||||
// workaround for Swift compiler bug, cheers compiler team :)
|
||||
func castOptionalOrFatalError<T>(value: AnyObject?) -> T? {
|
||||
func castOptionalOrFatalError<T>(_ value: AnyObject?) -> T? {
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
|
@ -249,27 +249,27 @@ func castOptionalOrFatalError<T>(value: AnyObject?) -> T? {
|
|||
return v
|
||||
}
|
||||
|
||||
func castOrThrow<T>(resultType: T.Type, _ object: AnyObject) throws -> T {
|
||||
func castOrThrow<T>(_ resultType: T.Type, _ object: AnyObject) throws -> T {
|
||||
guard let returnValue = object as? T else {
|
||||
throw RxCocoaError.CastingError(object: object, targetType: resultType)
|
||||
throw RxCocoaError.castingError(object: object, targetType: resultType)
|
||||
}
|
||||
|
||||
return returnValue
|
||||
}
|
||||
|
||||
func castOptionalOrThrow<T>(resultType: T.Type, _ object: AnyObject) throws -> T? {
|
||||
func castOptionalOrThrow<T>(_ resultType: T.Type, _ object: AnyObject) throws -> T? {
|
||||
if NSNull().isEqual(object) {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard let returnValue = object as? T else {
|
||||
throw RxCocoaError.CastingError(object: object, targetType: resultType)
|
||||
throw RxCocoaError.castingError(object: object, targetType: resultType)
|
||||
}
|
||||
|
||||
return returnValue
|
||||
}
|
||||
|
||||
func castOrFatalError<T>(value: AnyObject!, message: String) -> T {
|
||||
func castOrFatalError<T>(_ value: AnyObject!, message: String) -> T {
|
||||
let maybeResult: T? = value as? T
|
||||
guard let result = maybeResult else {
|
||||
rxFatalError(message)
|
||||
|
|
@ -278,7 +278,7 @@ func castOrFatalError<T>(value: AnyObject!, message: String) -> T {
|
|||
return result
|
||||
}
|
||||
|
||||
func castOrFatalError<T>(value: Any!) -> T {
|
||||
func castOrFatalError<T>(_ value: Any!) -> T {
|
||||
let maybeResult: T? = value as? T
|
||||
guard let result = maybeResult else {
|
||||
rxFatalError("Failure converting from \(value) to \(T.self)")
|
||||
|
|
@ -296,35 +296,37 @@ let delegateNotSet = "Delegate not set"
|
|||
|
||||
// MARK: Conversions `NSError` > `RxCocoaObjCRuntimeError`
|
||||
|
||||
extension NSError {
|
||||
func rxCocoaErrorForTarget(target: AnyObject) -> RxCocoaObjCRuntimeError {
|
||||
if domain == RXObjCRuntimeErrorDomain {
|
||||
let errorCode = RXObjCRuntimeError(rawValue: self.code) ?? .Unknown
|
||||
|
||||
extension Error {
|
||||
func rxCocoaErrorForTarget(_ target: AnyObject) -> RxCocoaObjCRuntimeError {
|
||||
let error = self as NSError
|
||||
|
||||
if error.domain == RXObjCRuntimeErrorDomain {
|
||||
let errorCode = RXObjCRuntimeError(rawValue: error.code) ?? .unknown
|
||||
|
||||
switch errorCode {
|
||||
case .Unknown:
|
||||
return .Unknown(target: target)
|
||||
case .ObjectMessagesAlreadyBeingIntercepted:
|
||||
let isKVO = (self.userInfo[RXObjCRuntimeErrorIsKVOKey] as? NSNumber)?.boolValue ?? false
|
||||
return .ObjectMessagesAlreadyBeingIntercepted(target: target, interceptionMechanism: isKVO ? .KVO : .Unknown)
|
||||
case .SelectorNotImplemented:
|
||||
return .SelectorNotImplemented(target: target)
|
||||
case .CantInterceptCoreFoundationTollFreeBridgedObjects:
|
||||
return .CantInterceptCoreFoundationTollFreeBridgedObjects(target: target)
|
||||
case .ThreadingCollisionWithOtherInterceptionMechanism:
|
||||
return .ThreadingCollisionWithOtherInterceptionMechanism(target: target)
|
||||
case .SavingOriginalForwardingMethodFailed:
|
||||
return .SavingOriginalForwardingMethodFailed(target: target)
|
||||
case .ReplacingMethodWithForwardingImplementation:
|
||||
return .ReplacingMethodWithForwardingImplementation(target: target)
|
||||
case .ObservingPerformanceSensitiveMessages:
|
||||
return .ObservingPerformanceSensitiveMessages(target: target)
|
||||
case .ObservingMessagesWithUnsupportedReturnType:
|
||||
return .ObservingMessagesWithUnsupportedReturnType(target: target)
|
||||
case .unknown:
|
||||
return .unknown(target: target)
|
||||
case .objectMessagesAlreadyBeingIntercepted:
|
||||
let isKVO = (error.userInfo[RXObjCRuntimeErrorIsKVOKey] as? NSNumber)?.boolValue ?? false
|
||||
return .objectMessagesAlreadyBeingIntercepted(target: target, interceptionMechanism: isKVO ? .kvo : .unknown)
|
||||
case .selectorNotImplemented:
|
||||
return .selectorNotImplemented(target: target)
|
||||
case .cantInterceptCoreFoundationTollFreeBridgedObjects:
|
||||
return .cantInterceptCoreFoundationTollFreeBridgedObjects(target: target)
|
||||
case .threadingCollisionWithOtherInterceptionMechanism:
|
||||
return .threadingCollisionWithOtherInterceptionMechanism(target: target)
|
||||
case .savingOriginalForwardingMethodFailed:
|
||||
return .savingOriginalForwardingMethodFailed(target: target)
|
||||
case .replacingMethodWithForwardingImplementation:
|
||||
return .replacingMethodWithForwardingImplementation(target: target)
|
||||
case .observingPerformanceSensitiveMessages:
|
||||
return .observingPerformanceSensitiveMessages(target: target)
|
||||
case .observingMessagesWithUnsupportedReturnType:
|
||||
return .observingMessagesWithUnsupportedReturnType(target: target)
|
||||
}
|
||||
}
|
||||
|
||||
return RxCocoaObjCRuntimeError.Unknown(target: target)
|
||||
|
||||
return RxCocoaObjCRuntimeError.unknown(target: target)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -335,7 +337,7 @@ extension NSError {
|
|||
|
||||
#if !RX_NO_MODULE
|
||||
|
||||
@noreturn func rxFatalError(lastMessage: String) {
|
||||
func rxFatalError(_ lastMessage: String) -> Never {
|
||||
// The temptation to comment this line is great, but please don't, it's for your own good. The choice is yours.
|
||||
fatalError(lastMessage)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,4 +41,4 @@ class RxTarget : NSObject
|
|||
OSAtomicDecrement32(&resourceCount)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
//
|
||||
// RxTextInput.swift
|
||||
// Rx
|
||||
//
|
||||
// Created by Krunoslav Zaher on 5/12/16.
|
||||
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
#if os(iOS) || os(tvOS)
|
||||
import UIKit
|
||||
|
||||
/**
|
||||
Represents text input with reactive extensions.
|
||||
*/
|
||||
public protocol RxTextInput : UITextInput {
|
||||
|
||||
/**
|
||||
Reactive wrapper for `text` property.
|
||||
*/
|
||||
var rx_text: ControlProperty<String> { get }
|
||||
}
|
||||
#endif
|
||||
|
||||
#if os(OSX)
|
||||
import Cocoa
|
||||
|
||||
/**
|
||||
Represents text input with reactive extensions.
|
||||
*/
|
||||
public protocol RxTextInput : NSTextInput {
|
||||
|
||||
/**
|
||||
Reactive wrapper for `text` property.
|
||||
*/
|
||||
var rx_text: ControlProperty<String> { get }
|
||||
}
|
||||
#endif
|
||||
|
|
@ -20,5 +20,20 @@ public protocol SectionedViewDataSourceType {
|
|||
- parameter indexPath: Model index path
|
||||
- returns: Model at index path.
|
||||
*/
|
||||
func modelAtIndexPath(indexPath: NSIndexPath) throws -> Any
|
||||
}
|
||||
func model(_ indexPath: IndexPath) throws -> Any
|
||||
}
|
||||
|
||||
extension SectionedViewDataSourceType {
|
||||
/**
|
||||
Returns model at index path.
|
||||
|
||||
In case data source doesn't contain any sections when this method is being called, `RxCocoaError.ItemsNotYetBound(object: self)` is thrown.
|
||||
|
||||
- parameter indexPath: Model index path
|
||||
- returns: Model at index path.
|
||||
*/
|
||||
@available(*, deprecated, renamed: "model(_:)")
|
||||
func model(_ indexPath: IndexPath) throws -> Any {
|
||||
return try self.model(indexPath)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,147 @@
|
|||
//
|
||||
// TextInput.swift
|
||||
// Rx
|
||||
//
|
||||
// Created by Krunoslav Zaher on 5/12/16.
|
||||
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
#if os(iOS) || os(tvOS)
|
||||
import UIKit
|
||||
|
||||
/**
|
||||
Represents text input with reactive extensions.
|
||||
*/
|
||||
public struct TextInput<Base: UITextInput> {
|
||||
/**
|
||||
Base text input to extend.
|
||||
*/
|
||||
public let base: Base
|
||||
|
||||
/**
|
||||
Reactive wrapper for `text` property.
|
||||
*/
|
||||
public let text: ControlProperty<String>
|
||||
|
||||
/**
|
||||
Initializes new text input.
|
||||
|
||||
- parameter base: Base object.
|
||||
- parameter text: Textual control property.
|
||||
*/
|
||||
public init(base: Base, text: ControlProperty<String>) {
|
||||
self.base = base
|
||||
self.text = text
|
||||
}
|
||||
}
|
||||
|
||||
extension Reactive where Base: UITextField {
|
||||
/**
|
||||
Reactive text input.
|
||||
*/
|
||||
public var textInput: TextInput<UITextField> {
|
||||
return TextInput(base: base, text: self.text)
|
||||
}
|
||||
}
|
||||
|
||||
extension Reactive where Base: UITextView {
|
||||
/**
|
||||
Reactive text input.
|
||||
*/
|
||||
public var textInput: TextInput<UITextView> {
|
||||
return TextInput(base: base, text: self.text)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Represents text input with reactive extensions.
|
||||
*/
|
||||
@available(*, deprecated, renamed: "TextInput")
|
||||
public protocol RxTextInput : UITextInput {
|
||||
@available(*, deprecated, renamed: "rx.textInput.text")
|
||||
var rx_text: ControlProperty<String> { get }
|
||||
}
|
||||
|
||||
extension UITextField : RxTextInput {
|
||||
@available(*, deprecated, renamed: "rx.textInput.text")
|
||||
public var rx_text: ControlProperty<String> {
|
||||
return self.rx.text
|
||||
}
|
||||
}
|
||||
|
||||
extension UITextView : RxTextInput {
|
||||
@available(*, deprecated, renamed: "rx.textInput.text")
|
||||
public var rx_text: ControlProperty<String> {
|
||||
return self.rx.text
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#if os(OSX)
|
||||
import Cocoa
|
||||
|
||||
/**
|
||||
Represents text input with reactive extensions.
|
||||
*/
|
||||
public struct TextInput<Base: NSTextInput> {
|
||||
/**
|
||||
Base text input to extend.
|
||||
*/
|
||||
public let base: Base
|
||||
|
||||
/**
|
||||
Reactive wrapper for `text` property.
|
||||
*/
|
||||
public let text: ControlProperty<String>
|
||||
|
||||
/**
|
||||
Initializes new text input.
|
||||
|
||||
- parameter base: Base object.
|
||||
- parameter text: Textual control property.
|
||||
*/
|
||||
public init(base: Base, text: ControlProperty<String>) {
|
||||
self.base = base
|
||||
self.text = text
|
||||
}
|
||||
}
|
||||
|
||||
extension Reactive where Base: NSTextField {
|
||||
/**
|
||||
Reactive text input.
|
||||
*/
|
||||
public var textInput: TextInput<NSTextField> {
|
||||
return TextInput(base: base, text: self.text)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Represents text input with reactive extensions.
|
||||
*/
|
||||
@available(*, deprecated, renamed: "TextInput")
|
||||
public protocol RxTextInput : NSTextInput {
|
||||
|
||||
/**
|
||||
Reactive wrapper for `text` property.
|
||||
*/
|
||||
@available(*, deprecated, renamed: "rx.textInput.text")
|
||||
var rx_text: ControlProperty<String> { get }
|
||||
}
|
||||
|
||||
extension NSTextField : RxTextInput {
|
||||
/**
|
||||
Reactive wrapper for `text` property.
|
||||
*/
|
||||
@available(*, deprecated, renamed: "rx.textInput.text")
|
||||
public var rx_text: ControlProperty<String> {
|
||||
return self.rx.text
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -32,6 +32,12 @@
|
|||
#define CLASS_VALUE(x) [NSValue valueWithNonretainedObject:(x)]
|
||||
#define IMP_VALUE(x) [NSValue valueWithPointer:(x)]
|
||||
|
||||
/**
|
||||
Checks that the local `error` instance exists before assigning it's value by reference.
|
||||
This macro exists to work around static analysis warnings — `NSError` is always assumed to be `nullable`, even though we explictly define the method parameter as `nonnull`. See http://www.openradar.me/21766176 for more details.
|
||||
*/
|
||||
#define RX_SAFE_ERROR(errorValue) if (error != nil) { *error = (errorValue); }
|
||||
|
||||
// Inspired by http://p99.gforge.inria.fr
|
||||
|
||||
// https://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC26
|
||||
|
|
|
|||
|
|
@ -8,14 +8,18 @@
|
|||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface _RXDelegateProxy : NSObject
|
||||
|
||||
@property (nonatomic, assign, readonly) id _forwardToDelegate;
|
||||
@property (nonatomic, weak, readonly) id _forwardToDelegate;
|
||||
|
||||
-(void)_setForwardToDelegate:(id)forwardToDelegate retainDelegate:(BOOL)retainDelegate;
|
||||
-(void)_setForwardToDelegate:(id __nullable)forwardToDelegate retainDelegate:(BOOL)retainDelegate;
|
||||
|
||||
-(BOOL)hasWiredImplementationForSelector:(SEL)selector;
|
||||
|
||||
-(void)interceptedSelector:(SEL)selector withArguments:(NSArray*)arguments;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@
|
|||
#import "_RX.h"
|
||||
#import "_RXObjCRuntime.h"
|
||||
|
||||
@interface _RXDelegateProxy ()
|
||||
@interface _RXDelegateProxy () {
|
||||
id __weak __forwardToDelegate;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) id strongForwardDelegate;
|
||||
|
||||
|
|
@ -58,7 +60,7 @@ static NSMutableDictionary *forwardableSelectorsPerClass = nil;
|
|||
#define CLASS_HIERARCHY_MAX_DEPTH 100
|
||||
|
||||
NSInteger classHierarchyDepth = 0;
|
||||
Class targetClass = self;
|
||||
Class targetClass = NULL;
|
||||
|
||||
for (classHierarchyDepth = 0, targetClass = self;
|
||||
classHierarchyDepth < CLASS_HIERARCHY_MAX_DEPTH && targetClass != nil;
|
||||
|
|
@ -90,7 +92,11 @@ static NSMutableDictionary *forwardableSelectorsPerClass = nil;
|
|||
|
||||
}
|
||||
|
||||
-(void)_setForwardToDelegate:(id)forwardToDelegate retainDelegate:(BOOL)retainDelegate {
|
||||
-(id)_forwardToDelegate {
|
||||
return __forwardToDelegate;
|
||||
}
|
||||
|
||||
-(void)_setForwardToDelegate:(id __nullable)forwardToDelegate retainDelegate:(BOOL)retainDelegate {
|
||||
__forwardToDelegate = forwardToDelegate;
|
||||
if (retainDelegate) {
|
||||
self.strongForwardDelegate = forwardToDelegate;
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@
|
|||
################################################################################
|
||||
*/
|
||||
|
||||
typedef void (^KVOCallback)(id);
|
||||
|
||||
// Exists because if written in Swift, reading unowned is disabled during dealloc process
|
||||
@interface _RXKVOObserver : NSObject
|
||||
|
||||
|
|
@ -23,7 +21,7 @@ typedef void (^KVOCallback)(id);
|
|||
retainTarget:(BOOL)retainTarget
|
||||
keyPath:(NSString*)keyPath
|
||||
options:(NSKeyValueObservingOptions)options
|
||||
callback:(KVOCallback)callback;
|
||||
callback:(void (^)(id))callback;
|
||||
|
||||
-(void)dispose;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
@property (nonatomic, unsafe_unretained) id target;
|
||||
@property (nonatomic, strong ) id retainedTarget;
|
||||
@property (nonatomic, copy ) NSString *keyPath;
|
||||
@property (nonatomic, copy ) KVOCallback callback;
|
||||
@property (nonatomic, copy ) void (^callback)(id);
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -596,9 +596,9 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
-(IMP __nullable)ensurePrepared:(id __nonnull)target forObserving:(SEL __nonnull)selector error:(NSError** __nonnull)error {
|
||||
Method instanceMethod = class_getInstanceMethod([target class], selector);
|
||||
if (instanceMethod == nil) {
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorSelectorNotImplemented
|
||||
userInfo:nil];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorSelectorNotImplemented
|
||||
userInfo:nil]);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
@ -606,18 +606,18 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
|| selector == @selector(forwardingTargetForSelector:)
|
||||
|| selector == @selector(methodSignatureForSelector:)
|
||||
|| selector == @selector(respondsToSelector:)) {
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorObservingPerformanceSensitiveMessages
|
||||
userInfo:nil];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorObservingPerformanceSensitiveMessages
|
||||
userInfo:nil]);
|
||||
return nil;
|
||||
}
|
||||
|
||||
// For `dealloc` message, original implementation will be swizzled.
|
||||
// This is a special case because observing `dealloc` message is performed when `rx_observeWeakly` is used.
|
||||
// This is a special case because observing `dealloc` message is performed when `observeWeakly` is used.
|
||||
//
|
||||
// Some toll free bridged classes don't handle `object_setClass` well and cause crashes.
|
||||
//
|
||||
// To make `rx_deallocating` as robust as possible, original implementation will be replaced.
|
||||
// To make `deallocating` as robust as possible, original implementation will be replaced.
|
||||
if (selector == deallocSelector) {
|
||||
Class __nonnull deallocSwizzingTarget = [target class];
|
||||
IMP interceptorIMPForSelector = [self interceptorImplementationForSelector:selector forClass:deallocSwizzingTarget];
|
||||
|
|
@ -644,9 +644,9 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
RXInterceptWithOptimizedObserver optimizedIntercept = optimizedObserversByMethodEncoding[methodEncoding];
|
||||
|
||||
if (!RX_method_has_supported_return_type(instanceMethod)) {
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorObservingMessagesWithUnsupportedReturnType
|
||||
userInfo:nil];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorObservingMessagesWithUnsupportedReturnType
|
||||
userInfo:nil]);
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
|
@ -686,10 +686,9 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorUnknown
|
||||
userInfo:nil];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorUnknown
|
||||
userInfo:nil]);
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
|
@ -711,9 +710,9 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
BOOL isThisTollFreeFoundationClass = CFGetTypeID((CFTypeRef)target) != defaultTypeID;
|
||||
|
||||
if (isThisTollFreeFoundationClass) {
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorCantInterceptCoreFoundationTollFreeBridgedObjects
|
||||
userInfo:nil];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorCantInterceptCoreFoundationTollFreeBridgedObjects
|
||||
userInfo:nil]);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
@ -721,9 +720,9 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
If the object is reporting a different class then what it's real class, that means that there is probably
|
||||
already some interception mechanism in place or something weird is happening.
|
||||
|
||||
Most common case when this would happen is when using KVO (`rx_observe`) and `rx_sentMessage`.
|
||||
Most common case when this would happen is when using KVO (`observe`) and `sentMessage`.
|
||||
|
||||
This error is easily resolved by just using `rx_sentMessage` observing before `rx_observe`.
|
||||
This error is easily resolved by just using `sentMessage` observing before `observe`.
|
||||
|
||||
The reason why other way around could create issues is because KVO will unregister it's interceptor
|
||||
class and restore original class. Unfortunately that will happen no matter was there another interceptor
|
||||
|
|
@ -731,7 +730,7 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
|
||||
Failure scenario:
|
||||
* KVO sets class to be `__KVO__OriginalClass` (subclass of `OriginalClass`)
|
||||
* `rx_sentMessage` sets object class to be `_RX_namespace___KVO__OriginalClass` (subclass of `__KVO__OriginalClass`)
|
||||
* `sentMessage` sets object class to be `_RX_namespace___KVO__OriginalClass` (subclass of `__KVO__OriginalClass`)
|
||||
* then unobserving with KVO will restore class to be `OriginalClass` -> failure point
|
||||
|
||||
The reason why changing order of observing works is because any interception method should return
|
||||
|
|
@ -745,11 +744,11 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
if ([target class] != object_getClass(target)) {
|
||||
BOOL isKVO = [target respondsToSelector:NSSelectorFromString(@"_isKVOA")];
|
||||
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorObjectMessagesAlreadyBeingIntercepted
|
||||
userInfo:@{
|
||||
RXObjCRuntimeErrorIsKVOKey: @(isKVO)
|
||||
}];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorObjectMessagesAlreadyBeingIntercepted
|
||||
userInfo:@{
|
||||
RXObjCRuntimeErrorIsKVOKey : @(isKVO)
|
||||
}]);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
@ -761,9 +760,9 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
|
||||
Class previousClass = object_setClass(target, dynamicFakeSubclass);
|
||||
if (previousClass != wannaBeClass) {
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorThreadingCollisionWithOtherInterceptionMechanism
|
||||
userInfo:nil];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorThreadingCollisionWithOtherInterceptionMechanism
|
||||
userInfo:nil]);
|
||||
THREADING_HAZARD(wannaBeClass);
|
||||
return nil;
|
||||
}
|
||||
|
|
@ -816,25 +815,25 @@ static NSMutableDictionary<NSString *, RXInterceptWithOptimizedObserver> *optimi
|
|||
IMP implementation = method_getImplementation(instanceMethod);
|
||||
|
||||
if (implementation == nil) {
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorSelectorNotImplemented
|
||||
userInfo:nil];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorSelectorNotImplemented
|
||||
userInfo:nil]);
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (!class_addMethod(swizzlingImplementorClass, rxSelector, implementation, methodEncoding)) {
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorSavingOriginalForwardingMethodFailed
|
||||
userInfo:nil];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorSavingOriginalForwardingMethodFailed
|
||||
userInfo:nil]);
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (!class_addMethod(swizzlingImplementorClass, selector, _objc_msgForward, methodEncoding)) {
|
||||
if (implementation != method_setImplementation(instanceMethod, _objc_msgForward)) {
|
||||
*error = [NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorReplacingMethodWithForwardingImplementation
|
||||
userInfo:nil];
|
||||
RX_SAFE_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain
|
||||
code:RXObjCRuntimeErrorReplacingMethodWithForwardingImplementation
|
||||
userInfo:nil]);
|
||||
THREADING_HAZARD(swizzlingImplementorClass);
|
||||
return NO;
|
||||
}
|
||||
|
|
@ -1018,4 +1017,4 @@ NSInteger RX_number_of_swizzled_methods() {
|
|||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue