Compare commits

...

1506 Commits

Author SHA1 Message Date
Stanislav Kaluzhnyi 8b07d0cbde Collection view's reload data has been changed to reload sections 2016-09-07 17:22:52 +04:00
Krunoslav Zaher 2969fbe70d Fixes for issue template. 2016-08-27 12:45:03 +02:00
Krunoslav Zaher 6ed8c6c00d Updates issue template. 2016-08-27 12:41:04 +02:00
Krunoslav Zaher de28113c06 Updates README.md with Swift 2.3 version. 2016-08-27 12:33:10 +02:00
Krunoslav Zaher 08501da396 Merge pull request #848 from damianesteban/fix/readme-carthage-directions
Fix carthage directions in readme
2016-08-25 18:16:48 +02:00
Damian Esteban e85b3203bc Fix carthage directions in readme 2016-08-25 12:08:43 -04:00
Krunoslav Zaher 900035d78b Fixes deprecated warnings. 2016-08-21 19:26:15 +02:00
Krunoslav Zaher ef71ba9f20 Updates requirements section in README.md 2016-08-21 18:45:44 +02:00
Krunoslav Zaher 72122e3e43 Updates documentation for 3.0.0.alpha.1 2016-08-21 18:40:08 +02:00
Krunoslav Zaher 87b792e54d Adds 3.0.0.alpha.1 changes to CHANGELOG. 2016-08-21 17:17:35 +02:00
Krunoslav Zaher 8cebcd786f Excludes table and collection view deprecated APIs from watchOS. 2016-08-21 15:20:57 +02:00
Krunoslav Zaher 7208a8d1cc Improves deprecation messages for table and collection views. #841 2016-08-21 15:09:14 +02:00
Krunoslav Zaher e1f72cb566 Improves version detection. 2016-08-21 03:49:56 +02:00
Krunoslav Zaher 154ac2583d Release 3.0.0.alpha.1 2016-08-21 03:44:23 +02:00
Krunoslav Zaher 136322ab6a Moves OSX example app to top of validate script. 2016-08-21 03:41:44 +02:00
Krunoslav Zaher 24c4587b51 Fixes playgrounds. 2016-08-21 03:27:07 +02:00
Krunoslav Zaher 22219781a5 Adds skip UI tests flag. 2016-08-21 02:09:40 +02:00
Krunoslav Zaher 48bb9fcba5 Adds skip automation flags. 2016-08-21 02:06:40 +02:00
Krunoslav Zaher 7f43e1eecd Temporary disables example failing tests. ¯\_(ツ)_/¯ 2016-08-21 00:24:15 +02:00
Krunoslav Zaher f8d8c45f10 Sprinkles of workarounds for Apple bugs. 2016-08-20 23:25:49 +02:00
Krunoslav Zaher 92d4bdf5e1 Changes order of pre-release tests. 2016-08-20 23:06:30 +02:00
Krunoslav Zaher ff6e4fd651 Removes old automation tests. 2016-08-20 23:02:59 +02:00
Krunoslav Zaher b68fc4260e Adds UITests. 2016-08-20 22:59:34 +02:00
Krunoslav Zaher c9742e51b6 Removes Float80 extensions. 2016-08-20 03:13:41 +02:00
Krunoslav Zaher 1f363cea2e Updates project signing. 2016-08-20 03:12:59 +02:00
Krunoslav Zaher 83f3323ed8 Sets validation to use custom CocoaPods build. 2016-08-20 02:58:18 +02:00
Krunoslav Zaher 278c681753 Fixes UICollectionView deprecation warning. 2016-08-19 15:57:46 +02:00
Krunoslav Zaher 9b1f22e6a0 Fixes deprecated rename for `NopDisposable`. 2016-08-19 15:34:22 +02:00
Krunoslav Zaher 9473953b65 Fixes compilation issues with RxExample-iOS tests. 2016-08-19 02:05:41 +02:00
Krunoslav Zaher 1998e54085 Fixes RxCocoa compilation issues. 2016-08-19 01:59:06 +02:00
Krunoslav Zaher 94d6c01e3b Enables testability. 2016-08-19 01:49:57 +02:00
Krunoslav Zaher a4f15128bf Deprecates `RxTextInput` in favor of `TextInput`. 2016-08-19 01:46:27 +02:00
Krunoslav Zaher 5610073ca9 Adds comments to `Reactive`. 2016-08-19 01:46:09 +02:00
Krunoslav Zaher 9ce054936d Merge branch 'swift-3.0-removing-rx_-prefix' of https://github.com/JegnuX/RxSwift into JegnuX-swift-3.0-removing-rx_-prefix 2016-08-19 00:45:51 +02:00
Krunoslav Zaher 4bd842301b Merge pull request #835 from mohsenr/xcode8-beta6
[Swift 3.0] Fixes for Xcode8 beta6
2016-08-18 00:14:51 +02:00
Mo Ramezanpoor 0fe4c9a792 Fixes RxExample. 2016-08-17 09:49:29 +01:00
Mo Ramezanpoor b9b593d740 Adds a nullability annotation to `_RXDelegateProxy`.
`AllTests` now passes.
2016-08-17 09:28:56 +01:00
Krunoslav Zaher 6763f1a4b7 Replaces `open` with `public`. 2016-08-16 22:10:41 +02:00
Mo Ramezanpoor d43e717415 WIP: AllTests compiles. 2016-08-16 16:09:08 +01:00
Mo Ramezanpoor 819635d9aa Fixes RxTests. 2016-08-16 15:36:44 +01:00
Mo Ramezanpoor b0026d65eb Fixes RxCocoa for macOS. 2016-08-16 15:36:20 +01:00
Mo Ramezanpoor 695ea19e02 WIP: Fixes warnings in RxCocoa. 2016-08-16 15:31:51 +01:00
Mo Ramezanpoor e55c6675f4 Removes the KVOCallback type alias.
The compiler wouldn’t recognise that it should be imported as escaping.
2016-08-16 15:13:47 +01:00
Mo Ramezanpoor 301ad9f438 WIP: Fix a bunch of RxCocoa compilation issues. 2016-08-16 15:01:07 +01:00
Mo Ramezanpoor 047c77a698 WIP: Removes a call to `unsafeAddress(of:)`. 2016-08-16 14:28:35 +01:00
Mo Ramezanpoor a2be331fee WIP: Fixes signature of `ReplaySubject.create()`. 2016-08-16 14:25:57 +01:00
Mo Ramezanpoor 2d36297601 WIP: Marks escaping closures as such. 2016-08-16 14:25:15 +01:00
Mo Ramezanpoor c12b315149 WIP: Fixes private access issues. 2016-08-16 14:25:01 +01:00
Mo Ramezanpoor 74464a4940 WIP: Clarifies references to `Swift.Never`. 2016-08-16 14:01:52 +01:00
Mo Ramezanpoor fcf8e4d092 WIP: Updates code for Xcode 8 beta 6 using the migrator with manual auditing.
The code doesn’t compile yet.
2016-08-16 14:00:14 +01:00
Jérôme Alves 43c0b952ec Remove `AnyObject` constraint and add a new protocol `ReactiveCompatible` to mark types which should be extended with the `rx` var. 2016-08-16 10:47:26 +02:00
Jérôme Alves 96ef70cc2f Update documentation (.md files) 2016-08-16 09:05:24 +02:00
Krunoslav Zaher 7adc86f7d2 Adds `onSubscribe` and `onDispose` for `do` operator. #583 2016-08-16 00:03:30 +02:00
Jérôme Alves cbb0ed5d29 Merge branch 'swift-3.0' into swift-3.0-removing-rx_-prefix 2016-08-15 19:19:22 +02:00
Krunoslav Zaher e2f4bad2bb Merge pull request #831 from JegnuX/swift-3.0-type-fix
[Swift 3.0] Fix ActivityToken dispose type.
2016-08-15 18:57:08 +02:00
Jérôme Alves 7f65914f93 Fix ActivityToken dispose type. 2016-08-15 17:53:13 +02:00
Jérôme Alves e59adc3ae9 Updates Unit Tests and makes them succeed. 2016-08-15 17:46:13 +02:00
Jérôme Alves e4e422c4f1 Merge branch 'swift-3.0' into swift-3.0-removing-rx_-prefix
Conflicts:
	RxCocoa/Common/Observables/NSNotificationCenter+Rx.swift
	RxCocoa/OSX/NSImageView+Rx.swift
	RxCocoa/iOS/UICollectionView+Rx.swift
	RxCocoa/iOS/UIControl+Rx.swift
	RxCocoa/iOS/UIImageView+Rx.swift
	RxCocoa/iOS/UILabel+Rx.swift
	RxCocoa/iOS/UITableView+Rx.swift
	RxExample/RxDataSources/DataSources+Rx/UISectionedViewType+RxAnimatedDataSource.swift
	RxExample/RxExample/Examples/APIWrappers/APIWrappersViewController.swift
	RxExample/RxExample/Examples/GitHubSearchRepositories/GitHubSearchRepositoriesViewController.swift
	RxExample/RxExample/Examples/GitHubSignup/UsingDriver/GitHubSignupViewController2.swift
	RxExample/RxExample/Examples/GitHubSignup/UsingVanillaObservables/GitHubSignupViewController1.swift
	RxExample/RxExample/Examples/ImagePicker/UIImagePickerController+RxCreate.swift
	RxExample/RxExample/Examples/OSX simple example/IntroductionExampleViewController.swift
	RxExample/RxExample/Examples/SimpleTableViewExample/SimpleTableViewExampleViewController.swift
	RxExample/RxExample/Examples/SimpleTableViewExampleSectioned/SimpleTableViewExampleSectionedViewController.swift
	RxExample/RxExample/Examples/SimpleValidation/SimpleValidationViewController.swift
	RxExample/RxExample/Examples/TableViewPartialUpdates/PartialUpdatesViewController.swift
	RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift
	RxExample/RxExample/Examples/WikipediaImageSearch/Views/WikipediaSearchCell.swift
	RxExample/RxExample/Examples/WikipediaImageSearch/Views/WikipediaSearchViewController.swift
	Tests/RxCocoaTests/DelegateProxyTest.swift
	Tests/RxCocoaTests/KVOObservableTests.swift
	Tests/RxCocoaTests/RxTest+Controls.swift
	Tests/RxCocoaTests/UICollectionView+RxTests.swift
	Tests/RxCocoaTests/UIScrollView+RxTests.swift
	Tests/RxCocoaTests/UITableView+RxTests.swift
2016-08-15 12:17:26 +02:00
Krunoslav Zaher 4f54c9bf5a Merge branch 'swift-3.0' of github.com:kzaher/RxSwift into swift-3.0 2016-08-15 01:12:21 +02:00
Krunoslav Zaher 8b00921da7 Merge branch 'develop' into swift-3.0 2016-08-15 01:08:36 +02:00
Krunoslav Zaher bdbcb5bc87 Improves UITableView and UICollection view bindings behavior. 2016-08-14 23:25:54 +02:00
Krunoslav Zaher 55f4bb3b65 Merge pull request #828 from mohsenr/swift-3.0-disposables-rebased
[Swift 3.0] Collect all immutable Disposable constructors in `Disposables` type
2016-08-10 23:06:45 +02:00
Mo Ramezanpoor f1b4e0f6b7 Merge with 'swift-3.0' 2016-08-10 15:24:27 +01:00
Mo Ramezanpoor f8a11aa0cb Document `Disposables`. 2016-08-10 15:16:58 +01:00
Mo Ramezanpoor 8754166f35 Hides `Disposables.init()` internally by making it private. 2016-08-10 15:03:52 +01:00
Mo Ramezanpoor 75971c61c6 Replaces all calls to `AnonymousDisposable.init()` with `Disposables.create()`. 2016-08-10 15:00:29 +01:00
Mo Ramezanpoor c643d4c0b5 Returns `Cancelable` instead of `Disposable` from all overloads of `Disposables.create()` except for no-op (which is stateless). 2016-08-10 15:00:02 +01:00
Mo Ramezanpoor 64526c8dcd Replaces all calls to `StableCompositeDisposable.create()` with `Disposables.create()`. 2016-08-10 14:49:21 +01:00
Mo Ramezanpoor 1fe15bb9da Replaces all calls to `NopDisposable.instance` with `Disposables.create()`. 2016-08-10 14:47:53 +01:00
Mo Ramezanpoor a981d4caab Overloads `Disposables.create()` with a version accepting variadics after the third argument. 2016-08-10 14:43:51 +01:00
Mo Ramezanpoor 6d17e711ab Changes implementation of two overloads of `Disposables.create()` to avoid deprecation warnings. 2016-08-10 14:33:39 +01:00
Mo Ramezanpoor 341ef8fc3b Rename `Disposables.empty()` to `.create()`. 2016-08-10 14:28:13 +01:00
Mo Ramezanpoor 2812da1f5e Replace immutable initialisations of `CompositeDisposable` with `Disposables.create()`.
The factory methods will select specialised implementations based on the case.
2016-08-10 14:27:45 +01:00
Krunoslav Zaher 2498b3194d Merge pull request #829 from rhx/swift-3.0
Update for Xcode 8 beta 5
2016-08-10 15:04:12 +02:00
Rene Hexel 2e4b6990e8 Update for Xcode 8 beta 5 2016-08-10 09:45:23 +10:00
Krunoslav Zaher 6eda820476 Merge pull request #827 from mohsenr/swift-3.0-isDisposed
[Swift 3.0] Renames `disposed` to `isDisposed`
2016-08-09 21:34:53 +02:00
Mo Ramezanpoor 2df8c43077 Deprecates `StableCompositeDisposable.create()` in favour of `Disposables.create()`. 2016-08-09 10:45:29 +01:00
Mo Ramezanpoor ac876f35db Deprecates `AnonymousDisposable.init` in favour of `Disposables.create()`. 2016-08-09 10:34:43 +01:00
Mo Ramezanpoor 0058d2ff67 Deprecates `NopDisposable.instance` in favour of `Disposables.empty()`. 2016-08-09 10:32:35 +01:00
Mo Ramezanpoor 23ae9692e7 Change Disposables.empty from a property to a method to mirror `Observable.empty()`. 2016-08-09 10:30:18 +01:00
Mo Ramezanpoor eb646a97a6 Makes `BinaryDisposable` private.
Uses `Disposables.create()` instead.
2016-08-09 10:24:02 +01:00
Mo Ramezanpoor b0a819981b Implement `Cancelable.disposed` as an extension. 2016-08-09 10:12:55 +01:00
Mo Ramezanpoor d3eacdfcb5 BinaryDisposable is no longer public. 2016-08-09 10:05:49 +01:00
Mo Ramezanpoor dbc635d6e7 Create Disposables type. 2016-08-09 09:55:11 +01:00
Mo Ramezanpoor cb5d23c757 Removes defunct NAryDisposable.(swift|tt) files. 2016-08-09 09:54:39 +01:00
Mo Ramezanpoor 38e5a500c7 Makes some disposable classes marked as final. 2016-08-09 09:54:20 +01:00
Mo Ramezanpoor 6887745089 Renames `MySubject.diposed` (with a typo) to `.isDisposed`. 2016-08-09 09:50:36 +01:00
Mo Ramezanpoor e530858bd0 Renames `disposed` to `isDisposed` in any place that it makes semantically. 2016-08-09 09:50:13 +01:00
Jérôme Alves 10ff55cfba Moves RxCocoa extensions from `rx_` syntax to `rx.` syntax.
The main work is done in this commit but the feature it's still "work in progress"
2016-08-09 00:17:38 +02:00
Krunoslav Zaher 46286d3291 Bumps up podspec OSX minimal version to 10.10. #791 2016-08-07 20:27:31 +02:00
Krunoslav Zaher aef4e69339 Modernizes APIs. 2016-08-07 20:14:19 +02:00
Krunoslav Zaher 3637153169 Fixes warnings. 2016-08-07 18:59:36 +02:00
Krunoslav Zaher 8a58deaa2b Deprecates `toObservable` in favor of `from` operator. 2016-08-07 18:54:23 +02:00
Krunoslav Zaher 441a4a22db Modernizes doOn operator. 2016-08-07 18:24:33 +02:00
Krunoslav Zaher d1cde77b18 Modernizes image view extensions. 2016-08-07 18:08:13 +02:00
Krunoslav Zaher afd40f5d8b Modernizes UICollectionView extensions. 2016-08-07 16:48:25 +02:00
Krunoslav Zaher 1b0e0a3c88 Updates RxDataSources. 2016-08-07 16:12:16 +02:00
Krunoslav Zaher 10b0d39e05 Fixes warnings. 2016-08-07 16:04:47 +02:00
Krunoslav Zaher 091b12242a Merge branch 'master' into swift-3.0 2016-08-07 15:28:44 +02:00
Krunoslav Zaher 4b602fd88e Merge remote-tracking branch 'origin/master' into develop 2016-08-07 15:27:58 +02:00
Krunoslav Zaher 2f06600985 Merge pull request #823 from vburojevic/typos
Typo in Getting Started
2016-08-07 15:27:31 +02:00
Krunoslav Zaher 8e01b2ffe4 Merge pull request #820 from tqtifnypmb/master
Typo
2016-08-07 15:27:09 +02:00
Krunoslav Zaher 9c14b7fde1 Merge pull request #824 from ReactiveX/slack-channel-url
Update README.md
2016-08-07 15:26:59 +02:00
Krunoslav Zaher 03d6950bf1 Merge branch 'develop' into swift-3.0 2016-08-07 15:24:44 +02:00
Krunoslav Zaher 7b6a244f45 Fixes problem with data sources. 2016-08-07 15:23:17 +02:00
Krunoslav Zaher e2c3330d61 Fixes default datasources implementation. #825 2016-08-07 15:12:54 +02:00
Junior B 208a84db0f Update README.md 2016-08-07 01:33:37 +02:00
Vedran Burojević 0b1856d43e Fixes typo in Getting Started 2016-08-06 19:44:02 +02:00
Krunoslav Zaher 58e427b045 Fixes playgrounds compilation issues. 2016-08-04 11:53:19 +02:00
Krunoslav Zaher a2ee04e721 Fixes unit tests. 2016-08-04 11:12:53 +02:00
Krunoslav Zaher 38c45c066d Example compilation fixes. 2016-08-04 10:56:09 +02:00
Krunoslav Zaher 01d86ff684 Fixes OSX compilation issues. 2016-08-04 10:48:36 +02:00
Krunoslav Zaher 2ead37809e Fixes example app compiling. 2016-08-04 10:44:46 +02:00
LZL 72e5488631 Typo 2016-08-03 17:27:15 +08:00
Krunoslav Zaher 21a56a8ebd Fixes all tests. 2016-08-02 14:51:04 +02:00
Yuki Nagai a9d0cfeb5b Add Error extension instead of NSError for Workaround; NSError extension returns a type which conforms to Error protocol 2016-08-02 21:48:01 +09:00
Yuki Nagai 7f84ec604e WIP. Update for Xcode 8 beta 4. 2016-08-02 15:46:11 +09:00
Krunoslav Zaher bfb9441414 Merge pull request #812 from nishitaniyuki/fix-minor-typo
Fix minor typo
2016-08-01 11:47:28 +02:00
Krunoslav Zaher 3b34850675 Merge branch 'swift-3.0' of github.com:kzaher/RxSwift into swift-3.0 2016-08-01 10:47:06 +02:00
Krunoslav Zaher c844b6bdb3 Merge branch 'develop' into swift-3.0 2016-08-01 10:46:20 +02:00
Krunoslav Zaher dffd6f0e1c Moves playgrounds from workspace to project. #806 2016-08-01 10:27:18 +02:00
nishitani yuki 544e00d917 Fix minor typo 2016-08-01 13:52:57 +09:00
Krunoslav Zaher 490b6cbbc5 Merge pull request #790 from sunshinejr/swift-3.0
[Swift 3.0] Remove first parameter names for Observables.
2016-07-29 12:11:35 +02:00
Krunoslav Zaher b1c6673da7 Merge pull request #801 from mohsenr/swift-3.0-disposables
[Swift 3.0] Rename disposable-related methods (implements #800)
2016-07-28 23:49:17 +02:00
Krunoslav Zaher 372d766519 Merge pull request #809 from peagasilva/patch-1
Update Rx.playground/Pages/Introduction/Contents.swift
2016-07-28 23:46:24 +02:00
Raphael Silva 40eb452040 Update Contents.swift
Typo fixed - it was missing the `ed` in called.
2016-07-28 18:06:29 -03:00
Mo Ramezanpoor 99e21bdb46 Rename CompositeDisposable.removeDisposable(forKey:) to .remove(for:).
Decided as part of #800 that this is more suitable.
2016-07-27 16:34:38 +01:00
Krunoslav Zaher d12b8321d2 Merge pull request #804 from devxoul/tableview-willdisplaycell
Fix type mismatch in UITableView.rx_willDisplayCell
2016-07-27 16:00:19 +02:00
Suyeol Jeon f303efb077 Fix type mismatch in UITableView.rx_willDisplayCell 2016-07-27 04:15:17 +09:00
Łukasz Mróz 181a94bbc9 [Swift3] doOn syntax. 2016-07-25 20:39:01 +02:00
Mo Ramezanpoor fa14592a2b Rename disposeAllIn(_:) to disposeAll(in:).
Ideally we’d move this to be a method on Bag where T: Disposable. Unfortunately atm that doesn’t work on Bag<Disposable> itself, only on concrete types inheriting from it.

We can at least make the function feel more at home in Swift 3.
2016-07-25 16:04:32 +01:00
Mo Ramezanpoor 61420eef9f Add DisposeBag.insert() and deprecate DisposeBag.addDisposable().
Update [the only] known call site to match.
2016-07-25 15:37:33 +01:00
Mo Ramezanpoor fbee131886 Update all known call sites to use the new insert/remove methods on CompositeDisposable. 2016-07-25 15:31:40 +01:00
Mo Ramezanpoor 2cb931d8e9 Add new insert/remove methods to CompositeDisposable that follow Swift 3 naming conventions. 2016-07-25 15:30:54 +01:00
Krunoslav Zaher 0c8d28b1b6 Fixes disposing for debug operator in case of termination event. 2016-07-23 16:20:10 +02:00
Krunoslav Zaher 1301e9925a Fixes for Swift 3.0 2016-07-23 16:05:04 +02:00
Krunoslav Zaher 070907471c Fixes problem with schedulers introduced with Swift 3.0 and changes in libdispatch. #799 2016-07-23 14:14:08 +02:00
Krunoslav Zaher f3f2b0e083 Updates to Swift 3.0 2016-07-22 22:34:34 +02:00
Krunoslav Zaher e79457dcd3 Fixes for Xcode beta 3. 2016-07-20 22:14:59 +02:00
Krunoslav Zaher 824f23c94e Merge pull request #797 from noremac/swift-3.0
Adds further Xcode 8 beta 3 fixes.
2016-07-20 01:10:29 +02:00
Cameron Pulsford 5c908f18b8 Adds further Xcode 8 beta 3 fixes. 2016-07-19 18:42:18 -04:00
Krunoslav Zaher d4981303b5 Merge pull request #796 from noremac/swift-3.0
Updates project with Xcode 8 beta 3.
2016-07-20 00:04:17 +02:00
Cameron Pulsford 7c2f20cf36 Updates project with Xcode 8 beta 3. 2016-07-19 11:33:06 -04:00
Krunoslav Zaher cba021a961 Adds `swift-3.0` as valid branch in Dangerfile. 2016-07-11 01:36:22 +02:00
Krunoslav Zaher 9cac0cc234 Adaptations for Swift 3.0. 2016-07-10 14:55:18 +02:00
Krunoslav Zaher b47ce13eae Adds printing of environment info. 2016-07-10 13:06:00 +02:00
Krunoslav Zaher 1124f40ef1 Fixes Swift version. 2016-07-10 12:45:41 +02:00
Krunoslav Zaher 03fae9de6f Changes deployment target for example app. 2016-07-10 12:39:02 +02:00
Krunoslav Zaher 996caf6917 Fixes platform. 2016-07-10 12:33:55 +02:00
Krunoslav Zaher a1b34f0f50 Fixes unit tests warning. 2016-07-10 12:29:29 +02:00
Krunoslav Zaher 125deae0c8 Fixes tvOS compilation. 2016-07-10 12:23:50 +02:00
Krunoslav Zaher 8e46d377da Fixes concurrent dispatch queue scheduler initializer. 2016-07-10 12:18:11 +02:00
Krunoslav Zaher 348ce89e17 Fixes `rx_sentMessage` unit tests. 2016-07-10 11:33:51 +02:00
Krunoslav Zaher e222e52223 Deletes RxExample-iOS-no-module scheme. 2016-07-09 23:11:54 +02:00
Krunoslav Zaher edf423d42e Improves KVOObservable code. 2016-07-08 00:20:24 +02:00
Krunoslav Zaher e2edffc39d Fixes `@warn_unused_result(message: "http://git.io/rxs.ud")` warnings. 2016-07-08 00:04:44 +02:00
Krunoslav Zaher 6770c8a4c0 Fixes `.self` warnings. 2016-07-08 00:02:45 +02:00
Krunoslav Zaher bce8e9cd2d Fixes example app. 2016-07-07 23:50:38 +02:00
Krunoslav Zaher a64c07d1e1 Merge pull request #787 from sergdort/swift-3.0
Merged latest master
2016-07-07 23:22:57 +02:00
Krunoslav Zaher 7cc3dab5cb Merge pull request #789 from kciter/remove-meaningless-line
Remove typealias Parent line in Filter.swift
2016-07-07 21:50:39 +02:00
Lee Sun-Hyoup 6757b82872 Remove typealias Parent line in Filter.swift 2016-07-07 18:53:59 +09:00
sergdort d40557bbd7 Fixed test failing on `testObservingForAllTypes` 2016-07-07 10:29:04 +03:00
Krunoslav Zaher 987afd4a92 Merge pull request #786 from mohsenr/swift-3.0
Update for Xcode 8 beta 2.
2016-07-07 00:21:55 +02:00
Mo Ramezanpoor 14fa47c623 Update for Xcode 8 beta 2.
`Thread.current` is a class property, not a method.
2016-07-06 11:34:49 +01:00
sergdort 7e2a492895 Fixed the bug with determining property attributes in KVOObservable 2016-07-06 10:29:38 +03:00
sergdort b7cd7ba56c Fixes after merge conflicts 2016-07-05 18:07:18 +03:00
sergdort cfb8b1558a Merge branch 'master' into swift-3.0
Conflicts:
	RxExample/RxDataSources/DataSources/CollectionViewSectionedDataSource.swift
	RxExample/RxDataSources/DataSources/Differentiator.swift
	RxExample/RxDataSources/DataSources/TableViewSectionedDataSource.swift
	RxExample/RxExample.xcodeproj/project.pbxproj
	RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOS-no-module.xcscheme
	RxExample/RxExample/Examples/TableViewPartialUpdates/PartialUpdatesViewController.swift
	RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift
	RxExample/RxExample/Services/HtmlParsing.swift
	Tests/RxCocoaTests/CLLocationManager+RxTests.swift
	Tests/RxCocoaTests/UICollectionView+RxTests.swift
2016-07-05 18:00:36 +03:00
Krunoslav Zaher 95ee9d0de8 Fixes problem with editing UITableView example. #768 2016-07-04 20:55:54 +02:00
Krunoslav Zaher ca831c7321 Updates README with a friendly information about Xcode 8.0 beta. 2016-07-04 07:16:33 +02:00
Krunoslav Zaher 56e09abb11 Fixes problem with Swift 2.3 2016-07-04 07:02:49 +02:00
Krunoslav Zaher 1633a4192e Disables bitcode for RxTests/tvOS because Carthage with Swift 2.3 and Xcode 8.0 fails to compile it. 2016-07-04 06:13:58 +02:00
Krunoslav Zaher f51151c3d2 Fixes RandomAPI response Parsing. 2016-07-04 04:25:21 +02:00
Krunoslav Zaher 2787393621 Fixes for Xcode 7.3.1 2016-07-04 04:06:01 +02:00
Krunoslav Zaher 5c0ce0a1c8 Xcode 8 beta, Swift 2.3 fixes. 2016-07-04 03:35:41 +02:00
Krunoslav Zaher bce72a2617 Fixes headers. 2016-07-04 02:54:32 +02:00
Krunoslav Zaher 68b5ae3e4c Xcode 8.0 fixes. 2016-07-04 02:48:41 +02:00
Krunoslav Zaher f86d12a53b Release 2.6.0 2016-07-04 02:27:30 +02:00
Krunoslav Zaher 88f718ffc3 Updates latest version of data sources. 2016-07-04 02:06:08 +02:00
Krunoslav Zaher e20ac5fbb7 Adds simple data source usage examples in inline docs. 2016-07-04 01:42:26 +02:00
Krunoslav Zaher 2d50bc135c Fixes compilation for Swift 2.3 compiler. 2016-07-04 01:07:19 +02:00
Krunoslav Zaher 17f8aac437 Removes unit tests failing because of accidentally included plist. 2016-07-04 01:03:13 +02:00
Krunoslav Zaher f95b1ed122 Unit tests, documents and improves data source/delegate interfaces. 2016-07-04 01:02:08 +02:00
Krunoslav Zaher 7e17ca9fde Updates mdast to remark. 2016-07-03 22:03:26 +02:00
Krunoslav Zaher 6b031f97bd Merge branch 'develop' of github.com:ReactiveX/RxSwift into develop 2016-07-03 16:37:32 +02:00
Krunoslav Zaher c0939e1b4e Removes RxExample-no-module scheme. 2016-07-03 16:05:46 +02:00
Krunoslav Zaher e3d2305a8f Fixes building playgrounds. 2016-07-03 13:03:47 +02:00
Krunoslav Zaher 5b95007fba Merge pull request #778 from sunshinejr/feature/equatable_recorded_public
[RxTests] Make equatable operator for Recorded public.
2016-07-03 13:03:09 +02:00
Krunoslav Zaher d1916b4a19 Merge pull request #779 from tomburns/fix-rxblocking
Fix RxBlocking in Swift 3
2016-07-03 13:00:57 +02:00
Tom Burns 98cf430382 Fix ConcurrentDispatchQueueSchd's schedulePeriodic
Fix interval conversion error (new API expects Double, not TimeInterval)
2016-07-02 19:58:29 -05:00
Tom Burns c33d5806fd Remove errant whitespace 2016-07-02 18:47:47 -05:00
Tom Burns 45b8b32b35 Fix RxBlocking in Swift 3
Remove force cast in favor of rawValue to fix crash at runtime
2016-07-02 18:45:08 -05:00
Łukasz Mróz 8989ea3a0a [RxTests] Make equatable Recorded public 2016-07-02 23:04:41 +02:00
Krunoslav Zaher ad96d6b0e1 Merge pull request #777 from baek-jinoo/minor-typo-fix
Minor typo fix
2016-07-01 10:42:21 +02:00
Krunoslav Zaher 5a9771e818 Removes no-module version. 2016-06-30 10:51:05 +02:00
Krunoslav Zaher 62bd1d5498 Fixes all-tests.sh 2016-06-30 10:49:07 +02:00
Krunoslav Zaher bbea37dcda Merge pull request #775 from DouglasHeriot/swift-2.3
Update for Xcode 8, Swift 2.3.
2016-06-30 10:47:47 +02:00
Krunoslav Zaher b72a2ce86d Merge pull request #776 from DouglasHeriot/swift-3.0
Make Travis use Xcode 8 for building Swift 3
2016-06-30 10:45:19 +02:00
Douglas Heriot 67160ee0dc Put Travis back to Xcode 7.3
Upgrading to 8 requires all .swift build scripts to use Swift 3, which isn't appropriate in this branch.
2016-06-30 00:41:14 +10:00
Douglas Heriot 76a63104fa Update Travis to use Xcode 8.
Also update validate-headers.swift for Swift 3.
2016-06-30 00:26:04 +10:00
Douglas Heriot 5a566ae183 Fix RxExample for Xcode 8, Swift 2.3 2016-06-29 22:54:12 +10:00
Krunoslav Zaher e730955869 Merge pull request #770 from tonyarnold/fix/static-analysis-issues
Resolve minor static analysis issues
2016-06-29 13:37:57 +02:00
Tony Arnold 1a289e97fd Add information about resolved static analysis issues in RxCocoa’s Objective-C classes to the changelog 2016-06-29 11:31:21 +10:00
Tony Arnold e4219c8423 Add RX_CATCH_ERROR macro to work around implicit nullable state of NSError parameters in Objective-C methods 2016-06-29 10:59:13 +10:00
Douglas Heriot d48dff3a4f Update for Xcode 8, Swift 2.3.
Bump OSX Deployment Target to 10.10 to avoid libarclite duplicate linking error?
2016-06-29 01:54:19 +10:00
Tony Arnold c50efe34c7 Initialise targetClass to NULL to silence a static analysis issue 2016-06-28 13:17:17 +10:00
Krunoslav Zaher 0815ea5c96 Merge pull request #767 from sora0077/feature/RXDelegateProxy_weak
Change _forwardToDelegate to weak reference
2016-06-27 17:21:24 +02:00
林達也 fc0fdb4850 Change _forwardToDelegate to weak reference 2016-06-27 23:31:38 +09:00
Krunoslav Zaher 7ec1ffc935 Merge branch 'sergdort-swift-3.0' into swift-3.0 2016-06-26 15:28:35 +02:00
Krunoslav Zaher 7089f6d7de Fixes .travis.yml 2016-06-26 15:03:24 +02:00
Krunoslav Zaher f72cc12b94 Improves CONTRIBUTING.md 2016-06-26 14:59:45 +02:00
Krunoslav Zaher 37560a734e Moves issue template to root. 2016-06-26 14:53:12 +02:00
Krunoslav Zaher 933cb02cb0 Adds `UIButton.setTitle` extensions to tvOS. 2016-06-26 14:37:10 +02:00
sergdort ada55ed8e5 Fixed compile error on all tests MAC os 2016-06-25 22:14:04 +03:00
sergdort 5bf319adda Made RxAllTests compile with Swift 3.0 2016-06-25 22:10:12 +03:00
Krunoslav Zaher 7a15347943 Adds UIButton.setTitle(:forState:) extensions. 2016-06-24 23:11:08 +02:00
Krunoslav Zaher c51f4f3b95 Merge branch 'jamiepinkham-swift-3.0' into swift-3.0 2016-06-23 11:06:13 +02:00
Jamie Pinkham c719c8cf86 fix compiler warnings about unused variables 2016-06-22 10:16:49 -04:00
Jamie Pinkham 5d47db7609 fix errors with RxCocoa introduced by merge 2016-06-22 10:15:37 -04:00
Jamie Pinkham 7ff150aafc clean up changes from merge 2016-06-22 10:01:59 -04:00
Jamie Pinkham 5a9f47262a Merge branch 'upstream-develop' into swift-3.0
# Conflicts:
#	RxCocoa/Common/CocoaUnits/Driver/Driver+Subscription.swift
#	RxCocoa/Common/CocoaUnits/UIBindingObserver.swift
#	RxSwift/Schedulers/MainScheduler.swift
2016-06-22 09:54:44 -04:00
Jamie Pinkham db4c04dcea use Foundation.Timer
and fix result of call unused warning
2016-06-22 09:51:01 -04:00
Jamie Pinkham 9287bebd10 fix retryWhen syntax 2016-06-22 09:37:32 -04:00
Jamie Pinkham 924a9a4983 clean up syntax to get test building
still trying to work out the ambiguious use compiler error
2016-06-22 09:34:04 -04:00
Jamie Pinkham 8d5b85306d fix up @noescape clauses 2016-06-21 08:48:45 -04:00
Jamie Pinkham bc86d47a3f swift 3.0 syntax updates for preprocessor and performance tools 2016-06-21 08:45:56 -04:00
Jamie Pinkham a5f19de922 fix reachability 2016-06-21 08:45:00 -04:00
baek-jinoo 8ce99d1219 Minor typo fix 2016-06-20 17:45:37 -07:00
Jamie Pinkham 8bad8e547f fix wireframe for mac tests 2016-06-20 14:06:36 -04:00
Jamie Pinkham ced6ce3a7e fixes the unit tests for the rx ios example 2016-06-20 14:04:42 -04:00
Jamie Pinkham ff0d588189 fix what tests i can 2016-06-18 15:43:27 -07:00
Jamie Pinkham c35136fe0b get example projects working.. woo! 2016-06-18 15:21:44 -07:00
Jamie Pinkham 39a20441e1 begin fixing up the examples 2016-06-18 01:24:07 -07:00
Jamie Pinkham c4cf2e0d12 builds ios, ios rx cocoa and ios rx blocking 2016-06-17 23:19:16 -07:00
Jamie Pinkham 0e38ecbc87 Merge branch 'develop' into swift-3.0
# Conflicts:
#	Documentation/DesignRationale.md
#	Rx.playground/Pages/Introduction.xcplaygroundpage/Contents.swift
#	RxCocoa/Common/DelegateProxyType.swift
#	RxCocoa/iOS/UICollectionView+Rx.swift
#	RxCocoa/iOS/UIControl+Rx.swift
#	RxCocoa/iOS/UIScrollView+Rx.swift
#	RxCocoa/iOS/UITableView+Rx.swift
#	RxExample/RxDataSources/DataSources+Rx/ObservableConvertibleType+Differentiator.swift
#	RxSwift/Concurrency/Lock.swift
#	RxSwift/Disposables/CompositeDisposable.swift
#	RxSwift/Event.swift
#	RxSwift/Extensions/String+Rx.swift
#	RxSwift/Schedulers/OperationQueueScheduler.swift
2016-06-17 21:14:06 -07:00
Krunoslav Zaher 9b1583f2e3 Merge pull request #751 from brentleyjones/swift-rand
Replace `rand` with `arc4random`
2016-06-17 12:15:28 +02:00
Brentley Jones 079ab269c0 Replace `rand` with `arc4random`
Swift 2.3 won't compile with `rand`.
2016-06-16 16:04:25 -07:00
Krunoslav Zaher 8797a05a0e Improves `drive` documentation. 2016-06-15 23:05:21 +02:00
Krunoslav Zaher 95900ef394 Merge branch 'develop' of github.com:kzaher/RxSwift into develop 2016-06-15 22:40:47 +02:00
Krunoslav Zaher 390e0d79e5 Merge pull request #742 from mattfenwick/patch-1
copy edit Schedulers.md
2016-06-14 23:58:53 +02:00
Krunoslav Zaher 087456aed3 Merge branch 'develop' of github.com:kzaher/RxSwift into develop 2016-06-14 23:46:47 +02:00
Krunoslav Zaher 96b269dc5f Documents `<->` internals better. 2016-06-14 23:44:44 +02:00
Matt Fenwick c038e7bb84 fix sentence structure 2016-06-14 10:35:36 -05:00
Matt Fenwick 9fed8676aa copy edit Schedulers.md 2016-06-14 10:14:43 -05:00
Krunoslav Zaher d59b050eda Merge pull request #738 from solidcell/update-jazzy-docs
Add a script that updates RxSwift jazzy docs
2016-06-13 14:05:00 +02:00
Krunoslav Zaher 58a66df1d9 Merge pull request #740 from ReactiveX/update-units-documentation
Remove Variable from Units documentation
2016-06-13 14:04:38 +02:00
Scott Gardner e1040cfcf8 Remove Variable from Units documentation 2016-06-10 12:01:05 -05:00
Jesse Farless 56e6d09b0f Add a script that updates RxSwift jazzy docs 2016-06-10 14:51:40 +02:00
Krunoslav Zaher 49ccdac810 Merge pull request #717 from solidcell/tab-bar-delegate-proxy
UITabBar delegate proxy
2016-06-10 11:34:40 +02:00
Krunoslav Zaher 7fbbebe404 Merge pull request #730 from solidcell/jazzy-documentation
Add API Documentation
2016-06-10 11:32:28 +02:00
Krunoslav Zaher c52090aee2 Patches the problem with <-> clearing the value on return. Correct solution is still unknown. 2016-06-10 11:26:10 +02:00
Krunoslav Zaher 49e9057d28 Merge pull request #734 from devxoul/uiscrollview-rxscrollenabled
Add UIScrollView.rx_scrollEnabled
2016-06-10 11:21:14 +02:00
Jesse Farless 34d35c1560 Update method signatures in API documentation 2016-06-10 10:36:11 +02:00
Suyeol Jeon b0bb65306b Update CHANGELOG.md 2016-06-09 00:35:37 +09:00
Krunoslav Zaher 902a659097 Changes head to base in Dangerfile. 2016-06-08 15:56:34 +02:00
Jesse Farless 6d84f30338 Unsuccessfully exit from script if jazzy gem isn't found 2016-06-08 15:49:18 +02:00
Jesse Farless 3ebb38c681 Add a .jazzy.yml file and scripts that create and update it 2016-06-08 15:19:50 +02:00
Scott Gardner ab4c845d46 Minor update to Rx.playground 2016-06-08 06:44:00 -05:00
Krunoslav Zaher b37f3f5bb6 Merge pull request #714 from bshewmak/develop
Fix Demo: Filtering and Conditional Operators
2016-06-08 13:32:44 +02:00
Krunoslav Zaher fbca0957c0 Adds warning about targetting `develop` branch to `Dangerfile`. 2016-06-08 11:51:51 +02:00
Jesse Farless 7c706713b5 Rename delegate methods to remove 'Item' suffix 2016-06-08 11:46:15 +02:00
Suyeol Jeon 0686b9a045 Add unit test for UIScrollView.rx_scrollEnabled 2016-06-08 18:31:27 +09:00
Krunoslav Zaher e464c369dc Merge pull request #725 from sergdort/danger_setup
Danger base setup
2016-06-08 11:27:40 +02:00
Krunoslav Zaher a121867280 Adds `vendor` to ignore validate headers script. 2016-06-08 10:45:14 +02:00
Krunoslav Zaher e45d3be7fd Improves header validation script. 2016-06-08 10:41:58 +02:00
Krunoslav Zaher 9e2e7abf88 Excludes `bundle` path. 2016-06-08 10:23:59 +02:00
Ben Shewmake 0514c03963 Added two additional examples to Filtering and Conditional Operators: "single with conditions".
Per suggestion by @scotteg, two additional examples were added to cover the following use cases:

* A successful matching case of exactly one element
* An error when repeated elements are observed
2016-06-07 19:42:05 -06:00
Suyeol Jeon e291bff0f0 Add UIScrollView.rx_scrollEnabled 2016-06-08 04:12:53 +09:00
sergdort e3a87c8801 Danger base setup 2016-06-03 10:27:01 +03:00
Krunoslav Zaher e26bce70af Merge branch 'master' into develop 2016-06-02 21:54:00 +02:00
Krunoslav Zaher f86e946f8f Merge pull request #724 from chunkyguy/ImproveCompileTimes
Rewrite an implementation to reduce compilation time
2016-06-02 13:33:47 +02:00
Sidharth Juyal ae9c8e3fd9 Rewrite the Bag.count implementation
This implementation is both short and fast in compilation times.
2016-06-02 11:30:56 +02:00
Krunoslav Zaher dee4a93ccb Adds test to Linux tests. 2016-05-31 21:54:57 +02:00
Krunoslav Zaher 645b93c3e4 Fixes composite disposable. 2016-05-31 21:54:35 +02:00
Krunoslav Zaher 2fdb6a6d81 Merge pull request #720 from larryonoff/feature/extend-composite-disposable
Extend CompositeDisposable with variadic init
2016-05-31 21:39:43 +02:00
Krunoslav Zaher a9fafcee41 Merge pull request #721 from kylef/kylef/rx_title
Add rx_title to UIViewController
2016-05-31 21:35:48 +02:00
Krunoslav Zaher 52c6e6dc31 Improves version checking logic. #707 2016-05-31 21:33:38 +02:00
Krunoslav Zaher 3fd15897ce Improves version checks. 2016-05-31 21:27:15 +02:00
Sidharth Juyal 00e0f5e689 Rewrite an implementation to reduce compilation time
The coalescing operator for some reasons increases the build times.
On my machine replacing the implementation brings down the compile time `Bag.count` from 1005ms to 13ms
2016-05-31 19:10:21 +02:00
Kyle Fuller aba717b642 Add rx_title to UIViewController 2016-05-30 09:19:26 -07:00
Ilya Laryionau c6ae73f9ce extend CompositeDisposable with variadic init 2016-05-29 18:47:00 +03:00
Krunoslav Zaher bb4052fb1b Remove `hasObservers` from `SubjectType`. 2016-05-28 15:23:22 +02:00
Krunoslav Zaher bdb09885c2 Merge branch 'develop2' of git://github.com/pRizz/RxSwift into pRizz-develop2 2016-05-28 14:52:31 +02:00
Jesse Farless 75d1983afc Add RxTabBarDelegateProxy and UITabBar+Rx with delegate methods 2016-05-28 14:27:19 +02:00
Ben Shewmake db62a3cf3f Added changed '.subscribe' to '.subscribeNext' to alleviate error output in debug console. 2016-05-27 17:57:09 -06:00
Krunoslav Zaher d2eec7c478 Merge branch 'AndrewSB-feature/uialert-action' into develop 2016-05-27 23:27:19 +02:00
Krunoslav Zaher a5f1d1eef7 Merge branch 'feature/uialert-action' of git://github.com/AndrewSB/RxSwift into AndrewSB-feature/uialert-action 2016-05-27 23:24:50 +02:00
Krunoslav Zaher 6b038ad039 Merge pull request #701 from TheArtOfEngineering/swift-3.0
Add Swift 3 swift-DEVELOPMENT-SNAPSHOT-2016-05-09 compatibility.
2016-05-27 22:48:26 +02:00
Krunoslav Zaher 0e75ad3cf0 Improves CI by killing iOS simulator before each batch of tests to prevent deadlocks caused in Apple code. 2016-05-27 22:36:55 +02:00
Krunoslav Zaher e902c8b7f6 Merge remote-tracking branch 'origin/develop' into develop 2016-05-27 22:34:36 +02:00
Krunoslav Zaher c742831992 Merge branch 'punty-uipagecontrol-add-rx' into develop 2016-05-27 22:34:12 +02:00
Krunoslav Zaher 38f5eb210f Merge branch 'uipagecontrol-add-rx' of git://github.com/punty/RxSwift into punty-uipagecontrol-add-rx 2016-05-27 22:34:01 +02:00
Krunoslav Zaher eeabccf348 Merge pull request #711 from devxoul/fix-typo-docs-units
Fix typo in Documentation/Units.md
2016-05-26 14:10:50 +02:00
Jeon Suyeol d1713a8ac5 Fix typo in Documentation/Units.md 2016-05-26 04:17:52 +09:00
Krunoslav Zaher 31ebe46a16 Merge pull request #710 from larryonoff/bugfix/fix-typo
fix typo
2016-05-25 14:17:07 +02:00
Krunoslav Zaher d1393da8eb Merge pull request #703 from wddwycc/patch-2
Fix Blurred demonstration of 'concat demo'.
2016-05-24 11:42:17 +02:00
Tyler Cloutier 94833e438d Add Swift 3 swift-DEVELOPMENT-SNAPSHOT-2016-05-09 compatibility. 2016-05-22 14:43:47 -07:00
Ilya Laryionau 3693809b34 fix typo 2016-05-22 22:58:49 +02:00
Krunoslav Zaher e1bfa8c7ea Merge pull request #700 from carlosypunto/FixSpellingInGeolocationService
Fix spelling and reactivate access to preferences panel
2016-05-21 21:25:26 +02:00
Carlos García 5269932678 Fix spelling and reactivate access to preferences panel
Related to Pull Request:
https://github.com/ReactiveX/RxSwift/pull/623/files
2016-05-21 17:05:14 +02:00
Krunoslav Zaher cf2433e665 Fixes contact info. 2016-05-21 16:17:17 +02:00
Krunoslav Zaher a2b00547b8 Merge pull request #699 from solidcell/code-of-conduct
Add a code of conduct markdown
2016-05-21 16:09:34 +02:00
Jesse Farless 45133039c3 Add a code of conduct markdown
It still requires the email address to be updated
to whomever should be the point of contact
2016-05-21 12:20:53 +02:00
Krunoslav Zaher eda25e28ff Simplifies sectioned view extensions. 2016-05-20 22:34:13 +02:00
闻端Carl 607ebfbf3d Fix Demo
The output is of "concat example" is :  

Next(🍎)
Next(🍐)
Next(🍊)
Next(🐱)
Next(🐭)

If people do not use 'concat()', the result is the same, the demo cannot show the effect of 'concat()', which is "waiting for each sequence to terminate successfully before emitting elements from the next sequence"

so I add one line code for better demonstration.
2016-05-19 23:24:35 +08:00
Krunoslav Zaher 4b3056b81f Improves unit tests. 2016-05-19 12:25:57 +02:00
Peter Ryszkiewicz 185f66af90 Merge branch 'develop' into develop2
# Conflicts:
#	Rx.xcodeproj/project.pbxproj
2016-05-18 20:48:58 -05:00
Peter Ryszkiewicz 45042307ac Added unit tests for the hasObservers var. 2016-05-18 19:47:01 -05:00
Peter Ryszkiewicz 66230b7afe Fixed compilation of unit tests 2016-05-18 16:56:24 -05:00
Krunoslav Zaher e61b62d64f Merge branch 'sergdort-UIPickerView+Rx' into develop 2016-05-18 22:14:59 +02:00
Krunoslav Zaher b1dd82e831 Merge branch 'UIPickerView+Rx' of git://github.com/sergdort/RxSwift into sergdort-UIPickerView+Rx 2016-05-18 22:14:45 +02:00
Krunoslav Zaher 49b1481dff Updates RxDataSources. 2016-05-15 20:44:41 +02:00
Krunoslav Zaher 8a3b47953d Changes 2.5 to 2.5.0. 2016-05-15 18:28:31 +02:00
Krunoslav Zaher 33f2487a41 Adds 2.5.0 changes to CHANGELOG. 2016-05-15 18:28:31 +02:00
Krunoslav Zaher 3aa3850a74 Makes `NSTextField` implement `RxTextInput`. 2016-05-15 18:28:31 +02:00
Krunoslav Zaher 69b45ed364 Fixes Wikipedia automation tests. 2016-05-15 18:28:31 +02:00
Krunoslav Zaher aed5ac864a Improves delegate proxy messaging. #675 2016-05-15 18:28:31 +02:00
Krunoslav Zaher 0c34e28d38 Turns off bitcode for RxTests. #584 2016-05-15 18:28:31 +02:00
Krunoslav Zaher 761e9fea8b Release 2.5 2016-05-15 18:28:31 +02:00
Krunoslav Zaher 6b8738752f Merge pull request #685 from carlosypunto/moreComprensibleActivityIndicator
More comprensible `ActivityIndicator`
2016-05-15 16:34:27 +02:00
Carlos García f44393c1d8 More comprensible `ActivityIndicator` 2016-05-15 15:23:08 +02:00
Krunoslav Zaher fcbdc00f24 Merge branch 'feature/update-playground' into develop 2016-05-15 13:23:24 +02:00
Jesse Farless 4de6a0b621 Improve language in comment 2016-05-15 13:21:44 +02:00
Jesse Farless 7e64194403 Use new Swift selector syntax in comment 2016-05-15 13:21:44 +02:00
Jesse Farless 3194efced8 Update comment to use new non-deprecated method 2016-05-15 13:21:44 +02:00
Jesse Farless fb97732d85 Fix argument key in comment 2016-05-15 13:21:44 +02:00
Jesse Farless b4ce5629cc Typo in comment 'extensions' with an 's' 2016-05-15 13:21:44 +02:00
Krunoslav Zaher a9135f1169 Improves documentation for `DelegateProxy.observe`. #654 2016-05-15 13:21:44 +02:00
Krunoslav Zaher 02413a176e Adds unit test for only setting different text values. 2016-05-15 13:21:44 +02:00
Krunoslav Zaher 993cc1af76 Provides explanations for check. 2016-05-15 13:21:44 +02:00
Krunoslav Zaher 21904f14c9 Fixes problems with two way binding that was caused by `rx_text` and always setting the text value even when the value was equal, and thus clearing the marked text state. #649 2016-05-15 13:21:44 +02:00
Scott Gardner aca9950fdc Add missing Next link 2016-05-14 16:54:54 -05:00
Scott Gardner 84c42e6dd6 Split Error Handling and Debugging Operators into separate pages 2016-05-14 16:50:47 -05:00
Krunoslav Zaher 1c03845341 Merge pull request #683 from solidcell/delegate-proxy-typos
DelegateProxyType comment updates
2016-05-14 21:23:24 +02:00
Scott Gardner 990c967052 Add missing dividers between examples 2016-05-14 13:23:57 -05:00
Scott Gardner 52005f4096 Disable RxSwift.resourceCount example outside of playground 2016-05-14 12:34:18 -05:00
Scott Gardner 3efaeac3ad Rename Debugging_and_Error_Handling_Operators to Error_Handling_and_Debugging_Operators and update 2016-05-14 06:56:55 -05:00
Scott Gardner bc81ce4252 Update Rx.swift 2016-05-14 06:56:12 -05:00
Jesse Farless 8a5e303af9 Improve language in comment 2016-05-14 10:47:04 +02:00
Jesse Farless f4ddfbda39 Use new Swift selector syntax in comment 2016-05-14 10:46:38 +02:00
Jesse Farless 5a26b2bc74 Update comment to use new non-deprecated method 2016-05-14 10:45:24 +02:00
Jesse Farless 665d9c7fbc Fix argument key in comment 2016-05-14 10:44:39 +02:00
Jesse Farless e6090fff58 Typo in comment 'extensions' with an 's' 2016-05-14 10:43:11 +02:00
Scott Gardner e0923c9f0c Move Test Error to SupportCode 2016-05-13 19:03:18 -05:00
Krunoslav Zaher 4c23f61b81 Improves documentation for `DelegateProxy.observe`. #654 2016-05-14 02:02:25 +02:00
Krunoslav Zaher cd247fe639 Merge pull request #677 from ReactiveX/feature/IME_input
Fixes problems with two way binding that was caused by `rx_text` and …
2016-05-14 01:29:43 +02:00
Krunoslav Zaher 3fa44935a1 Adds unit test for only setting different text values. 2016-05-14 01:20:54 +02:00
Scott Gardner 964f5be0d6 Update Connectable Operators 2016-05-13 17:39:51 -05:00
Scott Gardner 632e8ce154 Update Connectable Operators 2016-05-13 17:25:03 -05:00
Scott Gardner 6a1346c5c7 Update SupportCode 2016-05-13 17:24:51 -05:00
Scott Gardner 8b63f25fe1 Update Mathematical and Aggregate Operators 2016-05-13 15:46:04 -05:00
Scott Gardner 4046c1163c Update skipUntil example 2016-05-13 14:49:00 -05:00
Scott Gardner 4b03165635 Combine Filtering and Conditional Operators pages 2016-05-13 14:47:19 -05:00
Scott Gardner 38dec119e9 Update Combining Operators and move before Transforming Operators 2016-05-13 14:01:43 -05:00
Scott Gardner a68c07beb5 Update Filtering Operators 2016-05-13 11:28:07 -05:00
Scott Gardner c0bebbb795 Update Transforming Operators 2016-05-13 11:27:45 -05:00
sergdort 43269fa279 Added `rx_itemSelected` for UIPickerView 2016-05-13 10:55:21 +03:00
Krunoslav Zaher bee2ce5e4b Provides explanations for check. 2016-05-13 00:47:44 +02:00
Krunoslav Zaher 1aa1b570b0 Fixes problems with two way binding that was caused by `rx_text` and always setting the text value even when the value was equal, and thus clearing the marked text state. #649 2016-05-13 00:38:26 +02:00
Scott Gardner 3771e63a4c Minor update to Rx.playground based on feedback from kzaher 2016-05-12 16:04:32 -05:00
Scott Gardner ef62979f62 Change flatMapLatest example in Rx.playground to initially use flatMap 2016-05-12 15:34:10 -05:00
Scott Gardner 070139a4c4 Update playground...
Table of Contents
Introduction
Creating and Subscribing to Observables
Working with Subjects
Transforming Operators
2016-05-12 15:30:38 -05:00
Krunoslav Zaher 26dad8095f Merge pull request #676 from solidcell/language-tweaks
Fix typos and tweak language in docs
2016-05-12 22:27:49 +02:00
Jesse Farless 64e40ef604 Fix typos and tweak language in docs 2016-05-12 13:42:29 +02:00
Krunoslav Zaher fc519c3bb2 Merge pull request #674 from kumapo/add-rx-title-to-navigation-item
Add rx_title property to UINavigationItem
2016-05-11 21:30:03 +02:00
kumapo 1252338905 Add documentation for UINavigationItem+Rx 2016-05-12 01:28:12 +09:00
kumapo 02d30f846c Add unit tests for UINavigationItem+Rx 2016-05-12 00:24:06 +09:00
kumapo e1a6847fbf Fix pre-release-tests error 2016-05-09 20:47:54 +09:00
kumapo cbe17b7c1c Add rx_title property to UINavigationItem 2016-05-09 18:20:53 +09:00
Andrew Breckenridge af7c011a53 add forgotten parentheses to test function declarations 2016-05-08 15:08:43 -07:00
Krunoslav Zaher 92b8a51891 Orta's improvements. 2016-05-09 00:05:04 +02:00
Krunoslav Zaher ce5fcd1f4f Improves documentation. 2016-05-08 23:52:26 +02:00
Carlos García a2306bdf90 adds a little note about subscrition 2016-05-08 23:52:26 +02:00
Carlos García 207761c2a7 improve playgrouds
Thanks @finneycanhelp for help me to improve my English writing
2016-05-08 23:52:26 +02:00
Krunoslav Zaher cf0ef0b941 Merge pull request #673 from acecilia/develop
Fix to support iOS 7
2016-05-08 22:57:06 +02:00
Andrés Cecilia 881909a687 Fix to support iOS 7 2016-05-08 22:42:53 +02:00
Krunoslav Zaher b202c91991 Fixes unit tests for `installForwardDelegate`. 2016-05-08 22:10:34 +02:00
Krunoslav Zaher d197ce0fbb Exposes `installForwardDelegate` and transforms `proxyForObject` into protocol extension. 2016-05-08 21:32:02 +02:00
Andrew Breckenridge c4e83f3f34 add UIAlertAction tests to Control+RxTests+UIKit 2016-05-07 12:31:31 -07:00
Andrew Breckenridge 0188dccd4f create UIAlertAction+Rx.swift 2016-05-07 12:23:50 -07:00
Krunoslav Zaher 9b6f069f81 Merge pull request #669 from vburojevic/develop
Unwrap optional forwardToDelegate in assert message
2016-05-07 00:00:14 +02:00
Vedran Burojevic 139559f410 Unwrap optional forwardToDelegate in assert message 2016-05-06 20:52:08 +02:00
Krunoslav Zaher bb1b653ee0 Merge pull request #668 from rad182/develop
fixed typos
2016-05-06 15:30:12 +02:00
Royce Dy 0dec95efcb fixed typos 2016-05-06 10:49:51 +08:00
Krunoslav Zaher 81b9ff7322 Merge pull request #660 from ReactiveX/typed-gesture-recognizer-extension
Typed gesture recognizer extension
2016-05-03 23:24:18 +02:00
Scott Gardner caf4c497a6 Update Event...
Revise documentation
Follow convention to adopt and conform to a protocol in the extension
2016-05-03 09:33:26 -05:00
Yury Korolev 5fff8d2b7f Better code formatting 2016-05-03 12:05:21 +03:00
Yury Korolev 2e6cfdc15c Docs for Reactive protocol 2016-05-03 12:01:23 +03:00
Roy Li b8ecb446d8 Added lock when accessing _observers.count to ensure thread safety
I also moved _lock from ReplayBufferBase to ReplaySubject to enable
hasObservers property in ReplaySubject.
2016-05-02 20:20:36 -05:00
Roy Li 490118fdad Added comments for hasObservers
As requested, I added comments for the property hasObservers
2016-05-02 20:14:58 -05:00
Krunoslav Zaher a4ae75d03f Merge pull request #657 from thanegill/uilabel-rx_text
UILabel rx_text as `String?`
2016-05-02 21:29:46 +02:00
Yury Korolev c5a21681a8 Rename Rx to Reactive protocol 2016-05-02 20:05:38 +03:00
Yury Korolev 3e1b2d0789 Typed rx_event for UIGestureRecognizer 2016-05-02 13:36:09 +03:00
Thane Gill 37d685690c UILabel rx_text as `String?` 2016-04-30 11:13:38 -07:00
Krunoslav Zaher 779eb92d9e Fixes copyright in header. 2016-04-30 12:06:00 +02:00
Roy Li 3a57927a92 Added hasObservers on each of the Subject classes
Added var hasObservers: Bool { get } to the SubjectType protocol.

Then made all the Subject classes conform to the protocol by providing
hasObservers as a computed property.
2016-04-29 23:15:02 -05:00
Krunoslav Zaher 7687ad4c68 Updates RxDataSources. 2016-04-29 20:52:00 +02:00
Krunoslav Zaher 0288ba78d5 Merge pull request #643 from Nirma/develop
Dry up lock / unlock logic in Lock.swift
2016-04-29 20:34:51 +02:00
Krunoslav Zaher b3036c037b Merge pull request #647 from Nirma/grammar_fix
Grammar fixes and minor clarifications in Intro playground text.
2016-04-28 23:04:05 +02:00
Krunoslav Zaher 27d722e52d Merge pull request #648 from Nirma/subject_clarification
Add Clarification to BehaviorSubject and grammar fixes
2016-04-28 23:02:44 +02:00
Nicholas Maccharoli 8bbc952c6f Add Clarification to BehaviorSubject and grammar fixes 2016-04-26 15:08:56 +09:00
Nicholas Maccharoli 3363432c66 Grammar fix in Intro playground 2016-04-26 14:22:18 +09:00
Krunoslav Zaher c2ad533b1d Merge pull request #646 from Nirma/logic_fix
Shorten logic of VirtualTimeConverterType's computed properties
2016-04-25 09:39:55 +02:00
Nicholas Maccharoli ee20ea8c82 Shorten logic of VirtualTimeConverterType's computed properties 2016-04-25 16:25:01 +09:00
Francesco Puntillo b384c3e982 Adding Unit testing for UIPageControl+Rx 2016-04-25 10:50:34 +08:00
Nicholas Maccharoli 9e345e3645 Dry up lock / unlock logic in Lock.swift 2016-04-25 03:10:06 +09:00
Krunoslav Zaher 7133d6a6e5 Merge pull request #638 from Nirma/lastindex_improvement
Make lastIndexOf search from end of string to start
2016-04-24 15:43:39 +02:00
Krunoslav Zaher a96321638a Merge pull request #641 from ReactiveX/partial-application
Use partial application with AnonymousDisposable if possible
2016-04-24 15:42:17 +02:00
Yury Korolev 353b0b55c3 Use partial application with AnonymousDisposable if possible 2016-04-23 21:22:10 +03:00
Krunoslav Zaher 347e81244c Merge pull request #640 from garnett/delete-empty-file
Delete empty extension
2016-04-22 23:49:58 +02:00
Denis Lebedev ca070e6a36 Delete empty extension 2016-04-22 22:44:04 +01:00
Krunoslav Zaher 7622d9c5b7 Fixes for Linux. 2016-04-22 21:07:20 +02:00
Krunoslav Zaher c11c7a8f97 Unifies atomics on Linux. 2016-04-22 21:01:45 +02:00
Krunoslav Zaher 4e6880d218 Fixes for RxSwift and Swift 3.0. 2016-04-22 20:49:18 +02:00
Krunoslav Zaher 1b5cd9ecb5 Fixing swift 3.0 warnings. 2016-04-22 13:14:41 +02:00
Krunoslav Zaher c4ca775bdc Changes for Swift 3.0. 2016-04-22 13:14:41 +02:00
Krunoslav Zaher 6b259b6618 Fixes warnings. 2016-04-22 13:03:16 +02:00
Krunoslav Zaher 58c8e0e802 Merge branch 'Calvin-Huang-resolve_ios_example_warning' into develop 2016-04-22 12:26:59 +02:00
Krunoslav Zaher b2cf5ce567 Fixes problems with WikipediaImageSearch. 2016-04-22 12:26:14 +02:00
Krunoslav Zaher 6125245a73 Merge branch 'resolve_ios_example_warning' of git://github.com/Calvin-Huang/RxSwift into Calvin-Huang-resolve_ios_example_warning 2016-04-22 11:51:17 +02:00
Nicholas Maccharoli 5b35246953 Make lastIndexOf search from end of string to start 2016-04-22 14:34:31 +09:00
Calvin 68bf69e086 UISearchController's default animation will shift searchBar to the top.
This will trigger rx_contentOffset then close keyboard will makes users confused.
Filter situation that searchController is being present.
2016-04-22 12:30:28 +09:00
Calvin 66abcd07dc - Delete UISearchDisplayController, use UISearchController instead.
- Add IBOutlet searchBarContainer to setup searchBar.
2016-04-22 11:52:43 +09:00
Krunoslav Zaher b5491dd404 Merge pull request #632 from Nirma/simplify_queue
Simplify Queue.swift's init logic
2016-04-21 22:53:40 +02:00
Krunoslav Zaher 0c53b24b18 Fixes unit tests. 2016-04-21 22:52:18 +02:00
Nicholas Maccharoli 4d18ec0558 Simplify Queue.swift's init logic 2016-04-21 22:51:55 +02:00
Krunoslav Zaher 5283328321 Merge pull request #635 from Nirma/queue_defer
Leverage defer to make Queue's code more concise
2016-04-21 22:20:54 +02:00
Krunoslav Zaher 4e78d66857 Merge remote-tracking branch 'origin/develop' into develop 2016-04-21 22:10:29 +02:00
Krunoslav Zaher 0536a8868f Updates CocoaPods integration documentation. 2016-04-21 21:31:05 +02:00
Krunoslav Zaher bad39e0628 Merge pull request #633 from 53ningen/queue
make _initialCapacity property of Queue immutable
2016-04-21 11:42:35 +02:00
Nicholas Maccharoli 13ec2c0fea Leverage defer to make Queue's code more concise 2016-04-21 18:40:34 +09:00
gomi_ningen 439b70d258 make _initialCapacity property of Queue immutable 2016-04-21 18:04:31 +09:00
Nicholas Maccharoli 0c82695990 Simplify Queue.swift's init logic 2016-04-21 16:18:03 +09:00
Calvin 656669699a - Resolve storyboard warning.
- Remove wikipedia scene's search display controller and search bar, add search bar container.
2016-04-21 15:29:23 +09:00
Krunoslav Zaher 6dd6c9b211 Merge branch 'develop' 2016-04-20 13:55:17 +02:00
Krunoslav Zaher 48b782d761 Removes book on left side of README.md 2016-04-20 13:54:59 +02:00
Orta 78220fd37b Update README.md 2016-04-20 13:54:59 +02:00
Orta 91dc31b9ed Use a fancy table in the README 2016-04-20 13:54:59 +02:00
Krunoslav Zaher 0c7ca38cd7 Great readme commit. 2016-04-20 13:54:59 +02:00
Krunoslav Zaher 6455a64acf Removes book on left side of README.md 2016-04-20 13:54:09 +02:00
Orta 2eb01273b8 Update README.md 2016-04-20 12:39:16 +01:00
Orta 91e7a3dead Use a fancy table in the README 2016-04-20 11:48:31 +01:00
Krunoslav Zaher 411c4c284c Great readme commit. 2016-04-20 12:08:42 +02:00
Krunoslav Zaher c7fc68bfc1 Merge pull request #628 from garnett/patch-1
Rename outdated class name
2016-04-19 10:04:59 +02:00
Denis Lebedev 96de182dd3 Rename outdated class name 2016-04-18 22:45:21 +01:00
Krunoslav Zaher 3294458b87 Adds `rx_willDisplayCell` and `rx_didEndDisplayingCell` to `UITableView`. 2016-04-18 23:11:18 +02:00
Krunoslav Zaher 3668f360d7 Merge pull request #617 from ReactiveX/less-count-and-last
Use guard ... _generators.last instead of count check and last!
2016-04-17 18:23:10 +02:00
Krunoslav Zaher 72edf869a0 Removes `distinctUntilChanged` because is was creating a hidden state that can cause issues in some situations. 2016-04-17 17:14:55 +02:00
Francesco Puntillo 56119d3e91 Merge branch 'uipagecontrol-add-rx_master' into uipagecontrol-add-rx 2016-04-15 18:07:11 +08:00
Krunoslav Zaher 756f17c848 Merge pull request #616 from catalandres/patch-1
Update Contents.swift
2016-04-14 14:19:14 +02:00
Francesco Puntillo 2c7a403dae adjust formatting for UIPageControl+RX 2016-04-14 17:14:20 +08:00
Francesco Puntillo 8b4642a1c0 add UIPageControl to RxCocoa 2016-04-14 15:45:35 +08:00
Yury Korolev 15b6bfc7dd Do not change return logic 2016-04-13 11:39:19 +03:00
Yury Korolev aa41626c39 Use guard ... _generators.last instead of count check and last! 2016-04-13 11:23:11 +03:00
Krunoslav Zaher ceee55e6d9 Removes is on WiFi check from main queue. 2016-04-12 12:17:10 +02:00
Krunoslav Zaher c193b5db52 Improves reachability service. 2016-04-12 12:06:07 +02:00
Krunoslav Zaher 7b6a6b5f27 Enables Bitcode for tvOS. 2016-04-11 09:51:06 +02:00
Krunoslav Zaher d8228eeea7 Adds 2.4 to `CHANGELOG.md`. 2016-04-11 00:31:56 +02:00
Krunoslav Zaher e16ce89f3f Documents parts of `RxCocoa`. 2016-04-11 00:31:26 +02:00
Krunoslav Zaher 12467ebc32 Release 2.4 2016-04-11 00:17:12 +02:00
Krunoslav Zaher 681bbf8c00 Updates Linux tests. 2016-04-11 00:16:11 +02:00
Krunoslav Zaher 39a87bfcfd Fixes anomaly with `multicast` subscription disposal. 2016-04-11 00:07:54 +02:00
Krunoslav Zaher 18cf20820f Merge pull request #550 from stack/uisearchbar-cancel
UISearchBar Cancel Event
2016-04-10 12:57:13 +02:00
Stephen H. Gerstacker d6731613d9 Switched to ButtonClicked over Tap for UISearchBar delegate methods 2016-04-09 18:22:29 -04:00
Krunoslav Zaher 45540eb574 Improves UITableView and UICollectionView tests. 2016-04-10 00:06:28 +02:00
Krunoslav Zaher f40826c148 Merge pull request #608 from 53ningen/feature/break
removed unnecessary `break`
2016-04-08 22:30:45 +02:00
gomi_ningen 1ce3622c10 removed unnecessary `break` 2016-04-08 13:44:59 +09:00
Krunoslav Zaher f50a33c1e2 Fixes warnings with deprecated selector specifications. 2016-04-08 00:08:03 +02:00
Krunoslav Zaher 43b0c306d8 Updates comments. 2016-04-07 23:25:25 +02:00
Krunoslav Zaher 77d72dcaee Updates comments. 2016-04-07 23:22:37 +02:00
Krunoslav Zaher 0b90d9d053 Merge pull request #604 from 53ningen/feature/typo
fixed typo
2016-04-07 12:39:56 +02:00
Krunoslav Zaher 26032f7ce1 Merge pull request #607 from shingt/replace-remaining-failWith
Replace failWith with error in examples
2016-04-07 12:39:35 +02:00
Krunoslav Zaher 8bf939d17d Merge pull request #601 from monotonique/fix_link
Fixed Link to Dicision Tree
2016-04-07 12:39:05 +02:00
Krunoslav Zaher 837e9e7a69 Merge pull request #602 from 53ningen/feature/comment
fixed a comment
2016-04-07 12:34:48 +02:00
gomi_ningen b4a5d05c09 fixed typo 2016-04-07 03:56:08 +09:00
gomi_ningen f72c4d604f fixed a comment 2016-04-06 14:21:07 +09:00
shingt 5b7dff230f Replace failWith with error in examples 2016-04-06 09:48:30 +09:00
Andrés Catalán 80aaef06c2 Update Contents.swift
The comment to `toObservable` referred to another function.
2016-04-05 18:54:10 -04:00
Krunoslav Zaher 5c1adf29df Small fix for Tips.md 2016-04-05 21:53:11 +02:00
Krunoslav Zaher 7773d2828e Merge pull request #593 from kkdevenda/develop
Removed ambiguity in the documentation of 'value' property
2016-04-02 17:43:55 +02:00
krishna a2edb47807 Removed ambiguity in the documentation of 'value' property 2016-04-02 19:46:13 +05:30
Krunoslav Zaher 890fc04106 Merge pull request #587 from chanelten/remove_compiler_warnings
Remove compiler warnings
2016-03-31 00:01:54 +02:00
Krunoslav Zaher 7ad3365296 Merge pull request #585 from pixyzehn/feature/fix-getting-started-text
Use 'Completed' instead of 'Complete'
2016-03-30 23:13:08 +02:00
Alexander I. Kovács a30288e5f9 Disable bitcode for test targets
Setting ENABLE_BITCODE to NO for test targets removes the following compiler warnings when building the project via Carthage and Xcode 7.3:

ld: warning: Auto-Linking supplied '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.
2016-03-30 18:07:55 +09:00
Alexander I. Kovács a5c9e6ad65 Do not require application extension API only for test targets
Setting APPLICATION_EXTENSION_API_ONLY to NO for test targets removes the following compiler warnings when building the project via Carthage and Xcode 7.3:

ld: warning: linking against a dylib which is not safe for use in application extensions: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/XCTest
2016-03-30 18:07:38 +09:00
Nagasawa Hiroki 8a1e87e6b8 Use 'Completed' instead of 'Complete' 2016-03-29 18:56:11 +09:00
Krunoslav Zaher 7dffae6dc8 Merge pull request #578 from tarunon/feature/drive_to_variable
Adding drive to Variable operator to Driver
2016-03-28 22:11:50 +02:00
Krunoslav Zaher dc4857252b Merge pull request #581 from bricklife/rendering-playgrounds
Turns on 'Render Documentation' for playgrounds again
2016-03-28 19:54:01 +02:00
Krunoslav Zaher 1615ab88f3 Merge pull request #582 from kkdevenda/master
Documentation for skipUntil corrected
2016-03-28 19:53:40 +02:00
Krishna 5a112ed064 Documentation for skipUntil corrected
It seems a copy paste error as documentation for both `skipUntil` and `takeUntil` was same.
I have corrected the documentation for `skipUntil` keeping `takeUntil` intact.
2016-03-28 16:49:07 +05:30
Shinichiro Oba c2ab272cc7 Turns on 'Render Documentation' for playgrounds. 2016-03-28 11:46:43 +09:00
Stephen H. Gerstacker f58d032d34 tvOS Fixes for UISearchBar
- `searchBarCancelButtonClicked:` is only available on iOS.
- UISearchBar instantiation is not supported on tvOS, so all subclass
  delegate methods and tests are skipped.
2016-03-27 21:31:53 -04:00
Krunoslav Zaher 6292a3303a Merge pull request #556 from sergdort/rx_search_controller_delegate_proxy
Added reactive extensions for UISearchController
2016-03-27 20:23:57 +02:00
Stephen H. Gerstacker 2db92e9727 Upgraded UISearchBar selectors to Swift 2.2 selectors 2016-03-26 21:02:09 -04:00
Stephen H. Gerstacker dd37af0069 Additional UISearchBar Methods
- Added the searchTap for the "searchBarSearchButtonClicked:" delegate
  method.

- Added the "rx_createDelegateProxy" method to UISearchBar.
2016-03-26 20:57:23 -04:00
Krunoslav Zaher 157d7f1328 Merge pull request #577 from fantattitude/patch-2
Markdown typo on Why.md
2016-03-26 11:32:24 +01:00
tarunon 1570dc70c5 adding drive to variable operator to Driver 2016-03-26 00:26:24 +09:00
Vivien Leroy e0e113f969 Markdown typo on Why.md
Sentence was not bold because of space after the two stars
2016-03-25 15:24:42 +01:00
Krunoslav Zaher 1ed2daed68 Merge pull request #569 from ejensen/typos
Typo fixes
2016-03-23 23:07:50 +01:00
Krunoslav Zaher 4568ac6592 Merge pull request #570 from ejensen/mixed-tabs
Correct mixed indentation
2016-03-23 22:55:30 +01:00
Eric Jensen 9899bd7d39 Use modern dictionary syntax 2016-03-22 20:12:06 -07:00
Eric Jensen ddf9cdd33f Correct typos 2016-03-22 20:10:44 -07:00
Eric Jensen 2b0dd31a9f Correct mixed indentation by replacing tabs with spaces 2016-03-22 20:04:39 -07:00
George Lin 4a37077db1 Fixed Link to Dicision Tree
- removed a redundant parenthesis
2016-03-23 10:48:12 +08:00
Stephen H. Gerstacker e1ea14819c Merge branch 'develop' into uisearchbar-cancel 2016-03-22 20:41:09 -04:00
sergdort 2f16a4faa7 Adds reactive extensions for UISearchController and tests to cover them 2016-03-22 16:50:07 +02:00
Krunoslav Zaher 6df77da474 Updates `CHANGELOG.md` with 2.3.1 release. 2016-03-22 13:32:18 +01:00
Krunoslav Zaher 5dfab9ca70 Removes wrong condition from unit tests. 2016-03-22 13:32:03 +01:00
Krunoslav Zaher c136ce57e6 Updates release notes. 2016-03-22 12:23:03 +01:00
Krunoslav Zaher 5d004eeb4f Release 2.3.1 2016-03-22 12:21:05 +01:00
Krunoslav Zaher bd8b188a49 Fixes for Swift 2.2 warnings in unit tests. 2016-03-22 12:12:15 +01:00
Stephen H. Gerstacker f91b86b8d2 Merge branch 'develop' into uisearchbar-cancel 2016-03-22 06:57:56 -04:00
Krunoslav Zaher c234adb9d7 Fixes compilation problems with 9.3 runtime. 2016-03-22 11:44:46 +01:00
Krunoslav Zaher 65644c6160 Fixes Swift 2.2 warnings. 2016-03-22 11:29:39 +01:00
Krunoslav Zaher 834cd872f5 Updates data sources. 2016-03-22 11:20:10 +01:00
Krunoslav Zaher 9e8bb711ab Merge pull request #566 from koke/associatedtype
Use new associatedtype syntax
2016-03-22 11:10:35 +01:00
Jorge Bernal eddbd23aa5 Use new associatedtype syntax 2016-03-22 11:09:16 +01:00
Krunoslav Zaher 4df2711aee Updates travis to xcode7.3 image. 2016-03-22 10:18:01 +01:00
Krunoslav Zaher 1c628486c8 Merge branch 'xcode/7.3' into develop 2016-03-22 10:17:08 +01:00
Yosuke Ishikawa 24af30f32a Workaround for segmentation fault in CurrentThreadScheduler.schedule() 2016-03-22 10:14:53 +01:00
Douglas Heriot 6cd3d53b4b Change anyGenerator to AnyGenerator for Swift 2.2 (Xcode 7.3) 2016-03-22 10:14:53 +01:00
Jorge Bernal e5be80763d Use StaticString for file in XCTest helpers 2016-03-22 10:14:53 +01:00
Krunoslav Zaher 5bc22a1f9c Merge pull request #561 from chipp/develop
Make ScheduledDisposable initializer public
2016-03-22 10:02:37 +01:00
Vladimir Burdukov 7a561b402c Make ScheduledDisposable initializer public 2016-03-21 08:19:14 +03:00
Krunoslav Zaher 966734d9d7 Updates `CHANGELOG.md`. 2016-03-18 23:08:52 +01:00
Krunoslav Zaher 40e2d4a086 Merge branch 'dakeshi-issue-553' into develop 2016-03-18 22:41:07 +01:00
Krunoslav Zaher 70bdd79d68 Merge branch 'issue-553' of https://github.com/dakeshi/RxSwift into dakeshi-issue-553 2016-03-18 22:40:44 +01:00
Krunoslav Zaher d301a5bc2a Merge pull request #558 from rasad88/patch-1
Add Carthage compatibility badge
2016-03-18 22:29:02 +01:00
rasad88 e8530fffcb Add Carthage compatibility badge 2016-03-17 14:35:23 -07:00
Krunoslav Zaher 20113e40b0 Merge remote-tracking branch 'origin/develop' into develop 2016-03-17 11:15:53 +01:00
Krunoslav Zaher a1c2448efe Fixes synchronization problem with `SingleAssignmentDisposable`. 2016-03-17 10:40:24 +01:00
dakeshi 9e8af26719 Update syntax for RxSwift2.x, Swift2.x 2016-03-17 18:02:07 +09:00
Stephen H. Gerstacker 6b8fe1eabe Merge branch 'uisearchbar-cancel' of https://github.com/stack/RxSwift into uisearchbar-cancel 2016-03-13 21:05:25 -04:00
Stephen H. Gerstacker 92911a6876 Added rx_cancelTap for the searchBarCancelButtonClicked: delegate method 2016-03-13 21:04:31 -04:00
Stephen H. Gerstacker 3f6bcf356e Added for the delegate method 2016-03-13 21:02:32 -04:00
Krunoslav Zaher 67f268a614 Merge pull request #548 from kitasuke/improve_geolocation_service_in_example_project
Use capture list in Geolocation example
2016-03-13 23:52:00 +01:00
kitasuke 296e28f390 Delete semicolons 2016-03-13 14:07:41 -07:00
kitasuke 2b2f416820 Use capture list 2016-03-13 14:07:28 -07:00
Krunoslav Zaher 4754216ffd Fixes broken link in `GettingStarted.md`. 2016-03-13 19:53:33 +01:00
Krunoslav Zaher 439e6bddda Improves blocking unit tests cleanup logic. 2016-03-13 19:53:17 +01:00
Krunoslav Zaher 09eb8803d4 Fixes data source link in `GerringStarted.md`. 2016-03-13 18:08:36 +01:00
Krunoslav Zaher f9663df3bf Fixes compilation of example app. 2016-03-13 18:01:39 +01:00
Krunoslav Zaher 6b3b732208 Fixes RxExample-no-module compilation. 2016-03-13 17:50:52 +01:00
Krunoslav Zaher dd73952b4e Fixes problems with automation. 2016-03-13 17:30:55 +01:00
Krunoslav Zaher e3154bd2b7 Fixes automation tests. 2016-03-13 17:30:55 +01:00
Krunoslav Zaher cf7dd1714c Fixes editing in RxExample app. 2016-03-13 17:30:55 +01:00
Krunoslav Zaher ccd4f29231 Fixes debug configuration. 2016-03-13 17:30:55 +01:00
Krunoslav Zaher 718495a6ea Fixes `rx_selectedScopeButtonIndex` tests. 2016-03-13 17:30:55 +01:00
Krunoslav Zaher d1272a2d8d Updates `CHANGELOG.md`. 2016-03-13 17:30:55 +01:00
Krunoslav Zaher d7a271b48f Release 2.3.0 2016-03-13 17:30:55 +01:00
Krunoslav Zaher 80edd849ff Synchronizes `RxDataSources`. 2016-03-13 17:30:55 +01:00
Krunoslav Zaher b8c7e520b8 Merge pull request #545 from narfdotpl/patch-1
Fixes typo in Units.md
2016-03-13 17:08:10 +01:00
Maciej Konieczny c3a4a4cf92 Fixes typo in Units.md 2016-03-13 16:01:04 +01:00
Krunoslav Zaher 3d1177ece2 Merge pull request #544 from hachinobu/develop
fix typo. idenfifier → identifier
2016-03-13 15:54:47 +01:00
hachinobu b8aab01b86 fix typo. idenfifier → identifier 2016-03-13 23:40:14 +09:00
Krunoslav Zaher f3aa884f5e Merge pull request #515 from stack/uisearchbar-additions
Support for UISearchBar selectedScopeButtonIndex
2016-03-13 14:48:33 +01:00
Krunoslav Zaher 896d656c3b Fixes automation tests. 2016-03-13 12:50:02 +01:00
Stephen H. Gerstacker 4ebf810993 Added tests for selectedScopeButtonIndex 2016-03-12 22:23:27 -05:00
Stephen H. Gerstacker 23a3743a23 Typo in test name 2016-03-12 22:13:14 -05:00
Stephen H. Gerstacker 097467e07c Merge branch 'develop' into uisearchbar-additions 2016-03-12 22:08:13 -05:00
Krunoslav Zaher d16dd15679 Fixes unit tests for `UISearchBar`. 2016-03-13 00:23:00 +01:00
Krunoslav Zaher 4e860a541e Fixes unit tests. 2016-03-12 22:00:33 +01:00
Krunoslav Zaher e43a6785be Documents why using `NSTextStorage + observeOn(MainScheduler.asyncInstance)` for `UITextField` extensions. 2016-03-12 21:36:43 +01:00
Krunoslav Zaher 19900bfaac Fixes problem with UITextView two way binding. 2016-03-12 21:30:48 +01:00
Krunoslav Zaher c6a1f799b0 Improves `Tips.md`. 2016-03-12 20:30:09 +01:00
Krunoslav Zaher c3707616c0 Adds testing and tips documentation. 2016-03-12 20:13:22 +01:00
Krunoslav Zaher 7a16f60d31 Merge pull request #540 from pixyzehn/feature/modify-argument-in-uiview-extension
Change label to view in RxExample
2016-03-12 14:30:42 +01:00
Nagasawa Hiroki 3f2ecaf84b Change label to view in RxExample 2016-03-11 10:16:49 +09:00
Krunoslav Zaher e68becb3b3 Merge pull request #535 from garnett/simplify-computed-properties
Simplify computed properties
2016-03-08 22:57:33 +01:00
Krunoslav Zaher 7168dba9ec Merge pull request #534 from garnett/fix-inline-doc-typos
Fix grammar errors and add some dots.
2016-03-08 22:53:56 +01:00
Krunoslav Zaher 1fa8cc431a Merge pull request #536 from zhigang1992/PR-Remove-NSData
remove ?? NSData()
2016-03-08 22:52:58 +01:00
Zhigang Fang b4d129974f Remove unneed ?? NSData() 2016-03-08 09:08:08 +08:00
Denis Lebedev 0567020538 Simplify computed properties 2016-03-07 17:31:00 +00:00
Denis Lebedev 863678639d Fix grammar errors and add some dots. 2016-03-07 17:18:45 +00:00
Krunoslav Zaher e5735611c9 Improves playground documentation. #531 2016-03-06 22:51:35 +01:00
Krunoslav Zaher c8aa48f32f Adds run instructions to every playground page. 2016-03-06 22:49:55 +01:00
Krunoslav Zaher c9e81b81f3 Merge pull request #530 from afonsograca/patch-2
Fixed Grammar mistake then/than
2016-03-06 22:43:57 +01:00
Krunoslav Zaher 6e08500ebc Improves single operator logic. 2016-03-06 22:07:58 +01:00
Afonso dbb2261f67 Fixed Grammar mistake then/than
"Then" was being used as the comparison connector of some sentences. The correct word usage is "than"
2016-03-05 21:44:49 +00:00
Krunoslav Zaher 18acdd02ff Fixes `rx_badgeValue` inline documentation. 2016-03-05 21:04:06 +01:00
Krunoslav Zaher 375121f8e7 Fixes using original image instead of edited image. #492 2016-03-05 21:03:16 +01:00
Krunoslav Zaher c36e93b991 Merge branch 'develop' of github.com:kzaher/RxSwift into develop 2016-03-05 20:51:17 +01:00
Krunoslav Zaher 8825bcc31e Merge pull request #527 from ertrzyiks/add-rx-badgeValue-to-uitabbaritem
Adds 'rx_badgeValue' to UITabBarItem
2016-03-05 20:42:15 +01:00
Krunoslav Zaher a7508fb3a7 Fixes `README.md` examples. 2016-03-05 19:37:57 +01:00
Mateusz Derks 8b9bbff4ee Adds 'rx_badgeValue' to UITabBarItem 2016-03-04 14:14:38 +01:00
Krunoslav Zaher 8021db9958 Merge pull request #516 from sambae/uiprogressview
Adds `rx_progress` to `UIProgressView`
2016-02-28 23:47:09 +01:00
sambae 8559a67d89 Adds `rx_progress` to `UIProgressView` 2016-02-28 01:26:32 -05:00
Stephen H. Gerstacker 74dd160d56 Support for UISearchBar selectedScopeButtonIndex 2016-02-27 14:06:20 -05:00
Krunoslav Zaher c24df15131 Merge pull request #514 from Shelin69/master
Issue #511 - free array
2016-02-27 17:52:49 +01:00
Krunoslav Zaher 2c81bcb1e7 Merge pull request #509 from tomburns/optional-notification-name
Make name parameter of rx_notification optional.
2016-02-27 17:26:35 +01:00
Joanna Kubiak fffd955fba Issue #511 - added free to reslove memory leaking warnings 2016-02-27 17:14:33 +01:00
Tom Burns 7cb5a3b79a Make name parameter of rx_notification optional. 2016-02-24 20:47:13 -06:00
Krunoslav Zaher 396b1a1498 Merge pull request #508 from btroncone/patch-2
Fixed a few grammar issues in README
2016-02-24 23:25:18 +01:00
Brian Troncone d0bc059509 Fixed a few grammar issues in README
Copy of PR from master branch, fixed a few grammar issues in README to increase readability.
2016-02-24 17:16:12 -05:00
Krunoslav Zaher f9728a858f Adds explanation to how to run the examples in `ConnectableObservableOperators` playground. 2016-02-20 12:19:02 +01:00
Krunoslav Zaher e05e527111 Adds another useful link to understand reactive programming. 2016-02-20 11:34:35 +01:00
Krunoslav Zaher a3f589ad3a Merge branch 'develop' of github.com:kzaher/RxSwift into develop 2016-02-20 11:11:39 +01:00
Krunoslav Zaher 543cd499a8 Merge pull request #491 from justjoeyuk/master
Updated Typo in Simple Validation example
2016-02-20 11:07:24 +01:00
Krunoslav Zaher 4ebe7e4daa Merge pull request #495 from matthew-healy/develop
Minor rewrite of Math Behind Rx file
2016-02-20 11:06:56 +01:00
Matthew Healy e60af252e1 Minor rewrite of Math Behind Rx file 2016-02-18 21:19:24 +00:00
Joey Clover ee31a5421a Updated Typo in Simple Validation example 2016-02-17 23:46:57 +00:00
Krunoslav Zaher 26031abf02 Removes implicitly unwrapped options. 2016-02-17 20:17:48 +01:00
Krunoslav Zaher af497121df Merge pull request #484 from AdamRitenauer/PreprocessorFix
Work around to an error with preprocessors in swift
2016-02-15 19:14:40 +01:00
Adam Ritenauer 55f3ec4041 Adds a work around to an error in swifts handling of preprocessor directives 2016-02-15 09:32:05 -08:00
Krunoslav Zaher 698a50b381 Returns device testing to automation scripts. 2016-02-14 23:26:39 +01:00
Krunoslav Zaher 1524ead3f2 Polishes README.md 2016-02-14 23:26:18 +01:00
Krunoslav Zaher 22cd5f79d1 Adds 2.2.0 changes to `CHANGELOG.md`. 2016-02-14 22:44:29 +01:00
Krunoslav Zaher 03aa560de0 Adds `rx_selected` to `UIControl`. 2016-02-14 22:44:13 +01:00
Krunoslav Zaher ff452009cd Fixes test compilation on Linux. 2016-02-14 12:34:53 -08:00
Krunoslav Zaher a7d96765d6 Fixes compilation on Linux. 2016-02-14 12:23:19 -08:00
Krunoslav Zaher db5959fc6e Release 2.2 2016-02-14 17:24:28 +01:00
Krunoslav Zaher b9d6aeb49c Selects release version of the RxExample app. 2016-02-14 17:22:44 +01:00
Krunoslav Zaher 01ef8b5030 Integrates activity indicator extensions and improves memory management. 2016-02-14 17:21:22 +01:00
Krunoslav Zaher 2596f25432 Fixes automation scripts. 2016-02-14 17:21:10 +01:00
Krunoslav Zaher 3f46a7a0f6 Unifies header depth. 2016-02-14 15:31:03 +01:00
Krunoslav Zaher 29c9d9df14 Adds groups to links in README.md 2016-02-14 15:29:12 +01:00
Krunoslav Zaher dc9a0f5505 Updates documentation. 2016-02-14 15:10:14 +01:00
Krunoslav Zaher d537473e49 Improves error wording. 2016-02-13 23:58:06 +01:00
Krunoslav Zaher 1c0475860a Fixes problem with required error. 2016-02-13 23:49:41 +01:00
Krunoslav Zaher 300c44aced More workarounds for Swift compiler bugs. 2016-02-13 23:36:01 +01:00
Krunoslav Zaher b08bf24201 Adds workarounds for compiler bugs. 2016-02-13 23:15:57 +01:00
Krunoslav Zaher ba2787c3cb Fixes referencing `self` instead of parameter. 2016-02-13 23:12:34 +01:00
Krunoslav Zaher c3a04d0c67 Improves curl formatting. 2016-02-13 22:16:06 +01:00
Krunoslav Zaher 7dc8dfc6d1 Applies `UIBindingObserver`. 2016-02-13 22:12:50 +01:00
Krunoslav Zaher 2aebe1499f Adds `UIBindingObserver`. 2016-02-13 21:25:31 +01:00
Krunoslav Zaher e0555a05a5 Merge pull request #480 from pixyzehn/modify-tapgesture-in-example
Use rx_event instead of Selector
2016-02-13 20:37:02 +01:00
Krunoslav Zaher e855916b47 Merge pull request #431 from mwoollard/develop
Add rx wrapper for UITableViewDelegate tableVIew:accessoryButtonTappedForRowWithIndexPath: method
2016-02-12 11:08:52 +01:00
Krunoslav Zaher bbb5b6f300 Merge pull request #466 from sergdort/swift_evolution_currying
Changes for currying
2016-02-12 11:07:03 +01:00
Nagasawa Hiroki 75eeb546fe Use rx_event instead of Selector 2016-02-12 19:03:01 +09:00
Krunoslav Zaher 78e0351e2c Merge pull request #479 from adamsp/patch-1
Clarify examples in Warnings.md
2016-02-09 22:45:58 +01:00
Adam Speakman 2aef2cc39d Clarify examples in Warnings.md
There were a few minor spelling mistakes, and I cleaned up some of the examples to be a little clearer.
2016-02-09 16:38:16 -05:00
sergdort cc4c0f8cb0 Fixed `func castOrFatalError<T>(value: AnyObject!) -> T` in favor of `func castOrFatalError<T>(value: Any!) -> T` 2016-02-09 10:33:37 +02:00
Krunoslav Zaher cf308a1e74 Merge pull request #477 from iandundas/patch-1
Updated CocoaPods instructions for latest CocoaPods
2016-02-09 08:47:00 +01:00
Ian Dundas 753a4338b7 Updated CocoaPods instructions for latest CocoaPods
In CocoaPods 1.0.0.beta.3, the Podfile now needs to specify the target name, otherwise `pod install` fails with the following:

```[!] The dependency `RxSwift (~> 2.0)` is not used in any concrete target.
The dependency `RxCocoa (~> 2.0)` is not used in any concrete target.```

I added an extra step to the instructions to make it work again. The above format of course still works on the pre-1.0.0 cocoapods as well, so I believe it's safe to update the instructions already.
2016-02-08 20:52:39 +01:00
Krunoslav Zaher f4bb68696c Adds timer and interval to `Driver`. 2016-02-07 21:22:40 +01:00
Krunoslav Zaher 82e8b005fd Merge pull request #475 from pixyzehn/remove-blank-line
Remove a blank line
2016-02-07 18:11:55 +01:00
Nagasawa Hiroki ab3d9de696 Remove a blank line 2016-02-06 19:22:30 +09:00
Mark Woollard 00508f0b8e Resolve conflict in Main.storyboard
# Conflicts:
#	RxExample/RxExample/iOS/Main.storyboard
2016-02-05 20:23:01 +00:00
Mark Woollard c6c6ec002d Correction for rx_itemAccessoryButtonTapped unit test - use testRow value for delegate call 2016-02-05 20:16:39 +00:00
Mark Woollard 825d09a04b Added unit tests for rx_itemAccessoryButtonTapped
Added test to validate observable produces the correct NSIndexPath when delegate method called
2016-02-05 20:16:39 +00:00
Mark Woollard 87b36ffb0d Add use of rx_itemAccessoryButtonTapped to simple table view example 2016-02-05 20:16:39 +00:00
Mark Woollard 08a3161354 Rx wrapper for UITableViewDelegate tableView:accessoryButtonTappedForRowWithIndexPath: method 2016-02-05 20:14:34 +00:00
Krunoslav Zaher d0cd75036d Adds `skip` and `startWith` to `Driver`. 2016-02-05 16:20:18 +01:00
Krunoslav Zaher 14e9a04ab6 Fixes problem with RunLoopLock calling run loop stop multiple times. 2016-02-05 15:36:34 +01:00
Krunoslav Zaher 8e9df5acc8 Merge pull request #414 from MadsBogeskov/master
Added reactive wrapper for the network activity indicator in UIApplication
2016-02-04 12:50:43 +01:00
Krunoslav Zaher 6c1cb92559 Merge pull request #469 from mingliangfeng/develop
Update rxmarbles.com so it can be opened directly.
2016-02-04 11:43:10 +01:00
sergdort f6dad5f3a8 Changes for currying #465 2016-02-03 23:19:31 +02:00
Andrew Feng 29583c12a1 Update rxmarbles.com so it can be opened directly. 2016-02-03 09:33:58 +11:00
Krunoslav Zaher 85107b3ecd Merge pull request #467 from pra85/patch-1
Fix minor typo in Readme.md
2016-02-02 22:08:12 +01:00
Prayag Verma 6741269975 Fix minor typo in Readme.md
Replace `a` with `an`
2016-02-02 23:43:09 +05:30
Krunoslav Zaher f58be5d759 Merge pull request #459 from ishkawa/feature/UIRefreshControl
Add rx_refreshing for UIRefreshControl
2016-01-31 23:36:22 +01:00
Krunoslav Zaher 99e5579f20 Adds optional parameter to `timer` operator. 2016-01-31 23:07:18 +01:00
Thane Gill 912e3de6e8 [testRetryWhen_Incremental_BackOff] Fix return type 2016-01-31 22:53:22 +01:00
Thane Gill 7e8884d94c [Timer] Return generic SignedIntegerType Observable for timer instead of Int64 2016-01-31 22:52:53 +01:00
Yosuke Ishikawa fa3f68971e Fix target OS of UIRefreshControl 2016-01-31 00:59:09 +09:00
Yosuke Ishikawa aafe14f093 Revert "Remove UIRefreshControl+RxTests from AllTests-tvOS"
This reverts commit bac715d202.
2016-01-31 00:57:10 +09:00
Yosuke Ishikawa bac715d202 Remove UIRefreshControl+RxTests from AllTests-tvOS 2016-01-31 00:48:59 +09:00
Yosuke Ishikawa 974bba5218 Add rx_refreshing for UIRefreshControl 2016-01-31 00:33:36 +09:00
Mark Woollard 7e78517f8a Correction for rx_itemAccessoryButtonTapped unit test - use testRow value for delegate call 2016-01-29 07:34:12 +00:00
Mark Woollard 79163619be Added unit tests for rx_itemAccessoryButtonTapped
Added test to validate observable produces the correct NSIndexPath when delegate method called
2016-01-29 07:30:10 +00:00
Krunoslav Zaher 14efe368a7 Merge pull request #449 from CapsuleHealth/master
adds rx_active observer for NSLayoutConstraint
2016-01-28 21:14:16 +01:00
mikelow 3ff8a18c34 adds rx_active observer for NSLayoutConstraint 2016-01-27 18:16:20 -05:00
Krunoslav Zaher b7273f0e35 Merge pull request #448 from thanegill/bindNext-error
Change error message to "Binding error: \(error)"
2016-01-27 22:17:06 +01:00
Thane Gill 8aba766224 [bindNext] Change error message to "Binding error: \(error)" 2016-01-27 11:26:52 -08:00
Krunoslav Zaher 89a68deff0 Merge pull request #446 from tako3/master
Fix typo
2016-01-27 10:32:52 +01:00
Nobutaka Yuasa a9149df19a Fix typo 2016-01-27 17:15:16 +09:00
Krunoslav Zaher cf06a20750 Removes explicit slack url in favor of badge. 2016-01-26 22:33:55 +01:00
Krunoslav Zaher 329cc17bc6 Updates index and comparison part. 2016-01-26 22:05:54 +01:00
Krunoslav Zaher 49a74d9437 Adds badges to `README.md`. 2016-01-25 22:33:33 +01:00
Krunoslav Zaher f0f48371c5 Polishes `Driver` public interface. 2016-01-25 21:58:21 +01:00
Krunoslav Zaher b8d46bec0c Readds `onError` to `Driver` `do` operator because removing it would break API backwards compatibility for 2.0.0. 2016-01-25 21:54:31 +01:00
Krunoslav Zaher 300931015b Adds documentation for `of` operator on `Driver`. 2016-01-25 21:05:52 +01:00
Krunoslav Zaher 9c16b24065 Updates linux tests. 2016-01-25 21:00:00 +01:00
Krunoslav Zaher af6772d7eb Fixes typo. 2016-01-25 20:51:24 +01:00
Krunoslav Zaher f9f30229a0 Merge remote-tracking branch 'dpyro/documentation-grammar' into develop 2016-01-25 20:50:44 +01:00
Krunoslav Zaher 7dbc403e1e Merge branch 'develop' of github.com:kzaher/RxSwift into develop 2016-01-25 20:36:32 +01:00
Sumant Manne 8b8a98521b Partial doc grammar edit.
Edited for grammar but not meaning.
2016-01-24 13:15:12 -06:00
Carlos García 4a7926e544 GeolocationSubscriptionExample 2016-01-24 13:46:58 +01:00
Mark Woollard 53e9845cb8 Add use of rx_itemAccessoryButtonTapped to simple table view example 2016-01-23 19:52:06 +00:00
Mark Woollard 00bf5716a3 Rx wrapper for UITableViewDelegate tableView:accessoryButtonTappedForRowWithIndexPath: method 2016-01-23 19:51:10 +00:00
Krunoslav Zaher 365550e3ec Merge pull request #423 from koke/feature/playground-generate
Add generate example to playground
2016-01-22 22:32:23 +01:00
Krunoslav Zaher f109aaf98e Merge pull request #409 from tarunon/fix/UIBarButtonItem_rx_tap_cannot_share
Make UIBarButtonItem.rx_tap to shareable.
2016-01-22 22:31:27 +01:00
Krunoslav Zaher bed5d882df Merge pull request #401 from thanegill/doOn-shortcuts
Add doOn shortcut operators
2016-01-22 22:20:27 +01:00
Jorge Bernal 1e9a14a230 Add generate example to playground 2016-01-21 07:55:22 +01:00
tarunon ed9a996b15 Fix `rx_tap` method using `rx_lazyInstanceObservable` 2016-01-21 11:28:18 +09:00
tarunon 00b9169538 Move `rx_lazyInstanceObservable` from NSControl to private NSObject extension. 2016-01-21 11:27:11 +09:00
Thane Gill b4eb61419b [testDoOnError_throws] Use different error than original one 2016-01-20 17:18:01 -08:00
Thane Gill e9057b98c2 Rename doOnComplete to doOnCompleted 2016-01-20 17:17:48 -08:00
Krunoslav Zaher a3afac7428 Merge pull request #419 from ReactiveX/fix-broken-link
Update GettingStarted.md
2016-01-20 21:16:56 +01:00
Krunoslav Zaher 13a1bb470e Merge pull request #420 from skywinder/fix-map-example
improve map example
2016-01-20 21:16:02 +01:00
Petr Korolev 37e4166295 improve example 2016-01-20 14:35:40 +02:00
Carlos García d443918692 Update GettingStarted.md 2016-01-20 11:56:02 +01:00
Krunoslav Zaher ab045db79f Merge pull request #407 from thanegill/remove-warning
Remove warning for unused variable
2016-01-19 10:11:02 +01:00
Mads Bøgeskov bda14c48c7 Added reactive wrapper for the network activity indicator in UIApplication. 2016-01-18 19:41:28 +01:00
tarunon 360ade3f1f Make rx_tap to shareable. ControlEvent initializer move to BarButtonItemTarget. 2016-01-18 11:33:05 +09:00
Thane Gill 7a57b9360d Remove onError from Driver 2016-01-17 13:14:48 -08:00
Thane Gill b225572d9a Add doOn shortcuts to Driver 2016-01-17 13:14:18 -08:00
Thane Gill f9c933fd4c Remove warning for unused variable
Warning:
immutable value 'i' was never used; consider replacing with '_' or removing it
2016-01-17 12:08:08 -08:00
Thane Gill badb02f5c3 Add 6 tests for doOn* shortcuts 2016-01-17 11:37:46 -08:00
Thane Gill 0ce634ca50 Rename tests to doOn instead of Do 2016-01-17 11:08:01 -08:00
Thane Gill b0a990e952 Use new doOnNext shortcut operator 2016-01-17 09:46:14 -08:00
Krunoslav Zaher 1e1194aadd Replaces `unowned` with `weak` in `UIImagePickerController+RxCreate.swift`. 2016-01-17 16:19:45 +01:00
Krunoslav Zaher a50c6e59e9 Merge pull request #402 from sergdort/image_picker_example_bug
Fixes for bug with UIImagePickerController example.
2016-01-17 16:15:13 +01:00
Krunoslav Zaher 4e4d9dd794 Fixes podspec dependencies. 2016-01-17 13:43:33 +01:00
Krunoslav Zaher a8dd559ba2 Merge branch 'master' into develop 2016-01-17 13:36:55 +01:00
Krunoslav Zaher 76eb62083d Fixes a typo in `RxTableViewDataSourceProxy`. 2016-01-17 13:36:46 +01:00
Carlos García 5194af426c update podspec to RxSwift to 2.1 2016-01-16 19:44:13 +01:00
Carlos García 9ea0d14503 update podspec to RxSwift to 2.1 2016-01-16 19:30:30 +01:00
sergdort 5e619180ee Fixes for bug with UIImagePickerController example. To dismiss image picker on cancel button press 2016-01-12 10:17:29 +02:00
Thane Gill 0e9be4980d Add doOn shortcut operators 2016-01-11 17:21:17 -08:00
Krunoslav Zaher df8739fcfd Fixes a typo in `RxTableViewDataSourceProxy`. 2016-01-11 10:50:36 +01:00
Krunoslav Zaher b00d35a5ef Updates documentation. 2016-01-11 00:42:07 +01:00
Krunoslav Zaher 59c0f9069f Adds release Swift flag to release build. 2016-01-10 22:50:44 +01:00
Krunoslav Zaher 4f9fb55ab5 Release 2.1.0 2016-01-10 22:42:50 +01:00
Krunoslav Zaher 38cd00522d Fixes automation. 2016-01-10 22:42:15 +01:00
Krunoslav Zaher 3b0c80dbf1 Makes debug mode less verbose by treating `TRACE_RESOURCES` as a integer level. #397 2016-01-10 21:29:04 +01:00
Krunoslav Zaher 1b26e9bbd6 Declares `SpinLock` as `NSRecursiveLock` on `Darwin` because of `https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html`. 2016-01-10 20:57:55 +01:00
Krunoslav Zaher 0091fa3a2f Improves thread safety of KVO by serializing KVO events. 2016-01-10 20:50:27 +01:00
Krunoslav Zaher d7366b0b72 Adds unit tests for `rx_enabled` on `NSControl` and `rx_state` on `UIButton`. 2016-01-10 20:33:30 +01:00
Krunoslav Zaher eeddf1fe5d Adds `SectionedViewDataSourceType` and `rx_modelDeselected`, `rx_deselectedItemAtIndexPath` for `UICollectionView`, and corresponding unit tests. 2016-01-10 20:19:30 +01:00
Krunoslav Zaher c6526e830a Adds `UIImagePicker` documentation. 2016-01-10 18:36:43 +01:00
Krunoslav Zaher ffc976dac9 Refactors `UIImagePickerController` to use more idiomatic coding style. 2016-01-10 18:33:01 +01:00
Krunoslav Zaher 8babd6a4d1 Merge pull request #400 from darrensapalo/patch-2
Update Examples.md
2016-01-10 16:25:42 +01:00
Darren 95f2748738 Update Examples.md 2016-01-10 18:53:52 +08:00
Krunoslav Zaher 09c790ee95 Merge pull request #387 from sergdort/UIImagePickerController_Rx
Rx wrappers for UIImagePickerController
2016-01-07 21:32:20 +01:00
Krunoslav Zaher 444d4c8611 Merge pull request #394 from yannickl/develop
[ADD] rx_itemDeselected and rx_modelDeselected events
2016-01-07 21:23:29 +01:00
Krunoslav Zaher e50053164b Merge pull request #391 from ReactiveX/dry-dispatch-queue-scheduler-qos
DRY DispatchQueueSchedulerQOS
2016-01-07 13:53:07 +01:00
Krunoslav Zaher e3ce0e13fb Merge pull request #389 from 53ningen/for-loop
Replace C-style for loop with Swift-style for-in loop
2016-01-07 13:52:04 +01:00
Yannick Loriot e5978c796d [UPDATE] Test case 2016-01-07 13:10:00 +01:00
Yannick Loriot f00effc9b5 [ADD] rx_itemDeselected and rx_modelDeselected events 2016-01-07 13:06:39 +01:00
sergdort a25cdd598c Added tests for UIImagePickerController+Rx 2016-01-06 19:28:31 +02:00
yury 5e0a230e78 DRY DispatchQueueSchedulerQOS 2016-01-06 15:11:02 +03:00
53nigen 4dccf08bfd Replace C-style for loop with Swift-style for-in loop 2016-01-06 16:35:01 +09:00
sshulga d665aaff61 Puts Krunoslav's Copyright 2016-01-05 15:21:16 +02:00
sshulga fe4dda0ed7 Rx wrappers for UIImagePickerController 2016-01-05 15:15:15 +02:00
Krunoslav Zaher 61cbebeef0 Merge pull request #384 from hadashiA/fix-http-body-logging
Fix http body logging of NSURLSession
2016-01-04 22:03:08 +01:00
f-kubotar 4c6e55509f fix http body logging of NSURLSession 2016-01-05 00:02:05 +09:00
Krunoslav Zaher c1f5931fb8 Adds unit tests for `SequenceType` version of `toObservable`. 2016-01-02 23:51:24 +01:00
Krunoslav Zaher 87aa7ede42 Moves all tests into Rx.xcodeproj and enables coverage tests. 2016-01-02 22:55:43 +01:00
Krunoslav Zaher 111bbfb5e3 Merge pull request #377 from mrahmiao/develop
Adds two rx properties to Cocoa controls.
2016-01-02 18:30:14 +01:00
Krunoslav Zaher 1c47f0a792 Updates documentation. 2016-01-02 00:36:33 +01:00
Krunoslav Zaher 12bfa3ddef Updates `CHANGELOG.md` with 2.0.0 changes. 2016-01-02 00:35:08 +01:00
Krunoslav Zaher f13c35e8d0 Fixes automation scripts. 2016-01-01 23:38:23 +01:00
Krunoslav Zaher 10fdfa0d00 Updates debug label position. 2016-01-01 23:38:10 +01:00
Krunoslav Zaher 35be3f644b Decreases Sign up alert time. 2016-01-01 20:49:57 +01:00
Krunoslav Zaher 6dd9ff1e1e Ironing scripts. 2016-01-01 20:49:36 +01:00
Krunoslav Zaher 95aa450181 Release 2.0.0 2016-01-01 20:41:54 +01:00
Krunoslav Zaher 903904b5d4 Polish for header validation script. 2016-01-01 20:09:25 +01:00
Krunoslav Zaher c8549e2581 Updates `RxSwift.podspec`. 2016-01-01 18:08:10 +01:00
mrahmiao c7a641fe21 Fixes test failures of `rx_state` of `NSButton` and `rx_enabled` of `NSControl`.
Signed-off-by: mrahmiao <mrahmiao@gmail.com>
2016-01-01 22:28:48 +08:00
Krunoslav Zaher c8ea0f7532 Rearranges partial updates example in RxExample app. 2016-01-01 14:58:15 +01:00
mrahmiao 035b40d9a3 Unifies the header of NSControl+RxTests.swift
Signed-off-by: mrahmiao <mrahmiao@gmail.com>
2016-01-01 21:21:18 +08:00
Krunoslav Zaher 913d54ed23 Changes organization identifier to `io.rx` and changes organization name to `ReactiveX`. 2016-01-01 14:11:05 +01:00
Krunoslav Zaher daefc26b47 Packages `RxDataSourceStarterKit`. 2016-01-01 13:46:11 +01:00
Krunoslav Zaher 81735c16cc Polish for `NSTextView`. 2016-01-01 13:13:07 +01:00
Krunoslav Zaher 5cef79e046 Merge pull request #371 from sergdort/rx_text_bug_#333
Fixes for UITextView rx_text bug with autocorrect enabled #333
2016-01-01 13:05:13 +01:00
mrahmiao 01cef92f9c Merge branch 'feature/osx-cocoa-extensions' into develop 2016-01-01 17:51:29 +08:00
mrahmiao 2ea5b73bd0 Adds `rx_enabled` to `NSControl`. 2016-01-01 17:51:02 +08:00
mrahmiao 96aef6e47a Adds `rx_state` to `NSButton`. 2016-01-01 17:30:34 +08:00
Segey Shulga f357e1178b Added #if os(iOS) || os(tvOS) macro for NSTextStorage+Rx 2015-12-31 18:45:14 +02:00
Segey Shulga fdce3558f0 Merge branch 'develop' into rx_text_bug_#333
# Conflicts:
#	Rx.xcodeproj/project.pbxproj
#	Rx.xcworkspace/contents.xcworkspacedata
#	RxExample/RxExample.xcodeproj/project.pbxproj
2015-12-31 18:10:57 +02:00
Segey Shulga c555862a67 #333 made changes according to Rx naming conventions 2015-12-31 17:41:57 +02:00
Krunoslav Zaher 91058f98d1 hanges link in `Examples.md` to point to `README.md#playgrunds`. #375 2015-12-31 13:14:37 +01:00
Krunoslav Zaher 706e52d302 Fixes build script. 2015-12-31 13:00:32 +01:00
Krunoslav Zaher aca3b28213 Removes deprecated APIs. 2015-12-31 00:37:58 +01:00
Krunoslav Zaher 83bac6db0c Updates spm status in docs. 2015-12-30 20:55:43 +01:00
Krunoslav Zaher 6d4f04ea7b Fixes package configuration for SPM. 2015-12-30 20:13:38 +01:00
Krunoslav Zaher 2d9f891f30 Adds mocks for QOS on Linux. 2015-12-30 08:17:16 -08:00
Krunoslav Zaher 6c3a83bfe0 Renames `*.Platform.swift` to `Platform.*.swift` and fixes build issues. 2015-12-30 16:54:43 +01:00
Krunoslav Zaher 1aa52d2f63 Merge pull request #373 from hsoi/feature/hsoi-schedulers-QoS
Adding Quality of Service (QOS) support to the Schedulers
2015-12-30 16:45:43 +01:00
John C. Daub a37dc9f3d3 running packager 2015-12-30 09:30:59 -06:00
John C. Daub a8890ad7ac QOS is only available on OS X 10.10 and later. 2015-12-30 09:06:21 -06:00
Krunoslav Zaher 0c8e808744 Fixes problems with ambiguity between `DriverConvertibleType` and `ObservableType`. 2015-12-30 15:55:20 +01:00
Krunoslav Zaher 3637e94287 Documents and polishes scripts. 2015-12-30 15:20:50 +01:00
Krunoslav Zaher 439ca291bc Updates `Scheduler` documentation. 2015-12-30 15:20:50 +01:00
Krunoslav Zaher 435a84ca25 Renames `scripts/package-swift-manager.swift` to `scripts/package-spm.swift`. 2015-12-30 15:20:50 +01:00
Krunoslav Zaher 984b825f31 Merge pull request #372 from finneycanhelp/flatMap-example-needs-bit-more
flatMap example needed print statement added in order to see what was coming from se…
2015-12-30 15:20:37 +01:00
John C. Daub b3f4bf13f2 Update tests to adopt the QOS approach. 2015-12-30 08:10:34 -06:00
John C. Daub f57230f9ef Update ConcurrentDispatchQueueScheduler and SerialDispatchQueueScheudler to adopt the new QOS enums. Add deprecation warnings to the priority mechanisms. 2015-12-30 08:09:50 -06:00
Mike Finney c7aa8607b9 Needed to add print statement in order to see what was coming from sequenceInt 2015-12-30 08:09:47 -06:00
John C. Daub fdf579786d Adding `DispatchQueueSchedulerQOS` enum, which provides the Apple-recommended quality of service classes. 2015-12-30 08:08:57 -06:00
sshulga 195586ef76 Merge branch 'develop' of https://github.com/ReactiveX/RxSwift into rx_text_bug_#333
Conflicts:
	RxCocoa/iOS/UITextView+Rx.swift
2015-12-30 15:15:02 +02:00
sshulga 32d048fe05 Fixes for UITextView rx_text bug with autocorrect enabled #333 2015-12-30 14:58:47 +02:00
Krunoslav Zaher 901933454c Fixes CocoaPods validation script. 2015-12-30 04:20:26 +01:00
Krunoslav Zaher c389e21e90 Fixes Linux version. 2015-12-29 19:04:45 -08:00
Krunoslav Zaher 8b31b428bf Updates package. 2015-12-30 04:03:18 +01:00
Krunoslav Zaher 8e4a154360 Removes `RxMutableBox` from large part of unit tests. 2015-12-30 03:51:27 +01:00
Krunoslav Zaher 1ca156c1a2 Adapts automation scripts to new example app. 2015-12-30 03:17:04 +01:00
Krunoslav Zaher f4ef06e88d Updates documentation with API changes. 2015-12-30 03:16:20 +01:00
Krunoslav Zaher 6bc1ae0ff9 Deprecates `ScopedDisposable` and `scopedDispose` in favor of `DisposeBag`. 2015-12-30 02:50:07 +01:00
Krunoslav Zaher c4eb18acfd Deprecates `UIAlertView` and `UIActionSheet` extensions. 2015-12-30 02:20:24 +01:00
Krunoslav Zaher a3e2765e3d Removes `sampleLatest` unit tests. 2015-12-30 02:10:53 +01:00
Krunoslav Zaher 5db80857b9 Removes scheduler parametrization for `Driver` in `RxExample` project. 2015-12-30 02:05:03 +01:00
Krunoslav Zaher 8b8d32dc23 Updates changelog with 2.0.0-rc.0 changes. 2015-12-30 01:55:46 +01:00
Krunoslav Zaher f4475a7bcf Deprecates `sampleLatest` in favor of `withLatestFrom`. 2015-12-30 01:52:24 +01:00
Krunoslav Zaher eae477499a Removes `Driver` operator API scheduler parametrization. 2015-12-30 01:38:37 +01:00
Krunoslav Zaher 22b937b08b Adds `Linux.md`. 2015-12-30 00:42:05 +01:00
Krunoslav Zaher 8b2984e4e2 Deprecates `Variable` implementing `ObservableType` in favor of `asObservable()`, and changes behavior so it completes the sequence once it is deallocated. 2015-12-29 23:49:30 +01:00
Krunoslav Zaher 839051fe9b Polishes table view with editing example. 2015-12-29 23:28:15 +01:00
Krunoslav Zaher 33ffe82139 Exposes `driveOnScheduler`. 2015-12-29 22:14:06 +01:00
Krunoslav Zaher e445d4eec3 Another fix for Swift bugs with collisions between optimizations and testability. 2015-12-29 18:24:51 +01:00
Krunoslav Zaher 77d452db34 Workaround for Swift bug when compiler optimizes away `driverObserveOnScheduler` and `driverSubscribeOnScheduler` even though there is testability turned on. 2015-12-29 17:59:07 +01:00
Krunoslav Zaher a66badfdb7 Includes tests for `RxExample-iOS` in `pre-release-tests.sh`. 2015-12-29 17:41:44 +01:00
Krunoslav Zaher 249135a3f7 Updates headers for GitHub sign-up example. 2015-12-29 17:39:21 +01:00
Krunoslav Zaher f1482d2126 Adds marble tests for GitHub sign-in example. 2015-12-29 17:37:13 +01:00
Krunoslav Zaher 004e637774 Adds parallel example of GiHub sign in using vanilla observables and `Driver`. 2015-12-29 17:36:32 +01:00
Krunoslav Zaher 2722096b0a Updats documentation for `rx_controlEvents` to `rx_controlEvent`. 2015-12-29 17:35:18 +01:00
Krunoslav Zaher 3561214733 Unit tests polish. 2015-12-29 17:34:05 +01:00
Krunoslav Zaher 3710c96f5f Fixes unit tests for deprecation of `rx_controlEvents` in favor of `rx_controlEvent`. 2015-12-29 17:33:28 +01:00
Krunoslav Zaher 9a060ea10c Adds `Equatable` constraint to `rx_value<T>`. 2015-12-29 17:32:35 +01:00
Krunoslav Zaher e79cc3c88f Deprecates `rx_controlEvents` in favor of `rx_controlEvent`. Adds `Equatable` constraint to `rx_value<T>`. 2015-12-29 17:31:57 +01:00
Krunoslav Zaher 02328f6ba5 Adds tests for variable conversion to `Driver`. 2015-12-29 17:22:47 +01:00
Krunoslav Zaher e5b07f6c41 Adds `resolution` and `simulateProcessingDelay` to `TestScheduler`. Adds additional prints in case two sequences of events aren't equal. 2015-12-29 17:01:33 +01:00
Krunoslav Zaher 2dc22c8d0b Polish for `Debug` operator. 2015-12-29 17:00:50 +01:00
Krunoslav Zaher 28d4e4d4bd Adds `driveOnScheduler` to enable using custom mock scheduler with `Driver`. 2015-12-29 16:59:55 +01:00
Krunoslav Zaher 5d677eaf91 Standardizes header format. 2015-12-29 16:56:21 +01:00
Krunoslav Zaher 788aaf87e8 Changes `playgrounds.sh` in `pre-release-tests.sh` to execute `validate-playgrounds.sh`. 2015-12-29 12:15:53 +01:00
Krunoslav Zaher 7d8cbef3e9 Merge pull request #365 from fpillet/develop
Grammar and minor tweaks
2015-12-29 12:08:26 +01:00
Krunoslav Zaher b7e0ca68fe Fixes anomaly with `Timeout`. #367 2015-12-28 15:15:38 +01:00
Florent Pillet 5e1efc438a Grammar and minor tweaks 2015-12-28 08:57:14 +01:00
Krunoslav Zaher 79a6f59de2 Fixes warnings in playgrounds. 2015-12-28 02:54:25 +01:00
Krunoslav Zaher 86ff70b259 Packages `RxTests` changes. 2015-12-28 02:47:37 +01:00
Krunoslav Zaher 419a057fa9 Hides `HotObservable` and `ColdObservable` behind `TestableObservable`. Renames `MockObserver` to `TestableObserver`. 2015-12-28 02:46:18 +01:00
Krunoslav Zaher 9a732086ef Removes tests that are crashing compiler on Linux. 2015-12-28 02:20:23 +01:00
Krunoslav Zaher 95dea91c73 Small fixes for Linux. 2015-12-27 17:07:13 -08:00
Krunoslav Zaher f948e46800 Cleans up run loop code in tests. 2015-12-28 01:59:00 +01:00
Krunoslav Zaher f2be26e95c Updates Swift package. 2015-12-28 01:55:26 +01:00
Krunoslav Zaher aa7a521244 More unit tests for `VirtualTimeScheduler` and `HistoricalScheduler`. 2015-12-28 01:46:45 +01:00
Krunoslav Zaher e4a837ab1e Merge pull request #360 from sergdort/rx_text_bug_#333
Fixes regarding UITextField rx_text autocorrection bug #333
2015-12-28 01:27:41 +01:00
Krunoslav Zaher bbf42c0957 Fixes problems with exposing `AtomicInt` and fixes deprecated scheduler warnings. 2015-12-28 01:24:33 +01:00
Krunoslav Zaher 9d4d93b474 Adds unit tests for `VirtualTimeScheduler` and `HistoricScheduler`. 2015-12-28 01:24:33 +01:00
Krunoslav Zaher cadd4c02d7 Makes `TestScheduler` subclass of `VirtualTimeScheduler`. 2015-12-28 01:24:33 +01:00
Krunoslav Zaher a263a3ceb6 Makes `AtomicInt` public when tracking resources. 2015-12-28 01:24:33 +01:00
Krunoslav Zaher 3868268f44 Deprecates `sharedInstance` on `ConcurrentMainScheduler` in favor of `instance`. 2015-12-28 01:24:33 +01:00
Krunoslav Zaher 62b25c538d `Driver` now picks scheduler from static variable. 2015-12-28 01:24:33 +01:00
Krunoslav Zaher 9712c6d45c Changes infinite sequence to struct. 2015-12-28 01:24:33 +01:00
Krunoslav Zaher 578f270252 Makes resource counting logic cross platform. 2015-12-28 01:24:32 +01:00
Krunoslav Zaher b10a0cc3d7 Moves `VirtualTimeScheduler` to RxSwift. 2015-12-28 01:24:32 +01:00
Krunoslav Zaher c54521fb08 Adds `PriorityQueue`. 2015-12-28 01:24:32 +01:00
Krunoslav Zaher 388ebac8cd Deprecates `MainThreadScheduler.sharedInstance` in favor of `MainThreadScheduler.instance`. Adds unit tests for `CurrentThreadScheduler` and `MainThreadScheduler`. 2015-12-28 01:24:32 +01:00
Krunoslav Zaher 4cc8c0f49a Merge pull request #362 from sendyhalim/patch-1
Update comment
2015-12-28 01:14:23 +01:00
Sendy Halim dab4a196bc Update comment 2015-12-28 00:50:22 +07:00
Krunoslav Zaher bbd2c37e95 Adds named parameter `start` to `range` and `initialState` to `generate`. 2015-12-27 13:17:37 +01:00
Krunoslav Zaher a54b6fbbc2 Adds default value for `repeatElement` scheduler parameter. 2015-12-27 12:53:39 +01:00
Krunoslav Zaher 65ba8df6d8 Returns XCTest+Rx to RxTests target. 2015-12-27 02:25:21 +01:00
Krunoslav Zaher 37d1cb8db0 Fixes `RxTests` compilation with Swift Package Manager. 2015-12-27 02:19:36 +01:00
Krunoslav Zaher 4238573c5a Removes `RxCocoa` from package. 2015-12-27 01:41:28 +01:00
Krunoslav Zaher 3f37013e44 Temporary removes `retryWhen` from unit tests on Linux. 2015-12-27 01:22:05 +01:00
Krunoslav Zaher 8a38f39444 Adds test `main.swift` generator on Linux. 2015-12-27 01:12:36 +01:00
sshulga 8a15b92236 Fixes regarding UITextField rx_text autocorrection bug #333 2015-12-26 22:07:05 +02:00
Krunoslav Zaher 08eb41e082 Adds platform specific files to RxExample-no-module. 2015-12-26 05:08:32 +01:00
Krunoslav Zaher 09e9abf2b7 Fixes problem compiling 'CurrentThreadScheduler'. 2015-12-25 19:58:58 -08:00
Krunoslav Zaher aa89d2f7d4 Adds RxMutableBox to Source AllTests. 2015-12-26 04:57:55 +01:00
Krunoslav Zaher 22b9de44c0 Removes RxCocoaTests links from Sources. 2015-12-26 04:50:32 +01:00
Krunoslav Zaher e3df171b3f Fixes build for Darwin. 2015-12-26 04:47:04 +01:00
Krunoslav Zaher b5dbdc452c RxTests compiles first time on Linux. 2015-12-25 19:32:52 -08:00
Krunoslav Zaher a982be0942 RxSwift compiles first time on Linux. 2015-12-25 19:29:39 -08:00
Krunoslav Zaher 4651df2317 Adds initial version of Swift package manager. 2015-12-26 02:28:27 +01:00
Krunoslav Zaher f26167e10a Adds initial `Package.swift`. 2015-12-26 00:44:45 +01:00
Krunoslav Zaher d377f61794 Linux fixes. 2015-12-25 23:33:25 +01:00
Krunoslav Zaher e2819880f0 Linux porting changes. 2015-12-25 22:31:58 +01:00
Krunoslav Zaher 78c83fdaad Moves extensions from `RxTest` file. 2015-12-25 22:14:59 +01:00
Krunoslav Zaher 839239f7dd Adds Linux support to RxTest. 2015-12-25 21:48:18 +01:00
Krunoslav Zaher 75a528ea6d Replaces spin lock with expectation mechanism, removes C style for loop, error comparison reuses logic from event comparison. 2015-12-25 21:43:05 +01:00
Krunoslav Zaher e1a2daa0a5 Removes C style for loops. 2015-12-25 20:59:52 +01:00
Krunoslav Zaher 5bff7acc44 Removes spin lock from unit tests. 2015-12-25 20:55:52 +01:00
Krunoslav Zaher bee92f9700 Cleanup. 2015-12-25 20:30:40 +01:00
Krunoslav Zaher f183ac08e0 Moves `Driver` tests from RxSwift tests to RxCocoa tests. 2015-12-25 18:34:55 +01:00
Krunoslav Zaher 9cae95d3ef Fixes Swift 2.2 warnings. 2015-12-25 12:50:42 +01:00
Krunoslav Zaher 0a864f1f0c Fixes `Debug` operator Linux issues. 2015-12-25 11:58:55 +01:00
Krunoslav Zaher 56847dd7f9 Fixes storyboard warnings. 2015-12-24 20:26:45 +01:00
Krunoslav Zaher 3d2c2af3b4 Small fixes for example app. 2015-12-24 19:50:59 +01:00
Krunoslav Zaher 26b38e3444 Transforms strong into weak reference for `rx_notification` wrapper. 2015-12-24 19:50:22 +01:00
Krunoslav Zaher d387f91afa Removes `SchedulerType` associated types in favor of concrete types. 2015-12-23 21:17:57 +01:00
Krunoslav Zaher fd28645051 Fixes warnings in playgrounds. 2015-12-23 11:23:54 +01:00
Krunoslav Zaher 0a6a377c5f Deprecates free functions `timer` and `interval` in favor of `Observable<E>.timer` and `Observable<E>.interval`. 2015-12-23 11:23:15 +01:00
Krunoslav Zaher 7f64228ae3 Updates sequence grammar. 2015-12-23 11:04:40 +01:00
Krunoslav Zaher 9116fee6f8 Updates documentation. 2015-12-21 22:17:33 +01:00
Krunoslav Zaher 49017a6565 Fixes warnings. 2015-12-21 22:17:22 +01:00
Krunoslav Zaher c8f7b13586 Fixes driver warnings in unit tests. 2015-12-21 21:50:44 +01:00
Krunoslav Zaher d09832edff Small polish. 2015-12-21 21:48:11 +01:00
Krunoslav Zaher 6040789f93 Fixes warnings. 2015-12-21 21:45:13 +01:00
Krunoslav Zaher a905b6bdc7 Factory methods for `Driver` are moved from `Drive` to `Driver`. 2015-12-21 21:39:25 +01:00
Krunoslav Zaher 5e1732134c Fixes warnings in unit tests. 2015-12-21 21:34:48 +01:00
Krunoslav Zaher 5716cc3cec Transforms free functions to factory functions on `Observable`. (just, never, error, generate, combineLatest, zip ...) 2015-12-21 20:55:37 +01:00
Krunoslav Zaher f2d49adc32 Updates `CHANGELOG.md`. 2015-12-21 12:59:38 +01:00
Krunoslav Zaher ea265109fd Changes wording to use passive form. 2015-12-21 12:51:11 +01:00
Krunoslav Zaher 411a9cca1b Fixes template files. 2015-12-21 12:50:30 +01:00
Krunoslav Zaher ecdf0a9898 Adds `seealso` references to `reactivex.io`. 2015-12-21 12:50:13 +01:00
Krunoslav Zaher 8d0f514b6d Release 2.0.0-rc.0 2015-12-21 03:29:03 +01:00
Krunoslav Zaher 135de0f5fa Adds links to `Units.md` unit. 2015-12-21 03:23:02 +01:00
Krunoslav Zaher 93572bb5d7 Updates `Units.md` documentation. 2015-12-21 03:19:48 +01:00
Krunoslav Zaher f39917d1e9 Fixes CocoaPods deprecated warning. 2015-12-21 03:02:24 +01:00
Krunoslav Zaher b7b092247e Temporary turns off control automation test since those cases are already covered in unit tests, and re-enables example app signing. 2015-12-21 03:01:00 +01:00
Krunoslav Zaher a6aa088dca Updates `cellType` parameter in README.md. 2015-12-21 03:00:22 +01:00
Krunoslav Zaher a2d7fc9c74 Increases resource count time to 0.2 sec. 2015-12-21 02:12:18 +01:00
Krunoslav Zaher b89f3f35c7 Fixes compilation error with OSX example. 2015-12-21 02:12:00 +01:00
Krunoslav Zaher e86516891f Replaces `unowned` with `weak`. 2015-12-21 01:33:54 +01:00
Krunoslav Zaher 4ba729f7ad Refactors calculator example to be more clear. 2015-12-21 01:33:32 +01:00
Krunoslav Zaher 415af045ec Add tests for optional `cellType`. 2015-12-21 01:20:28 +01:00
Krunoslav Zaher 3d55baa4e1 Adds `cellType` parameter to `rx_itemsWithCellIdentifier`. 2015-12-21 01:19:08 +01:00
Krunoslav Zaher 26819fff60 Adds documentation to xcworkspace. 2015-12-20 22:47:22 +01:00
Krunoslav Zaher 5bb551438b Documents `KVORepresentable` optional initializer. 2015-12-20 22:46:42 +01:00
Krunoslav Zaher 7c2b34a100 Deprecates `rx_controlEvents` in favor of `rx_controlEvent`. 2015-12-20 22:46:21 +01:00
Krunoslav Zaher f6b13c84aa Merge pull request #351 from ReactiveX/feature/RxTests
Feature/rx tests
2015-12-20 18:24:18 +01:00
Krunoslav Zaher e383aae249 Documents `VirtualTimeSchedulerBase` and `TestScheduler`. 2015-12-20 18:18:51 +01:00
Krunoslav Zaher 646209ea09 Fixes problem with double registration of optimized observer for `BOOL` aka `char`. 2015-12-20 17:57:08 +01:00
Krunoslav Zaher b9018f69af Renamed `MockObserver` property `messages` to `events`. 2015-12-20 17:43:19 +01:00
Krunoslav Zaher 1506071b15 Documents `HotObservable` and `ColdObservable`. 2015-12-20 15:34:26 +01:00
Krunoslav Zaher 4595982842 Makes build scripts more generic. 2015-12-20 14:03:34 +01:00
Krunoslav Zaher 43064439c2 Fixes building RxTests for devices. 2015-12-20 12:32:40 +01:00
Krunoslav Zaher 1e28105ed3 Makes `Recorded` more generic. 2015-12-20 11:45:47 +01:00
Krunoslav Zaher 7147629173 Improves failure reporting. 2015-12-20 11:11:08 +01:00
Krunoslav Zaher b6a284635c Adds `validate-podspec.sh` to `pre-release-tests.sh`(Release mode). 2015-12-20 10:18:24 +01:00
Krunoslav Zaher 6f1cb8020c Validate podspec now works for RxTests. 2015-12-20 10:17:12 +01:00
Krunoslav Zaher d338c50ade Adds RxTests podspec. 2015-12-20 01:28:29 +01:00
Krunoslav Zaher 6748d884d6 Unit tests pass for first time after extracting `RxTests`. 2015-12-20 00:44:51 +01:00
Krunoslav Zaher 6dfec96820 Fixes directory structure, adds Podspec, fixes `pre-release-tests.sh`. 2015-12-19 18:40:09 +01:00
Krunoslav Zaher 57ca792dc6 Creates `RxTests` targets. 2015-12-19 18:12:54 +01:00
Krunoslav Zaher 86ec1acbcf Removes `RxBox` and `RxMutableBox` from public interface. 2015-12-19 17:55:49 +01:00
Krunoslav Zaher 3668778c34 Polish for `debug` operator format. 2015-12-19 15:26:52 +01:00
Krunoslav Zaher 23b5f4e04a Fixes warnings in playgrounds. 2015-12-19 15:16:29 +01:00
Krunoslav Zaher eb3f308648 Fixes `debug` operator to default to file and line in case identifier wasn't provided. 2015-12-19 15:15:46 +01:00
Krunoslav Zaher 33c9226169 Unhides external parameter name for `reduce` operator (breaking change in `reduce`). 2015-12-19 14:49:20 +01:00
Krunoslav Zaher 536128f8e8 Adds error handling during `bindNext`. 2015-12-19 14:38:41 +01:00
Krunoslav Zaher 637b19947c Deprecates versions with hidden external parameter name (scheduler, count ...). 2015-12-19 14:30:19 +01:00
Krunoslav Zaher 85a3e11ef4 Merge pull request #308 from ReactiveX/feature/observe_method_calls
observe method calls (rx_sentMessage)
2015-12-19 13:57:55 +01:00
Krunoslav Zaher a1ffb15d4b New Xcode. 2015-12-19 13:31:37 +01:00
Krunoslav Zaher a92dbb7cbc Fixes code compilation on Xcode < 7.2 2015-12-19 01:51:31 +01:00
Krunoslav Zaher 1ad68469fd Fixes tests. 2015-12-19 01:44:58 +01:00
Krunoslav Zaher b338c81e0d Merge remote-tracking branch 'origin/develop' into feature/observe_method_calls 2015-12-19 01:07:05 +01:00
Krunoslav Zaher b328cef22c Merge branch 'develop' into feature/observe_method_calls 2015-12-19 01:06:38 +01:00
Krunoslav Zaher 384aa73ff3 Merge pull request #350 from nanoxd/update-readme
Documentation Updates
2015-12-18 23:42:13 +01:00
Krunoslav Zaher 3508301e3b Finishes `rx_sentMessage`. 2015-12-18 23:33:58 +01:00
Fernando Paredes e54fa1f207 [GettingStarted] Use canonical way of checking a string for a string 2015-12-18 08:29:02 -08:00
Fernando Paredes 79a079dc49 [Examples] Use `isEmpty` instead of manual zero-checking 2015-12-18 08:23:47 -08:00
Fernando Paredes 375725578c [Docs] Update GettingStarted with proper NSURLSession rx_response 2015-12-18 08:14:24 -08:00
Fernando Paredes 740a3c4805 Update README's KVO to match new API 2015-12-18 08:05:12 -08:00
Fernando Paredes b7c0891e4e Update NSURLSession function in README 2015-12-17 22:00:45 -08:00
Krunoslav Zaher f6a11e5eb9 Merge pull request #349 from nanoxd/update-image-optionality
Remove use of unwrapped optionals from NSImageView
2015-12-16 21:17:55 +01:00
Fernando Paredes 3754186efe Update UIImageView's method signatures for API Docs 2015-12-16 11:48:02 -08:00
Fernando Paredes 442066562a Match NSImageView to UIImageView's optional image API 2015-12-16 11:47:59 -08:00
Krunoslav Zaher 53cb12e253 Merge pull request #346 from nanoxd/update-api-docs
[NSURLSession] Remove force unwrapped return from rx_JSON
2015-12-16 20:43:48 +01:00
Krunoslav Zaher c32a46b526 Merge pull request #347 from nanoxd/update-location-docs
Update CLLocationManager API Docs to match code
2015-12-16 20:43:24 +01:00
Fernando Paredes 4ae3e1281e Update Example app for tests 2015-12-16 11:12:44 -08:00
Fernando Paredes 82f6d05030 Update CLLocationManager API docs to match code 2015-12-16 11:07:52 -08:00
Fernando Paredes dc85614a8b [NSURLSession] Remove force unwrapped returns from rx_JSON 2015-12-16 10:47:25 -08:00
Krunoslav Zaher 31dda1297e Merge pull request #344 from ReactiveX/debug-despose-timestamp
Move NSDateFormatter to instance var. Add timestamp to dispose
2015-12-16 11:57:08 +01:00
yury c90511b99b Move NSDateFormatter to instance var. Add timestamp to dispose 2015-12-16 13:48:13 +03:00
Krunoslav Zaher 9b37a36001 Merge pull request #341 from petester42/develop
Set global deployment target for frameworks
2015-12-16 10:27:53 +01:00
Pierre-Marc Airoldi 39a545045e Set global deployment target for frameworks 2015-12-15 21:45:43 -05:00
Krunoslav Zaher cafafe493f Merge pull request #340 from icanzilb/master
Reflect infinite sequences in the regex example
2015-12-15 18:14:28 +01:00
Marin Todorov 1bfaedfec4 Reflect infinite sequences in the regex example
The text gives an example of an infinite sequence here "Some sequences are finite, and some are infinite, like sequence of button taps" and just few lines below tries to explain sequences with a regex (which is great). However the regex was always having a terminating element (error or completion) and that contradicts the idea of an infinite sequence (which never terminates). 

What I did was to add a "?" to the terminating element in the regex example
2015-12-15 12:12:27 +01:00
Krunoslav Zaher 96395c62fa Merge pull request #337 from nRewik/develop
Update new Playground API
2015-12-14 18:06:53 +01:00
nRewik 90833dc290 Update new Playground API 2015-12-14 21:14:47 +07:00
Krunoslav Zaher 9439b281bb Small scheduler directory cleanup. 2015-12-13 15:47:46 +01:00
Krunoslav Zaher c337e642dc Polish for `CLLocationManager` interface and adds unit tests. 2015-12-13 15:28:00 +01:00
Krunoslav Zaher 38ba177e8f Improves `TailRecursiveSink` dispose logic. 2015-12-13 13:05:43 +01:00
Krunoslav Zaher 1148e3393c Simplifies logic in `TailRecursiveSink`. 2015-12-13 10:49:53 +01:00
Krunoslav Zaher 04ee3754d7 Adds time stamp to `debug` operator printout. 2015-12-13 01:08:33 +01:00
Krunoslav Zaher aea5848d83 Small polishing for GitHub repository search. 2015-12-13 00:33:17 +01:00
Krunoslav Zaher 6dcdf281b8 Moves `disctinctUntilChanged` to `ActivityIndicator`. 2015-12-13 00:27:02 +01:00
Krunoslav Zaher c534db0fac Polishing for GitHub repository search example. 2015-12-13 00:23:51 +01:00
Krunoslav Zaher d201397fa3 Improves tail recursive optimizations for `concat`, documents then and adds additional unit tests. 2015-12-13 00:07:57 +01:00
Krunoslav Zaher 0b5b9fe97a Adds `deferred` to `Driver` unit. 2015-12-12 21:07:00 +01:00
Krunoslav Zaher d786b367f1 Changes `ConnectableObservable` class. Generic parameter is now type of elements in observable sequence. 2015-12-12 20:36:30 +01:00
Krunoslav Zaher e14ca2e94d Fixes problem with autocorrect and `rx_text` on `UITextView`. #333 2015-12-12 20:00:33 +01:00
Krunoslav Zaher c8dc9cde0d Fixes Travis. 2015-12-12 17:34:48 +01:00
Krunoslav Zaher 170d21b2fe Updates `pre-release-tests.sh` for Xcode 7.2 2015-12-12 17:28:28 +01:00
Krunoslav Zaher 9fb35d737b Improves leak detection logic and adds suggestions how to detect memory leaks. 2015-12-12 17:28:28 +01:00
Krunoslav Zaher f983831113 Merge pull request #332 from brunokoga/master
Fixes broken WWDC 2014 links on README.md
2015-12-11 11:52:34 +01:00
Krunoslav Zaher 5c30d1068d Merge pull request #330 from finneycanhelp/remove-dead-code-issue-329
removed dead code
2015-12-11 10:34:36 +01:00
Mike Finney 51a46c014f removed dead code 2015-12-10 18:00:50 -06:00
Bruno Koga e63912fafb Fixes broken WWDC 2014 links on README.md 2015-12-09 13:07:24 +01:00
Krunoslav Zaher fcc46aafea Moves `SentMessageTest` from RxSwift to RxCocoa tests. 2015-12-08 21:43:31 +01:00
Krunoslav Zaher 3162f55f68 Merge branch 'develop' into feature/observe_method_calls 2015-12-08 21:30:13 +01:00
Krunoslav Zaher aeff907a8d Release 2.0.0-beta.4 2015-12-07 00:58:20 +01:00
Krunoslav Zaher e89ddd9891 Updates `CHANGELOG.md`. 2015-12-07 00:55:51 +01:00
Krunoslav Zaher a6730acec2 Fixes docs for `rx_animating`. 2015-12-07 00:40:53 +01:00
Krunoslav Zaher 08e68c66e4 Updates automation scripts. 2015-12-07 00:14:28 +01:00
Krunoslav Zaher e01e2105b1 Adds preloading of shared resources to improve leak detection logic. 2015-12-06 23:45:49 +01:00
Krunoslav Zaher 5f8fc67d7d Adds simple example of table view with sections. 2015-12-06 23:35:34 +01:00
Krunoslav Zaher 68a792988d Polishes GitHubSignup into a simple MVVM example. 2015-12-06 22:39:12 +01:00
Krunoslav Zaher ca1488841c Adds simple validation example. 2015-12-06 20:58:16 +01:00
Krunoslav Zaher 8522d71b54 Adds numbers example. 2015-12-06 20:33:50 +01:00
Krunoslav Zaher b08c1a5969 Extends `UIView` with `rx_alpha`, `rx_hidden`. `NSLayoutConstraint` with `rx_constant`. 2015-12-06 20:33:03 +01:00
Krunoslav Zaher a0c68de05d Adds `shareReplayLatestWithReplay` to `RxExample-iOS-no-module`. 2015-12-06 14:59:54 +01:00
Krunoslav Zaher 3cfccfafed Adds tests for `shareReplayLatestWhileConnected`, adds type hints to `createObserver` and adds additional `Driver` tests. 2015-12-06 14:51:07 +01:00
Krunoslav Zaher 532c6c2c7b Adds type hints to `empty`, `never` and `failWith`. 2015-12-06 14:50:38 +01:00
Krunoslav Zaher 2a30fe5069 Changes `Driver` to use `shareReplayLatestWhileConnected` for connection sharing. 2015-12-06 14:48:42 +01:00
Krunoslav Zaher fb970bb4e7 Adds `shareReplayLatestWhileConnected()`. 2015-12-06 14:47:17 +01:00
Krunoslav Zaher 827ee57fff Exposes initializers for `ControlEvent` and `ControlProperty`. 2015-12-06 01:14:05 +01:00
Krunoslav Zaher 6d794361f6 Merge pull request #317 from JamStop/develop
Change parameter to use type alias for better code consistency
2015-12-05 18:12:59 +01:00
Krunoslav Zaher 523ea64dea Merge pull request #312 from persidskiy/fix/tests-leaking
Get rid of memory leaking in UIKit unit tests
2015-12-05 18:12:19 +01:00
Krunoslav Zaher e47ce0e5f2 Exposes `RxScrollViewDelegateProxy` and `RxTextViewDelegateProxy`. 2015-12-05 18:10:51 +01:00
Krunoslav Zaher d2b374a6a7 Exposes `UITableView` and `UICollectionView` delegate and data source proxies. 2015-12-05 17:42:43 +01:00
Krunoslav Zaher 3ea275cd9c Fixes unit tests. 2015-12-05 12:28:27 +01:00
Krunoslav Zaher 55dac75201 Fixes problem with improper detection of delegate proxy class hierarchies. #286 2015-12-05 12:04:51 +01:00
Krunoslav Zaher fa69e11a3c Updates `flatMapFirst` and adds it to `Driver` unit. 2015-12-05 00:44:44 +01:00
JamStop 25cca7c5f8 Change parameter to use type alias for better code consistency 2015-12-04 12:26:17 -08:00
persidskiy 7fa016f7b8 get rid of memory leaking in UIKit unit tests 2015-12-04 01:42:48 +03:00
Krunoslav Zaher ebf146ca41 Merge pull request #307 from persidskiy/feature/UIAvtivityIndicatorView
Add rx_animating to UIActivityIndicatorView
2015-12-03 22:22:17 +01:00
Krunoslav Zaher 2acca4987b Merge remote-tracking branch 'origin/master' into develop 2015-12-03 22:17:11 +01:00
Orta 9f61f57c29 Merge pull request #309 from fastred/patch-1
Fix typo in README: s/exists/exits/
2015-12-03 11:58:18 -05:00
Arkadiusz Holko ca96692715 Add missing articles in cell blurring example in README 2015-12-03 17:55:28 +01:00
Arkadiusz Holko a057dc750a Fix typo in README: s/exists/exits/ 2015-12-03 16:40:25 +01:00
persidskiy 39f7ea1475 Add rx_animating to UIActivityIndicatorView 2015-12-03 15:29:50 +03:00
Krunoslav Zaher 981a3b206a Fixes problems release version. 2015-12-02 13:15:23 +01:00
Krunoslav Zaher 41b6f297f3 More unit tests are passing for `rx_observe`. 2015-12-02 13:15:22 +01:00
Krunoslav Zaher 6f0a0db47b First two unit tests for observing method calls are passing. 2015-12-02 13:15:22 +01:00
Krunoslav Zaher 7beaa06df3 Started to work on unit testing of `sentMessage`. 2015-12-02 13:15:22 +01:00
Krunoslav Zaher d96173cdc9 Cleaning up for names for method observing. 2015-12-02 13:15:22 +01:00
Krunoslav Zaher 2d4c71727b Polish for swizzling code. 2015-12-02 13:15:22 +01:00
Krunoslav Zaher 75fa95d4dc Messing with swizzling. 2015-12-02 13:15:22 +01:00
Krunoslav Zaher de65c8ff2f Refactors current swizzling code to be more generic. 2015-12-02 13:15:22 +01:00
Krunoslav Zaher 63127838ec Makes `rx_modelSelected` more user friendly and removes MVVM from Wikipedia search example. 2015-11-28 11:59:49 +01:00
Krunoslav Zaher 9beeb2f213 Merge pull request #296 from tailec/develop
Update operators in Examples
2015-11-27 21:33:02 +01:00
tailec a81863e58c Update docs 2015-11-27 18:59:23 +00:00
Krunoslav Zaher 7993d23f67 Merge pull request #291 from tottakai/feature-timeout-operator-api-documentation
timeout operator to API documentation
2015-11-26 22:41:14 +01:00
Tomi Koskinen 3e230196cf timeout operator to API documentation 2015-11-26 20:35:51 +02:00
Krunoslav Zaher c7e73c1184 Moves `Timeout` include into correct group. 2015-11-26 11:34:15 +01:00
Krunoslav Zaher 4d775f8c06 Polishing of `Timeout`. 2015-11-26 11:23:17 +01:00
Krunoslav Zaher 1b819eda2e Merge pull request #284 from ReactiveX/tottakai-feature-timeout
Timeout operator by @tottakai
2015-11-26 10:18:59 +01:00
Junior B 0c03710733 Fix Timeout _id increment strategy and add missing unused warning 2015-11-25 10:00:37 +01:00
Junior B bb93a7660d Fix Timeout operator 2015-11-24 16:41:41 +01:00
Junior B 56ad54a21c Improve `Timeout` operator 2015-11-24 16:33:29 +01:00
Junior B d7fa4060f1 Merge branch 'feature-timeout' of https://github.com/tottakai/RxSwift into tottakai-feature-timeout 2015-11-24 16:29:31 +01:00
Krunoslav Zaher a2ec9ee118 Merge pull request #276 from fpillet/replaysubject-unlimited
Support creating unbounded ReplaySubject
2015-11-23 10:52:02 +01:00
Florent Pillet dc039c3587 cleanup comment 2015-11-22 17:22:14 +01:00
Florent Pillet b102fcb42d added tests for replayAll() 2015-11-22 17:17:36 +01:00
Florent Pillet 22542ccc35 ReplaySubject with unlimited capacity support:
- added ReplaySubject.createUnbounded() to create unlimited subjects
- added replayAll() method to ObservableType
2015-11-22 17:03:31 +01:00
Carlos García ce9ad98e3d change println to print 2015-11-22 06:34:57 +01:00
Krunoslav Zaher a342eebc93 Merge pull request #279 from RuiAAPeres/develop
No need for force unwrapping
2015-11-21 22:33:36 +01:00
Rui Peres 36ec974b9c Rogue extra space 2015-11-21 19:27:50 +00:00
Rui Peres 1f76dfcae4 No need for force unwrap 2015-11-21 19:26:50 +00:00
Florent Pillet e26eacdb48 allow 0 and Int.max to create an ReplaySubject with unlimited capacity 2015-11-20 18:37:30 +01:00
Krunoslav Zaher a49f5f8462 Merge pull request #264 from ashfurrow/attributed-text
Adds UILabel rx_attributedText.
2015-11-18 14:22:47 +01:00
Ash Furrow 731e69a680 Adds UILabel rx_attributedText. 2015-11-18 08:20:03 -05:00
Krunoslav Zaher 018523bf1e Improves explanation in playgrounds. 2015-11-18 10:53:59 +01:00
Tomi Koskinen 64353ed548 Timeout operator 2015-11-18 11:17:16 +02:00
Krunoslav Zaher a03ee86d38 Merge pull request #267 from mikelikespie/fix-with-latest-from
Making withLatestFrom subscribe to the right hand side first
2015-11-18 10:01:40 +01:00
Krunoslav Zaher aa73066e1e Merge pull request #266 from carlosypunto/more_playground_examples
2 more combineLatest examples and added .DS_Store to .gitignore
2015-11-18 09:59:44 +01:00
Krunoslav Zaher 5f5a65fe98 Improves testing code. 2015-11-18 09:52:33 +01:00
Krunoslav Zaher 66606a6c5b Merge pull request #262 from ashfurrow/ignore-elements
Adds ignoreElements() operator
2015-11-18 09:03:58 +01:00
Mike Lewis 7ade18ba75 Making withLatestFrom subscribe to the right hand side first
This resolves an issue where you have two observables that yield values
immediately and it wasn't yielding a result
2015-11-17 14:37:19 -08:00
Carlos García 1fd3034336 2 more combineLatest examples and added .DS_Store to .gitignore 2015-11-17 20:06:42 +01:00
Ash Furrow 34f9e092f9 Adds ignoreElements(). 2015-11-17 12:10:19 -05:00
Krunoslav Zaher c909f0f572 Add `NSURLSession` changes to `CHANGELOG.md`. 2015-11-16 10:24:37 +01:00
Krunoslav Zaher 16e2903560 Makes `zip` work on `ObservableType` instead of `ObservableConvertibleType`. 2015-11-16 10:12:14 +01:00
Krunoslav Zaher 4952fd72bf Polish for `CHANGELOG.md`. 2015-11-16 01:49:26 +01:00
Krunoslav Zaher a64594ad61 Release 2.0.0-beta.3 2015-11-16 01:27:06 +01:00
Krunoslav Zaher af4f556ac8 Updates documentation. 2015-11-16 00:37:18 +01:00
Krunoslav Zaher c515ba4b50 Adds `CurrentThreadScheduler` to blocking operators. 2015-11-16 00:11:30 +01:00
Krunoslav Zaher db478b1b9a Updates documentation. 2015-11-15 23:59:17 +01:00
Krunoslav Zaher 0a1a07384d Merge pull request #258 from ReactiveX/feature/kvo_revamp
KVO revamp.
2015-11-15 23:22:13 +01:00
Krunoslav Zaher 7d3387989d Adds `flatMapLatest` to `Driver` unit. 2015-11-15 23:21:39 +01:00
Krunoslav Zaher 65cc061b17 Changes `NopDisposable` to be struct. 2015-11-15 22:52:16 +01:00
Krunoslav Zaher beaa045340 Adds `FlatMapLatest`. 2015-11-15 22:51:43 +01:00
Krunoslav Zaher 99ae8dc30b Simplifies `Merge` operators. 2015-11-15 21:53:15 +01:00
Krunoslav Zaher 69d34d58c4 Improves data locality for `Map` and `Filter`. 2015-11-15 21:24:45 +01:00
Krunoslav Zaher b3a66aa45f `Merge` operator family polish. 2015-11-15 21:15:23 +01:00
Krunoslav Zaher 218b342a9a Makes disposal explicit in playgrounds so it doesn't confuses people. 2015-11-15 13:18:05 +01:00
Krunoslav Zaher 90dad761a2 Fixes warnings in example app. 2015-11-15 13:11:21 +01:00
Krunoslav Zaher ba5fcff91e Optimizations: `map.map.map ...` -> `map`. 2015-11-15 13:10:42 +01:00
Krunoslav Zaher b1185750f4 Adds scheduler overloads to `just`, `sequenceOf`. Deprecates `asObservable` in favor of `toObservable`. 2015-11-15 00:09:41 +01:00
Krunoslav Zaher a3a0dca28e Merge pull request #260 from a2/patch-2
Move parameter line to correct function
2015-11-14 21:41:28 +01:00
Krunoslav Zaher 7deb149916 Returns `NSRecursiveLocks`. It was interesting excursion ... 2015-11-14 21:39:50 +01:00
Krunoslav Zaher 5cc185743a Polish for animated table view updates. 2015-11-14 21:22:01 +01:00
Alexsander Akers a35b06b066 Move parameter line to correct function 2015-11-14 19:21:46 +00:00
Krunoslav Zaher a269a42a38 KVO revamp. 2015-11-14 15:34:08 +01:00
Krunoslav Zaher 80d6302fda Updates `CONTRIBUTING.md`. 2015-11-14 15:33:48 +01:00
Krunoslav Zaher 9808ae9ee7 Merge pull request #249 from tottakai/feature-single-blocked-predicate
Blocking single operator with predicate
2015-11-12 11:11:28 +01:00
Krunoslav Zaher fbba0966e5 Merge pull request #252 from dtartaglia/develop
Update UIImageView+Rx.swift
2015-11-12 11:10:55 +01:00
Tomi Koskinen 14affd773c exit loop and dispose subscription immediately 2015-11-12 08:26:40 +02:00
Tomi Koskinen 5499c10f9a remove duplicate blocking single code 2015-11-12 08:26:40 +02:00
Daniel Tartaglia e6f79b510f Update UIImageView+Rx.swift 2015-11-11 20:39:58 -05:00
Krunoslav Zaher 0774da2a99 Merge pull request #245 from ReactiveX/feature/singleAsync
Add `single` non-blocking operator
2015-11-11 11:40:37 +01:00
Krunoslav Zaher c2ca7e6b04 Adds early return. 2015-11-11 11:40:01 +01:00
Krunoslav Zaher df0ede1bf2 Removes debugging code. 2015-11-11 11:29:30 +01:00
Junior B 9663469b01 Add tests for `single` non-blocking operator 2015-11-11 11:13:12 +01:00
Junior B 7e92fb7248 Add `single` non-blocking operator 2015-11-11 11:13:12 +01:00
Krunoslav Zaher 45d1aa6047 Changes some texts. 2015-11-11 10:12:11 +01:00
Tomi Koskinen edeaf53b27 Blocking single operator with predicate 2015-11-10 22:25:09 +02:00
Krunoslav Zaher 6866b44e06 Merge pull request #246 from tottakai/feature-single-blocked
Blocking version of single operator
2015-11-10 21:13:23 +01:00
Krunoslav Zaher ce5b31b8a9 Renames `rx_tap` to `rx_primaryAction` on `UIButton` for `tvOS` and adds it to unit tests. 2015-11-09 23:06:37 +01:00
Krunoslav Zaher 93f9e2de54 Merge branch 'develop' of github.com:kzaher/RxSwift into develop 2015-11-09 22:47:12 +01:00
Krunoslav Zaher c5d22b7bc4 Merge pull request #243 from larslockefeer/master
Added tvOS specific extension for UIButton
2015-11-09 22:46:25 +01:00
Tomi Koskinen c79cea523f Blocking version of single operator 2015-11-09 21:42:46 +02:00
Krunoslav Zaher 15ad7ead1d Deprecates KVO wrappers that don't accept type as first operator and adds overloads that do. 2015-11-09 12:15:24 +01:00
Lars Lockefeer a9d445c2cd Added tvOS specific extension for UIButton
This extension registers for the `PrimaryActionTriggered` event, rather than the `TouchUpInside` event, to ensure `rx_tap` works as expected.
2015-11-09 08:24:11 +01:00
Krunoslav Zaher 046024d7fd Changes `CustomStringConvertible` to `CustomDebugStringConvertible`. 2015-11-09 01:05:51 +01:00
Krunoslav Zaher 9fa53a6bb3 Transforms `NSError`s across projects into Swift enums that inherit from `ErrorType`. 2015-11-09 00:44:59 +01:00
Krunoslav Zaher 2da94a2136 Performance optimizations for stateful components. 2015-11-08 22:34:16 +01:00
Krunoslav Zaher eebef9d125 Merge remote-tracking branch 'origin/develop' into develop 2015-11-08 17:57:44 +01:00
Krunoslav Zaher 4fae473c8d Merge pull request #238 from ReactiveX/feature/flat-map-first
flatMapFirst operator
2015-11-08 17:57:09 +01:00
Krunoslav Zaher ce983c44d0 Polishing and optimizing `retryWhen`. 2015-11-08 17:51:18 +01:00
yury ecf7d2ae71 Port other flatMap tests 2015-11-08 01:54:17 +03:00
yury 4c83408a46 FlatMapFirst with two tests 2015-11-08 01:04:09 +03:00
Krunoslav Zaher 7933565b0c Merge pull request #237 from zhigang1992/feature/removeUnneededDisposeBag
Remove Unneeded dispose bag
2015-11-07 20:24:48 +01:00
Kyle Fang 3052e9415c Remove Unneeded dispose bag 2015-11-07 13:00:16 -06:00
Krunoslav Zaher 56a094fa69 Merge branch 'develop' into feature/retryWhen 2015-11-07 13:36:41 +01:00
Krunoslav Zaher 99669e789b Merge pull request #225 from ReactiveX/feature/window
Adds `window` operator
2015-11-07 13:25:25 +01:00
Krunoslav Zaher a99409d6e4 Unification with optimization refactorings. 2015-11-07 12:56:01 +01:00
Junior B 7fe9a87cb5 Add `window` operator, time/count version 2015-11-06 11:07:33 +01:00
Junior B e7723a2173 Adds `RefCountDisposable` and `BooleanDisposable` and necessary tests 2015-11-06 11:07:33 +01:00
Krunoslav Zaher 33eea0be20 Merge pull request #233 from nanoxd/update-readme-carthage
Update README carthage
2015-11-05 21:30:18 +01:00
Fernando Paredes f20618ed75 Update README to use standard Carthage syntax 2015-11-05 09:57:57 -08:00
Krunoslav Zaher d4cda2430e Blocking operators run runloop while blocking. 2015-11-05 12:34:20 +01:00
Junior B a78158c43f Merge branch 'develop' of github.com:ReactiveX/RxSwift into feature/retryWhen 2015-11-02 13:33:26 +01:00
Krunoslav Zaher e39f5dbce1 Shares tvOS schemes. 2015-11-02 11:14:42 +01:00
Krunoslav Zaher 0b8bf6ca5a Improves validate Podspecs scheme. 2015-11-02 11:13:09 +01:00
Krunoslav Zaher 31095a8cb0 Release 2.0.0-beta.2 2015-11-02 11:12:20 +01:00
Krunoslav Zaher cab8c40ae1 Simplifies `ReachabilityService`. 2015-11-02 10:46:12 +01:00
Krunoslav Zaher 5293690a61 Updates bundle version to 2.0.0. 2015-11-02 10:36:14 +01:00
Krunoslav Zaher e52b2c9449 Changes `AnonymousObservable` access modifier to `private`. 2015-11-02 10:31:38 +01:00
Krunoslav Zaher a1cd43dfe8 Updates documentation. 2015-11-02 10:17:39 +01:00
Krunoslav Zaher 28efa9d827 Merge pull request #213 from ReactiveX/feature/performance-optimizations
Innovating to zero
2015-11-02 01:03:20 +01:00
Krunoslav Zaher ceb14acadb Makes `observer` in `Sink` private again. 2015-11-02 00:41:01 +01:00
Krunoslav Zaher 59f3b487d2 Removes locks from sink forwarding (25% improvement). 2015-11-02 00:17:11 +01:00
Krunoslav Zaher cd9f7654d5 Sink modifications. 2015-11-01 22:12:52 +01:00
Krunoslav Zaher dcfe2c5f0c Optimizations for `observeOn`. 2015-11-01 21:58:57 +01:00
Krunoslav Zaher 71ee2eeb34 Extends `ObservableType` instead of `ObservableConvertibleType`. 2015-11-01 21:42:25 +01:00
Krunoslav Zaher 99a75f586e Remove `AsObservable` implementation. 2015-11-01 20:56:34 +01:00
Krunoslav Zaher d4cd9cf69b Refactors `ReplaySubject` and `BehaviorSubject` to be consistent with `ReplaySubject`. 2015-11-01 20:44:09 +01:00
Krunoslav Zaher d0824eca4f Removes optimizations on `PerformanceTests` because it generates wrong assembly, kudos Swift compiler team. 2015-11-01 20:44:09 +01:00
Krunoslav Zaher 13a87af009 Moves disposables combo in `Producer.subscribe` to `Sink`. `SynchronizedOnType` overhauls. 2015-11-01 20:44:09 +01:00
Krunoslav Zaher 22de82ba2b Removes disposable from `Sink`. 2015-11-01 20:40:08 +01:00
Krunoslav Zaher 28c97d9413 Enables testability. 2015-11-01 20:40:08 +01:00
Krunoslav Zaher aada661889 Low hanging fruit optimizations for `just`, `failWith`, `never`, `empty`, `flatMap`. 2015-11-01 20:40:08 +01:00
Krunoslav Zaher a4fa3a74bb Improves naming in `Bag.swift`. 2015-11-01 20:40:08 +01:00
Krunoslav Zaher f86a5923d5 Optimizes `Bag`. 2015-11-01 20:40:08 +01:00
Krunoslav Zaher 6fdb23e222 Replaces `Array` with `ContiguousArray` for `Queue` buffer data structure. 2015-11-01 20:40:08 +01:00
Krunoslav Zaher dcc65e8fe0 Adds synchronization protocols to reduce allocations. 2015-11-01 20:40:08 +01:00
Krunoslav Zaher 2e8dbb7af9 Turns on `-OWhole-module-optimization` for `Release` configuration. 2015-11-01 20:40:08 +01:00
Krunoslav Zaher 26a34c4ac3 Makes `Producer` internal. 2015-11-01 20:40:07 +01:00
Krunoslav Zaher bd3c5a77b9 Removes hidden lamba allocations from disposables. 2015-11-01 20:40:07 +01:00
Krunoslav Zaher 0f50808bc6 Adds `withLatestFrom` to `Driver`. 2015-11-01 20:35:38 +01:00
Krunoslav Zaher b12e97abda Adds `Driver` to `RxExample` app. 2015-11-01 20:17:48 +01:00
Krunoslav Zaher 1dbe06a082 Improves example app. 2015-11-01 20:12:41 +01:00
Krunoslav Zaher d7414d575b Polishing of public interface. 2015-11-01 17:15:54 +01:00
Krunoslav Zaher f504f0b9b4 Merge pull request #207 from vodovozovge/handlingNetworkErrorsWithReachabilityAPIInRxExample
Handling network errors with reachability api in rx example
2015-11-01 16:43:26 +01:00
Vodovozov Gleb 9a08915ff1 ensure that self is not nil in rxex_downloadableImageAnimated 2015-11-01 12:58:46 +08:00
Vodovozov Gleb 72b0904fea simplified text in OfflinePlaceholder 2015-11-01 11:31:22 +08:00
Vodovozov Gleb 5c148de3e2 moved out extension of UIImageView to separate file to have OS X support for DownloadableImage. Also changed UIImage to Image typealias 2015-11-01 11:28:09 +08:00
Vodovozov Gleb 85197b9a7c Use DownloadableImage in WikipediaImageServiceExample to handle network errors and bind result to collection view cells. 2015-11-01 10:31:25 +08:00
Vodovozov Gleb 942b617c10 introducing DownloadableImage – enum with 2 possible values – Content(image:UIImage) and OfflinePlaceholder. Use it in ImageService to implement retries on network failures. Also added rxex_downloadableImage extension for UIImageView which shows either content or placeholder image. 2015-11-01 10:30:55 +08:00
Vodovozov Gleb a7ea80a632 use reachability service to handle network errors in Wikipedia image search example: for cells with image. If connection is lost image with label Loading is displayed until connection is reestablished. Image is exported from paintcode 2015-10-31 14:57:52 +08:00
Vodovozov Gleb d070c08762 use reachability service to handle network errors in Wikipedia image search example: handle main search and loading titles 2015-10-31 14:57:51 +08:00
Vodovozov Gleb 5dfd604f29 use new reachability service to handle network errors in AutoLoading example 2015-10-31 14:57:51 +08:00
Vodovozov Gleb a35c77c0e0 Reachability+Rx now is ReachabilityService 2015-10-31 14:57:51 +08:00
Vodovozov Gleb ea628496f1 when receiving error from GitHubSearchRepositoriesAPI wait while network is reachable again and retry query 2015-10-31 14:57:51 +08:00
Vodovozov Gleb e8cb6721b7 added Reachability+Rx - contains reactive wrapper 2015-10-31 14:57:51 +08:00
Vodovozov Gleb 64788e9e3c added reachabilty.swift https://github.com/ashleymills/Reachability.swift 2015-10-31 14:57:51 +08:00
Krunoslav Zaher 451c2be94e Adds additional `UITableView` and `UICollectionView` unit tests. 2015-10-30 23:58:18 +01:00
Krunoslav Zaher 791be0c6dc Merge pull request #227 from petester42/fix-target-versions
Update os x framework target version
2015-10-30 21:14:04 +01:00
Pierre-Marc Airoldi e99e6a6114 update os x framework target version 2015-10-30 13:13:21 -04:00
Junior B 567fa9d508 Merge branch 'develop' of github.com:ReactiveX/RxSwift into feature/retryWhen 2015-10-30 16:17:43 +01:00
Junior B 662d4dc549 Port of retryWhen tests from RxJS 2015-10-30 16:17:10 +01:00
Krunoslav Zaher e00ef9a429 Merge pull request #223 from Tableau-David-Potter/feature/fix-build-warnings
Fix warnings due to use in app extensions and to Xcode updates.
2015-10-30 10:57:16 +01:00
David Potter a701d79a0f Fix warnings due to use in app extensions and to Xcode updates.
Xcode gives two warnings when including the Rx project and building in an app.

1. The first is due to use in a component that will be used in an extension.  Xcode displays the message “linking against dylib not safe for use in application extensions”.  To configure an app extension target to use an embedded framework, set the target’s “Require Only App-Extension-Safe API” build setting to Yes.

https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html

2. The second is due to changes in Xcode that want to update the project file to comply with the latest guidelines.  Clicking the warning brings up a prompt to modify the project.
2015-10-29 15:16:56 -07:00
Krunoslav Zaher 2d50790e66 Merge pull request #220 from ReactiveX/feature/test-playgrounds
Run playgrounds in pre-release-tests.sh
2015-10-29 20:37:04 +01:00
Krunoslav Zaher 5b380a386d Fixes casing in documentation for `elementAt`. 2015-10-29 20:35:27 +01:00
Krunoslav Zaher 3009757ac5 Merge pull request #221 from tottakai/feature/api-documentation
improve api documentation
2015-10-29 20:34:22 +01:00
yury 0995a7e979 Remove warnings in playground 2015-10-29 14:27:31 +03:00
yury cfa3ff051c Revert "Build should failed"
This reverts commit fc9c564587.
2015-10-29 14:16:59 +03:00
yury fc9c564587 Build should failed 2015-10-29 13:45:19 +03:00
yury af31d2155f Run playgrounds in pre-release-tests.sh 2015-10-29 01:58:11 +03:00
Tomi Koskinen 3be67a317d improve api documentation 2015-10-28 07:14:46 +02:00
Krunoslav Zaher 51d138a177 Increases capacity to correct value on `TakeLast`. 2015-10-27 22:14:37 +01:00
Krunoslav Zaher 6d0ca982d0 Merge pull request #214 from tottakai/feature-takelast-operator
TakeLast operator
2015-10-27 22:13:34 +01:00
Krunoslav Zaher a68b3f2c9f Merge pull request #218 from sergeytimoshin/patch-2
Typo fix
2015-10-27 22:08:50 +01:00
Sergey Timoshin 5adacc4092 Typo fix 2015-10-28 00:02:13 +03:00
Tomi Koskinen a639b46231 TakeCount count boundary check 2015-10-27 21:41:06 +02:00
Tomi Koskinen 3e7345df04 TakeLast review fixes 2015-10-27 21:40:26 +02:00
Tomi Koskinen cc8e57a896 TakeLast operator 2015-10-26 18:55:50 +02:00
Krunoslav Zaher f617132c37 Merge pull request #212 from sendyhalim/develop
Change diposeBag to disposeBag
2015-10-25 13:45:45 +01:00
Sendy Halim d7f3fa774b Change diposeBag to disposeBag 2015-10-25 19:23:35 +07:00
Junior B 4e5f86f00c Merge branch 'develop' of github.com:ReactiveX/RxSwift into feature/retryWhen
Conflicts:
	Rx.xcodeproj/project.pbxproj
2015-10-25 09:42:55 +01:00
Krunoslav Zaher d1666db4d1 Removes unnecessary `subscribeSafe` in case there is already an `Observable` source. 2015-10-25 00:59:50 +02:00
Krunoslav Zaher a861028d4f Fixes performance tester. 2015-10-25 00:27:39 +02:00
Krunoslav Zaher e4d3c36d97 Adds `_` to private variables for `toArray` and `elementAt`. 2015-10-25 00:26:53 +02:00
Krunoslav Zaher 4042dd2c6e Merge pull request #205 from ReactiveX/feature/elementAt
Adds `elementAt` operator
2015-10-25 00:20:15 +02:00
Krunoslav Zaher a81b9afecf Moves index check closer to source of error. 2015-10-25 00:19:46 +02:00
Junior B 61e8e33cd7 Improves `elementAt` to be platform consistent 2015-10-25 00:16:21 +02:00
Junior B 97e807080d Adds `elementAt` operator 2015-10-25 00:16:21 +02:00
Krunoslav Zaher f0b5246b32 Merge pull request #179 from yury/private-underscored
prefix with _ private properties
2015-10-25 00:15:32 +02:00
Krunoslav Zaher f0e3d548b8 Merge pull request #202 from ReactiveX/feature/toArray
Adds `toArray` operator
2015-10-23 20:56:49 +02:00
Junior B 2936820088 Merge branch 'develop' of github.com:ReactiveX/RxSwift into feature/toArray
Conflicts:
	RxExample/RxExample.xcodeproj/project.pbxproj
2015-10-23 09:47:01 +02:00
Junior B 3693c7d9ff Adds `toArray` operator 2015-10-22 09:35:44 +02:00
Krunoslav Zaher f168583416 Merge pull request #200 from yury/with-latest-from
Add WithLatestFrom operator
2015-10-21 10:25:15 +02:00
yury 22b1204c28 Tune docs 2015-10-21 11:22:19 +03:00
yury 3d72cb2a7c Merge Sink classes 2015-10-21 11:12:16 +03:00
yury b95ebfb364 Lock whole on method 2015-10-21 10:57:44 +03:00
yury f4f94faf47 Better formatting 2015-10-21 10:46:39 +03:00
yury ce3e9bee90 Add private vars prefixes to ConnectableObservable 2015-10-20 22:29:12 +03:00
yury f616a15ee6 Work on subjects 2015-10-20 22:11:03 +03:00
yury a542296129 Merge branch 'develop' into private-underscored 2015-10-20 21:51:36 +03:00
Krunoslav Zaher 7acb77a41d Updates tvOS support details. 2015-10-20 12:33:41 +02:00
yury e453820c08 Add WithLatestFrom operator 2015-10-20 12:43:35 +03:00
Krunoslav Zaher 642b84e946 Release 2.0.0-beta.1 2015-10-20 11:16:31 +02:00
Krunoslav Zaher e13747fab8 Updates `Readme.md`. 2015-10-20 09:54:55 +02:00
Krunoslav Zaher 9fb8e3f4ef Adds changelog for 2.0.0-beta.1 release. 2015-10-19 22:00:57 +02:00
Krunoslav Zaher 24062521b5 Adds unused warnings. 2015-10-19 21:59:31 +02:00
Krunoslav Zaher 685cae7405 Adds `Warnings.md`. 2015-10-19 21:23:34 +02:00
Krunoslav Zaher 93e2a927c1 Adds `BlockingObservable`. 2015-10-19 20:28:49 +02:00
Krunoslav Zaher c50f5043d5 Fixes `tvOS` detection. 2015-10-19 20:08:27 +02:00
Krunoslav Zaher fcd63dafb8 Moves `subscribeOn` out of `Driver` unit. 2015-10-19 19:59:27 +02:00
yury 5818c40bc8 Remove self.` 2015-10-19 20:45:20 +03:00
Junior B 93e3f5facb - Add retryWhen operator
- Add tests for retryWhen operator
2015-10-19 15:42:26 +02:00
Krunoslav Zaher 9a182a8f50 Removes shared `tvOS` schemes temporarily. 2015-10-19 03:43:16 +02:00
Krunoslav Zaher 060a57d6c4 Changes `subscribeOn` scheduler to `ConcurrentMainScheduler`. 2015-10-19 03:11:12 +02:00
Krunoslav Zaher c03d45e48d Updates scheduler type in documentation. 2015-10-19 03:10:09 +02:00
Krunoslav Zaher f45f2fd073 Cleanup in `TailRecursiveSink`. 2015-10-19 03:09:14 +02:00
Krunoslav Zaher 63a60b359b Adds `ConcurrentMainScheduler` and `ImmediateScheduler`. 2015-10-19 02:31:16 +02:00
Krunoslav Zaher a0acc29bd3 Fixes unit tests for `tvOS`. 2015-10-19 01:15:33 +02:00
Krunoslav Zaher e3efcbb8f5 Reduces code duplication for `UITableView` and `UICollectionView`. 2015-10-19 01:15:09 +02:00
Krunoslav Zaher 0d33a77941 Adds double binding example. 2015-10-19 00:55:41 +02:00
Krunoslav Zaher e22cf3dfb8 Adds RxCocoa unit tests. 2015-10-19 00:55:41 +02:00
Krunoslav Zaher 29b73836b9 Merge pull request #197 from gregpardo/develop
Adds rx_ extensions for UICollectionView focus for tvOS
2015-10-19 00:38:44 +02:00
Greg Pardo 0534aa983a #193 Only implement essential functions as per kzaher's suggestions 2015-10-18 10:23:53 -07:00
yury f725f1c489 Work on schedulers 2015-10-18 20:18:22 +03:00
yury 0c33e4291e More work on private vars 2015-10-18 19:51:36 +03:00
Krunoslav Zaher 8251954b7b Changes `Driver` extensions to `DriverConvertibleType` extensions. 2015-10-18 18:20:21 +02:00
yury 51696e3a1b Add MARKs 2015-10-18 19:04:11 +03:00
yury 89e31dc658 Merge branch 'develop' into private-underscored 2015-10-18 18:37:22 +03:00
Krunoslav Zaher 1758f9d63a Adds `ActivityIndicator` to `RxExample`. 2015-10-18 17:27:09 +02:00
Krunoslav Zaher a991cad152 Adds `ActivityIndicator`. 2015-10-18 17:19:50 +02:00
Krunoslav Zaher d22a8fdada Merge pull request #198 from yury/using
Using operator
2015-10-18 16:14:48 +02:00
yury f68ab74269 Remove Using_Null test 2015-10-18 17:07:49 +03:00
yury 1adceaf8b8 Add MockDisposable to all test targets 2015-10-18 16:44:55 +03:00
yury 8b6321e07a Add Using to RxExample-iOS-no-module target 2015-10-18 16:43:53 +03:00
yury 8116879d0b Add docs 2015-10-18 16:33:07 +03:00
Krunoslav Zaher 3269f482c9 Adds `concat` overload. 2015-10-18 15:24:53 +02:00
Krunoslav Zaher c66723de70 Updates Error documentation. 2015-10-18 15:05:44 +02:00
yury d959be6345 Fix Using operator tests 2015-10-18 15:57:05 +03:00
Krunoslav Zaher bd7d28855b Removes version from `Queue`. 2015-10-18 14:53:49 +02:00
yury aa730e665e Add Using operator tests 2015-10-18 14:44:34 +03:00
Krunoslav Zaher fcd626f00d Scheduler interface lipstick. 2015-10-17 20:47:03 +02:00
yury c9ea983f3a Add Using operator to no-module example 2015-10-17 21:04:38 +03:00
yury a0f83ec4f2 Work on data structures 2015-10-17 20:28:28 +03:00
yury 9a0ea5462a Merge branch 'develop' into using 2015-10-17 19:06:08 +03:00
yury c2f91660f9 More private vars 2015-10-17 19:05:49 +03:00
yury 01304bcff7 More work on private vars 2015-10-17 18:19:47 +03:00
yury ec7ef864c7 Merge branch 'develop' into private-underscored 2015-10-17 17:57:18 +03:00
Krunoslav Zaher 6dc7f2e4a6 Rename `ObserverOf` to `AnyObserver`. 2015-10-17 12:15:37 +02:00
yury 16e851fe40 More private vars 2015-10-17 12:38:45 +03:00
yury 6b0510ff77 Merge branch 'develop' into private-underscored 2015-10-17 12:01:57 +03:00
yury 8f64ef6001 More work on private state 2015-10-17 11:47:20 +03:00
yury 0df86d5041 Merge branch 'develop' into private-underscored 2015-10-17 10:58:54 +03:00
yury 04c08880ce Using operator initial port 2015-10-17 10:58:20 +03:00
Krunoslav Zaher de801df8b8 Merge pull request #146 from ReactiveX/feature/rxunits-ideas
Feature/rxunits ideas
2015-10-16 21:23:14 +02:00
Greg Pardo 0fce5c89d4 #193 Implement suggestions to add some helper rx models 2015-10-16 15:20:13 -04:00
Krunoslav Zaher 4872a62f21 Fixes error wording. 2015-10-16 21:19:53 +02:00
Krunoslav Zaher f9b19afd10 Adds unit tests for `Driver` unit. 2015-10-15 23:30:48 +02:00
Krunoslav Zaher eba73eec26 Adds `Zip` and `CombineLatest` to `Driver` unit. 2015-10-15 23:30:48 +02:00
Krunoslav Zaher 85cc137d32 Moves redundant brackets from `subscribe`. 2015-10-15 23:30:48 +02:00
Krunoslav Zaher 89d9094521 Moves `subscribeOn` from `Driver` to `ControlProperty`. 2015-10-15 23:30:47 +02:00
Krunoslav Zaher 97f805ce4f Adds excluded files. 2015-10-15 23:30:47 +02:00
Krunoslav Zaher af463f1587 Adds Observable+Extensions tests. 2015-10-15 23:30:47 +02:00
Krunoslav Zaher 9a3ae4625c Performance optimizations, makes `Observable` init internal. 2015-10-15 23:30:47 +02:00
Krunoslav Zaher 2958e0a796 Prototype of units. 2015-10-15 23:30:47 +02:00
Greg Pardo a5f0b4fcaf References #193 Allows for nil on focus (Focus can be elsewhere) 2015-10-15 10:36:35 -04:00
Greg Pardo 327f5ef945 Merge branch 'master' into develop 2015-10-15 10:25:50 -04:00
Orta 15de03e119 Merge pull request #196 from apiyron/patch-1
println -> print
2015-10-15 12:00:10 +01:00
Andrey 59c828e160 println -> print
Swift 2 update
2015-10-15 13:01:00 +03:00
Krunoslav Zaher cc940ddd6f Merge pull request #194 from yury/increment-checked
Check for overflow on operators with index
2015-10-15 11:50:30 +02:00
yury 36dad62830 Check for overflow on operators with index 2015-10-15 12:27:03 +03:00
Greg Pardo cc62e2d7ee References #193 about adding tvOS focused rx_ helpers to UICollectionView 2015-10-14 18:40:51 -07:00
Krunoslav Zaher 1ced5aebf5 Merge pull request #190 from yury/take-while-throws
TakeWhile predicates can throw
2015-10-13 14:00:37 +02:00
Krunoslav Zaher ae278b09e5 Merge pull request #191 from yury/sink-private-vars
Make private state of Sink private
2015-10-13 13:57:56 +02:00
yury 2e556c209e Make private state of Sink private 2015-10-13 12:29:49 +03:00
yury c8fec7d958 Test throw in TakeWhile 2015-10-13 11:50:32 +03:00
yury 3cb53617a0 Use observer getter instead of _observer 2015-10-13 11:34:26 +03:00
Krunoslav Zaher ce5fe8d750 Merge pull request #189 from yury/skip-while
Add SkipWhile operator
2015-10-13 10:10:40 +02:00
yury 0ad230f39b TakeWhile predicates can throw 2015-10-13 11:03:19 +03:00
yury 8f7f6ccefd Add docs for skipWhile 2015-10-12 23:24:03 +03:00
yury c52c4f3cd7 Remove test code 2015-10-12 14:38:28 +03:00
yury fd6050ae2b Rename skipWhileIndexed to skipWhileWithIndex 2015-10-12 14:36:19 +03:00
yury cbdf027d3d Add SkipWhile operator 2015-10-12 11:59:20 +03:00
Krunoslav Zaher b4d4e4b4d6 Moves retry logic in Github example to right place. 2015-10-10 17:28:59 +02:00
Krunoslav Zaher 49b0f0d7f0 Merge pull request #185 from yoshinorisano/fix-outdated-comments
Fix outdated comments on UISearchBar's rx_searchText property.
2015-10-09 12:57:21 +02:00
Yoshinori Sano 978b4eb629 Fix outdated comments on UISearchBar's rx_searchText property. 2015-10-09 09:15:59 +09:00
Krunoslav Zaher a877416c56 Merge pull request #183 from yury/skip-until
SkipUntil
2015-10-08 18:44:43 +02:00
yury 403389beec Add SkipUntil to RxExample-iOS-no-module 2015-10-08 19:07:12 +03:00
Krunoslav Zaher c64d392ba6 Removes unnecessary lock from Skip time version. 2015-10-08 16:36:51 +02:00
Krunoslav Zaher 99ddac7848 Moves validation colors in it's own struct. 2015-10-08 16:31:28 +02:00
Krunoslav Zaher d31a4b3a7f Merge pull request #184 from samgreen/cleanedup_github_signup_example
Cleanedup GitHub signup example
2015-10-08 16:27:44 +02:00
yury c5b6868072 Improve locking 2015-10-08 17:06:00 +03:00
yury 6d12d3786e Use _forwardElements boolean flag instead of optional observer 2015-10-08 16:51:23 +03:00
yury f065189ba9 Remove SkipUntilTime 2015-10-08 16:32:44 +03:00
samgreen fe8e6d7965 Add self to access colors from closure. 2015-10-08 09:22:37 -04:00
samgreen 9c3a6d5061 Clearer comment about dispose bags. 2015-10-08 09:19:05 -04:00
yury c524c8a6ce Include SkipUntil.swift in RxSwift-watchOS target 2015-10-08 16:07:46 +03:00
yury 5bbd23e64f Add SkipUntil ohter and SkipUnit time rx operators 2015-10-08 15:32:26 +03:00
samgreen a8cd83e956 Fixed a typo, used the type alias everywhere, and reorganized a few minor things for readability. 2015-10-07 08:17:47 -07:00
Krunoslav Zaher 893d964864 Includes Rx.xcodeproj in Example app to enable pod try. 2015-10-04 22:28:09 +02:00
Krunoslav Zaher 55ed31acbc Adds instructions how to use tvOS from Cocoapods. 2015-10-04 13:03:57 +02:00
Krunoslav Zaher 4d980e6846 Fixes cleanup code. 2015-10-04 12:33:05 +02:00
Krunoslav Zaher 3fe6163451 Adds tvos support to Cocoapods. 2015-10-04 12:22:30 +02:00
Krunoslav Zaher 30ae9a2dd1 Adds podspec validation. 2015-10-03 22:59:19 +02:00
Krunoslav Zaher ab2eb821f7 Replaces linking with libraries with target dependencies. 2015-10-03 20:24:25 +02:00
Krunoslav Zaher 260884e4f4 Enables testing on real device. 2015-10-03 19:33:28 +02:00
Krunoslav Zaher 01faed3c89 Lipstick for Github repository search example. 2015-10-03 19:00:30 +02:00
Krunoslav Zaher 1a798ddb31 Fixes automation tests, unit tests warnings and example app warnings. 2015-10-03 15:55:57 +02:00
yury ef54330643 private var in DoSink 2015-10-03 16:32:56 +03:00
yury 96d7035086 prefix private vars in Observables implementations 2015-10-03 16:05:18 +03:00
yury eaddcb2902 prefix private vars in Disposables 2015-10-03 15:18:12 +03:00
yury 4110362376 Private _lock at ReplaySubscription and RecursiveScheduler 2015-10-03 15:06:43 +03:00
yury c7c93b7ec4 prefix with _ private properties 2015-10-03 13:41:17 +03:00
Krunoslav Zaher cf90d2f486 Release 2.0.0-alpha.4 2015-10-02 23:35:28 +02:00
Krunoslav Zaher 8b2138d1a3 Adds alpha.4 changes. 2015-10-02 23:32:39 +02:00
Krunoslav Zaher e2aa73e4b3 Fixes xcode warnings. 2015-10-02 21:21:44 +02:00
Krunoslav Zaher 480c6313b3 Merge pull request #178 from yury/warn-unused-result
Add @warn_unused_result attribute to subscribe* -> Disposable methods
2015-10-02 21:15:39 +02:00
yury 1b5f7f41d9 Add @warn_unused_result attribute to subscribe* -> Disposable methods 2015-10-02 18:20:01 +03:00
Krunoslav Zaher 5cbd72c0e4 Fixes targeted device family. 2015-10-02 11:33:05 +02:00
Krunoslav Zaher fcdcd0d510 Fixes bitcode. 2015-10-01 22:13:05 +02:00
Krunoslav Zaher ebdb5bca9e Removes deadfiles and enables bitcode. 2015-10-01 22:01:04 +02:00
Krunoslav Zaher 06b2424eb3 Removes codesigning for watch os. 2015-10-01 21:38:08 +02:00
Krunoslav Zaher 554618c9f8 Updates build scripts. 2015-10-01 21:02:15 +02:00
Krunoslav Zaher 766d6a7aad Removes unused variable. 2015-10-01 21:02:15 +02:00
Krunoslav Zaher a206e3d3a5 Renames product name. 2015-10-01 21:02:15 +02:00
Junior B 83c3f51461 Update test scripts for WatchOS
Add WatchOS 2 target in Podspecs
2015-10-01 21:02:15 +02:00
Krunoslav Zaher 7d1e73beca Merge pull request #176 from yoshinorisano/bugfix-auto-loading-example
Fix minor bugs of auto loading example
2015-10-01 12:08:37 +02:00
Yoshinori Sano 1d450107dd Fix error message. 2015-10-01 18:49:47 +09:00
Yoshinori Sano 13c64db9e7 Delegation does not work because `rx_setDelegate` is not called. 2015-10-01 18:35:43 +09:00
Yoshinori Sano 7e2bc5dd43 Clear search result when searh keyword is cleared. 2015-10-01 18:30:10 +09:00
Krunoslav Zaher 059e3ca3ab Adds watchOS targets and at least tests building targets. 2015-09-30 14:02:41 +02:00
Krunoslav Zaher f7725f4dfc Example lipstick. 2015-09-30 13:04:08 +02:00
Krunoslav Zaher 8253b79ac6 Adds GitHub paging logic to RxExample project. 2015-09-30 12:57:00 +02:00
Krunoslav Zaher a5bf7d5df3 Merge pull request #173 from yoshinorisano/auto-loading-example
[WIP] Implement auto loading example.
2015-09-29 20:23:21 +02:00
Yoshinori Sano 3d72fc1495 Fix typo. 2015-09-29 20:30:35 +09:00
Yoshinori Sano c40bbc5c85 Add incremental search. 2015-09-29 19:55:34 +09:00
Yoshinori Sano fdd53489e2 Add search bar. 2015-09-29 19:51:17 +09:00
Krunoslav Zaher e6d27bca88 Merge pull request #172 from yury/tvOS-targets
tvOS targets
2015-09-29 10:58:47 +02:00
Yoshinori Sano 447a06d963 Fix trivial typo. 2015-09-29 14:13:42 +09:00
Yoshinori Sano 30dc3b84af Add base implementation of auto loading example. 2015-09-29 13:31:48 +09:00
yury ec4dd7ef5e Merge branch 'develop' into tvOS-targets 2015-09-28 23:04:32 +03:00
yury 4823443a9b Add tvOS targets 2015-09-28 23:03:59 +03:00
Krunoslav Zaher 82b004e82a Replaces value of iterations with alias. 2015-09-28 21:37:25 +02:00
Krunoslav Zaher 85bed326b8 Fixes warning in Performance tools. 2015-09-28 21:09:17 +02:00
Krunoslav Zaher b39c431f93 Removes duplicate references for performance tests. 2015-09-28 21:02:55 +02:00
Krunoslav Zaher 59a1bdba08 Additional explanations for `retry`. 2015-09-28 20:46:02 +02:00
Krunoslav Zaher 0fc4c5d1c3 Merge pull request #171 from tottakai/feature_buffer_api_documentation
add buffer operator to supported operators list
2015-09-28 17:13:07 +02:00
Tomi Koskinen 8f55226527 add buffer operator to supported operators list 2015-09-28 17:59:53 +03:00
Krunoslav Zaher 745d004701 Fixes confusing naming for `retry` operator. 2015-09-28 13:15:12 +02:00
Krunoslav Zaher 47dc91808e Transforms performance test to Cocoa app. 2015-09-28 12:46:39 +02:00
Krunoslav Zaher bb321cf268 Merge pull request #165 from yoshinorisano/refactor-combine-latest-sink
Refactor CombineLatestSink.
2015-09-27 21:50:31 +02:00
yoshinori_sano 62422afcc6 Optimize CombineLatestSink. 2015-09-27 10:47:38 +09:00
Krunoslav Zaher cee58007b1 Adding benchmarking infrastructure. 2015-09-27 02:28:14 +02:00
Krunoslav Zaher 2c5cc42d94 Merge pull request #166 from yury/option-set
Use array literal for option sets
2015-09-26 19:16:51 +02:00
yury 9917402001 Use array literal for option sets 2015-09-26 18:38:41 +03:00
yoshinori_sano 61420297f1 Refactor CombineLatestSink. 2015-09-26 13:06:09 +09:00
Krunoslav Zaher 8740e4b853 Fixes unit test warnings. 2015-09-26 02:03:00 +02:00
Krunoslav Zaher 46fdd3e9fc Removes embedding of Swift framework. 2015-09-26 00:50:43 +02:00
Krunoslav Zaher 219f28e69e Merge pull request #164 from tokorom/add-uistepper
Add UIStepper+Rx
2015-09-26 00:27:55 +02:00
tokorom ab954ddd51 Add UIStepper+Rx 2015-09-25 13:05:51 +09:00
Krunoslav Zaher e4bb5bf61d Merge pull request #159 from czeluff/master
Wrong level used in image cache.
2015-09-23 21:31:20 +02:00
Krunoslav Zaher 6bcab4269c Improves current thread scheduler and solves variable confusing behavior on dealloc. 2015-09-23 20:17:11 +02:00
Krunoslav Zaher 54ed3af9cb Merge pull request #157 from yoshinorisano/use-guard
Use guard for simplification.
2015-09-23 20:04:27 +02:00
Krunoslav Zaher 48390f7d69 Merge pull request #156 from yoshinorisano/fix-playground-doc
Fix trivial typo in playground doc.
2015-09-23 20:04:06 +02:00
Krunoslav Zaher 907322ba6b Merge pull request #154 from orta/tvos
[WIP] adds support for tvOS in RxCocoa
2015-09-22 22:44:20 +02:00
yoshinori_sano 8b4de57097 Use guard for simplification. 2015-09-22 19:35:27 +09:00
Orta Therox ebd89c3883 [tvOS] adds support for tvOS in RxCocoa 2015-09-22 10:43:35 +01:00
yoshinori_sano 465f9c7ef8 Fix trivial typo. 2015-09-22 18:18:03 +09:00
Krunoslav Zaher c02f881734 Merge pull request #148 from zhigang1992/addDataToErrorResponse
Add data to error response
2015-09-21 12:27:43 +02:00
Kyle Fang 8d88a662a9 Add data to error response 2015-09-21 08:30:06 +08:00
Krunoslav Zaher 814e4b543f Small cleanups. 2015-09-17 11:57:22 +02:00
Krunoslav Zaher 2a66efca24 Merge pull request #142 from yury/no-fallthrough
Use multiple case syntax instead of fallthrough.
2015-09-17 11:56:52 +02:00
yury c3e8d18896 Use multiple case syntax instead of fallthrough. 2015-09-17 12:39:38 +03:00
Krunoslav Zaher cbdd7d7369 Merge pull request #140 from kousun12/on_event_convienence_methods
On event convienence methods
2015-09-16 21:56:43 +02:00
Rob Cheung c935e4218d test convenience methods 2015-09-15 11:07:30 -07:00
Rob Cheung 816c287bca add convienience methods for onError, onNext, onComplete 2015-09-15 10:27:14 -07:00
Krunoslav Zaher 98de89c3e5 Merge pull request #138 from dtartaglia/develop
Add rx_enabled to UIBarButtonItem extension
2015-09-14 13:35:35 +02:00
Daniel Tartaglia 596b9d9074 Add rx_enabled to UIBarButtonItem extension 2015-09-14 07:16:20 -04:00
Krunoslav Zaher 873360000f Merge pull request #136 from yury/simplify-event
Use `if case` for element and error properties
2015-09-13 20:00:17 +02:00
yury e75534abb1 Use `if case` for element and error properties 2015-09-13 20:36:28 +03:00
Krunoslav Zaher 2c4ee7137b Turns on rendered markup for playgrounds. 2015-09-13 16:28:51 +02:00
Krunoslav Zaher 428cc453bb Release 2.0.0-alpha.3 2015-09-13 16:15:52 +02:00
Krunoslav Zaher 880c777a80 Adds `repeatElement` operator. 2015-09-13 15:35:48 +02:00
Krunoslav Zaher 4695ab9de7 Adds `range` operator. 2015-09-13 14:54:47 +02:00
Krunoslav Zaher ebe338675c Adds `buffer` operator, tidy up for `Disposables`. 2015-09-13 13:13:08 +02:00
Krunoslav Zaher cf53818605 Adds travis slack integration. 2015-09-12 14:44:49 +02:00
Krunoslav Zaher 9ac1ade696 Cleanup of observers and improvements to disposable locking performance. 2015-09-12 14:15:42 +02:00
Krunoslav Zaher 0e45753e49 Implements generate operator, and improves Scheduler namings. 2015-09-12 13:16:39 +02:00
Chad Zeluff ae5777f3b2 typo 2015-09-10 08:25:59 -06:00
Chad Zeluff d973395973 using proper level 1 cache 2015-09-10 08:25:34 -06:00
Krunoslav Zaher d4b39565c8 Fixes unused warning. 2015-09-09 12:19:52 +02:00
Krunoslav Zaher 304082289f Merge pull request #129 from ReactiveX/feature/documentation-and-interface-cleanup
Documentation and interface cleanup.
2015-09-09 12:01:27 +02:00
Krunoslav Zaher 15a252e5df Fixes documentation and podspecs. 2015-09-09 11:44:25 +02:00
Krunoslav Zaher 964d44d733 Documentation and interface cleanup. 2015-09-09 11:29:39 +02:00
Krunoslav Zaher c4ea7b4bb2 Documentation and interface cleanup. 2015-09-08 22:32:09 +02:00
Krunoslav Zaher 6139b16ca3 Updates documentation. 2015-09-04 23:15:16 +02:00
Krunoslav Zaher 35eb5e580b Fixes path to playgrounds. 2015-09-03 23:39:54 +02:00
Krunoslav Zaher fb7576fc9c Improves concurrency tests. 2015-09-02 08:35:05 +02:00
Krunoslav Zaher 9647683d3d Adds dependancy on alpha version. 2015-09-01 13:55:52 +02:00
Krunoslav Zaher 0178c0fb1c Adds availability for OSX 10.10 2015-09-01 13:55:37 +02:00
Krunoslav Zaher fa6f4a8412 Increases timing flexibility because of build server. 2015-09-01 13:21:05 +02:00
Krunoslav Zaher 1a59524fc9 Fixes URLs in README.md 2015-09-01 13:19:28 +02:00
Krunoslav Zaher c530c746bd Adds embedded frameworks. 2015-09-01 13:08:55 +02:00
Krunoslav Zaher b7e8592ea3 Small fixes for README.md 2015-09-01 13:02:01 +02:00
Krunoslav Zaher 12089a017c Moves from `send*` to `.on` 2015-09-01 12:54:44 +02:00
Krunoslav Zaher a6211a121e Updates documentation. 2015-09-01 12:21:06 +02:00
Krunoslav Zaher 4d7bce3a6d Merge pull request #119 from ReactiveX/feature/cocoa-new-names
New names and more readable bindings for RxCocoa project
2015-08-31 22:01:23 +02:00
Krunoslav Zaher a4219416cd Introduces new units `ControlProperty` and `ControlEvent`. 2015-08-31 22:01:07 +02:00
Krunoslav Zaher fbe038fcb2 Fixes small leaks in RxExample app. 2015-08-31 12:08:41 +02:00
Krunoslav Zaher 85a9dd16b6 Sets Quick unit test mode as default. 2015-08-31 11:23:12 +02:00
Krunoslav Zaher 6ac94ea5b6 Scheduler revamp (moving towards protocol extensions), internal optimizations, interface cleanup. 2015-08-31 10:59:37 +02:00
Krunoslav Zaher 1f0f5b9788 Adds collection version of `zip`. 2015-08-30 18:51:53 +02:00
Krunoslav Zaher 8e16a8fad4 Adds collection version of `combineLatest`. 2015-08-30 17:49:35 +02:00
Krunoslav Zaher d8b345fca9 Adds quick test to `pre-release-tests.sh`. 2015-08-29 21:21:36 +02:00
Krunoslav Zaher 5608b08f01 Makes `flatMap` more general. Small naming fixes. 2015-08-29 20:44:55 +02:00
Krunoslav Zaher b47255e935 Merge pull request #118 from lfaoro/rxswift-2.0
Added missing Info.plist to targets
2015-08-29 13:15:13 +02:00
Leonard 697ebbc5ae Project updated with new RxBlocking Info.plist 2015-08-29 13:10:02 +02:00
Leonard 8383b40251 RxBlocking now has its own Info.plist
Before RxBlocking was sharing RxCocoa’s Info.plist
2015-08-29 13:09:35 +02:00
Leonard 23dacf919a Added missing Info.plist to targets
Fixes #40
Fixes #106
2015-08-29 12:45:51 +02:00
Krunoslav Zaher 6ee66a1ce1 Merge pull request #116 from ikesyo/remove-box-references
Remove Box references in enums
2015-08-28 11:52:54 +02:00
Syo Ikeda 246f5144a8 Preserve RxBox at the moment 2015-08-28 18:08:23 +09:00
Krunoslav Zaher 4c985476f9 Merge pull request #117 from ikesyo/remove-makeOptional
makeOptional seems to be not needed
2015-08-28 10:22:56 +02:00
Syo Ikeda 76b81cf5e1 Pass initializer directly 2015-08-28 16:41:27 +09:00
Syo Ikeda 58f31f078a makeOptional seems to be not needed
`Optional.init()` can be used instead.
2015-08-28 16:37:46 +09:00
Syo Ikeda 6ba4aead54 Remove RxBox type 2015-08-28 16:14:33 +09:00
Syo Ikeda 77fc2b422d Remove Box references in enums
Those are not used/necessary any more in Swift 2.
2015-08-28 16:08:52 +09:00
Krunoslav Zaher b89141d0cb Fix for Xcode7 build server. 2015-08-27 23:20:40 +02:00
Krunoslav Zaher 47113d7743 Merge pull request #113 from ReactiveX/feature/rxswift-2.0-operator-renames
Feature/rxswift 2.0 operator renames
2015-08-27 09:30:57 +02:00
Krunoslav Zaher 4dc841415b Merge pull request #114 from ikesyo/mainscheduler-static-property
Use static property for sharedInstance in MainScheduler
2015-08-27 09:29:12 +02:00
Syo Ikeda 680ddcc95a Use static property for sharedInstance in MainScheduler 2015-08-27 11:05:16 +09:00
Krunoslav Zaher 43c6a443d5 Transforms operator properties into extension functions. Transforms free functions on collections to `SequenceType` extensions. Removes unnecessary overloads. Cleanup. 2015-08-26 23:11:46 +02:00
Krunoslav Zaher dc18c5f43f Removes resources from output. 2015-08-26 22:44:25 +02:00
Carlos García 830134fecf "".toDouble to Double("") in calculator example 2015-08-25 16:10:17 +02:00
Krunoslav Zaher 045802b43e Merge pull request #107 from ChrisBuchholz/fix-renamed-and-deprecated-zeroRect-and-join
Fix renamed and deprecated zero rect and join
2015-08-25 13:36:11 +02:00
Chris Buchholz b7a8e19612 zeroRect vs renamed to zero 2015-08-25 12:07:23 +02:00
Chris Buchholz c57d98bf18 cannot verify that join has been removed, but is doesn't work in any case, and this does 2015-08-25 12:06:55 +02:00
Krunoslav Zaher 60ecf938b8 Fixes build server script errors. 2015-08-24 21:47:12 +02:00
Krunoslav Zaher da53e617bc Adds `_RX.h` to umbrella header. 2015-08-24 14:38:36 +02:00
Krunoslav Zaher 756a507db7 Fixed `UIBarButtonItem` with Swift 2.0 2015-08-24 11:41:32 +02:00
Carlos García df27673f8d Update RxCocoa.podspec 2015-08-24 07:08:39 +02:00
Krunoslav Zaher bf8645c185 Merge remote-tracking branch 'origin/rxswift-2.0' into rxswift-2.0 2015-08-24 01:34:52 +02:00
Krunoslav Zaher c5cc2ec367 Updates podspecs. 2015-08-24 01:28:57 +02:00
Krunoslav Zaher 98d528fe9a Renames playgrounds to `Rx.playground`. 2015-08-24 01:20:51 +02:00
Krunoslav Zaher 2f306c5300 Fixes target linkages. 2015-08-24 01:19:34 +02:00
Krunoslav Zaher 018bac4d4c Merges with new playgrounds. 2015-08-24 00:39:43 +02:00
Krunoslav Zaher 9c893e75f4 Merges `RxSwift.xcodeproj`, `RxCocoa.xcodeproj` and `RxBlocking.xcodeproj` to `Rx.xcodeproj`. 2015-08-24 00:06:52 +02:00
Krunoslav Zaher cf7ae02cf0 Merge remote-tracking branch 'origin/develop' into rxswift-2.0 2015-08-23 23:18:10 +02:00
Krunoslav Zaher f9acddece2 Speeds up unit tests on build server. 2015-08-23 21:37:31 +02:00
Krunoslav Zaher 7544a2535e Fixes compile warnings. 2015-08-23 21:37:09 +02:00
Krunoslav Zaher 13a75158d1 Cleanup for `deferred` and fixes for OSX support. 2015-08-23 21:21:02 +02:00
Krunoslav Zaher 70eed3e294 Merge from `develop` 2015-08-23 21:07:59 +02:00
Krunoslav Zaher b9e708f681 Refactorings for combineLatest, zip, variable. 2015-08-23 20:32:10 +02:00
Krunoslav Zaher a19c4c50c5 Fixes examples. 2015-08-23 18:09:15 +02:00
Krunoslav Zaher 12058c17af Renames `tap` to `doOn` 2015-08-23 17:40:09 +02:00
Krunoslav Zaher 5a8c053f5f Refactoring of ObservableType, ObserverType, SubjectType, Bag and Subjects. 2015-08-23 17:30:26 +02:00
Krunoslav Zaher 75ef8e0903 Merge pull request #105 from ReactiveX/feature/playgrounds-2.0
Xcode 7 version of playground
2015-08-19 21:49:19 +02:00
Carlos García 734508fd81 Xcode 7 version of playground 2015-08-19 19:05:09 +02:00
Krunoslav Zaher fe3b7ab316 Merge pull request #104 from sergdort/issue-#99
UICollectionView rx_contentOffset and UICollectionViewDelegateFlowLay…
2015-08-19 10:35:08 +02:00
sshulga 7e285dd558 UICollectionView rx_contentOffset and UICollectionViewDelegateFlowLayout #99 2015-08-19 11:19:51 +03:00
Krunoslav Zaher a9a8c17045 Release 1.9.1 2015-08-17 10:32:11 +02:00
Krunoslav Zaher 11dca76244 Merge pull request #92 from ReactiveX/feature/calculator-example
Feature/calculator example
2015-08-16 11:37:55 +02:00
Carlos García 4340938363 Calculator example - logic 2015-08-16 01:37:36 +02:00
Krunoslav Zaher 4ea534ba1e Merge pull request #96 from lfaoro/rxswift-2.0
Polished playgrounds
2015-08-15 19:04:38 +02:00
Leonard 554addd805 Polished playgrounds
All errors have been fixed for PG:
* Introduction
* Subjects
2015-08-15 19:00:59 +02:00
Krunoslav Zaher 59a88933a8 `trySend` to `?.on` and cleanup for `multicast`, `refCount`, `asObservable` 2015-08-15 13:12:43 +02:00
Krunoslav Zaher ea9acdd7f7 `trySend` to `?.on` and cleanup for `reduce` 2015-08-14 11:25:53 +02:00
Krunoslav Zaher ba05314a98 Adds debug default identifier. 2015-08-13 23:41:51 +02:00
Krunoslav Zaher eac2e7a669 `trySend` to `?.on` and cleanup for `scan` 2015-08-13 23:40:14 +02:00
Krunoslav Zaher 95f072190a `trySend` to `?.on` and cleanup for `startWith` 2015-08-13 23:32:20 +02:00
Krunoslav Zaher 40abfcf4b5 `trySend` to `?.on` and cleanup for `tap` 2015-08-13 23:24:28 +02:00
Krunoslav Zaher cbe6c4ee15 `trySend` to `?.on` and cleanup for `distinctUntilChanged` 2015-08-13 23:07:25 +02:00
Krunoslav Zaher 2e0ca2e284 `trySend` to `?.on` and cleanup for `asObservable` 2015-08-13 22:26:59 +02:00
Krunoslav Zaher 72e7c85d7f `trySend` to `?.on` and cleanup for `delaySubscription` 2015-08-13 22:25:58 +02:00
Krunoslav Zaher 753520b406 `trySend` to `?.on` and cleanup for `timer` 2015-08-13 22:23:25 +02:00
Krunoslav Zaher 7427c227fc `trySend` to `?.on` and cleanup for `Sample` 2015-08-13 22:20:39 +02:00
Krunoslav Zaher 1231d25377 `trySend` to `?.on` and cleanup for `throttle` 2015-08-13 22:10:26 +02:00
Krunoslav Zaher 55d3e77377 `trySend` to `?.on` and cleanup for `amb` 2015-08-13 21:37:08 +02:00
Krunoslav Zaher a7062f8b31 `trySend` to `?.on` and cleanup for `takeUntil` 2015-08-13 21:32:37 +02:00
Krunoslav Zaher fee2b0cf85 `trySend` to `?.on` and cleanup for `catch` 2015-08-13 21:24:03 +02:00
Krunoslav Zaher 66dfc64207 Improves delete simulators script. 2015-08-13 21:20:31 +02:00
Krunoslav Zaher 2da4774028 `trySend` to `?.on` and cleanup for `concat` 2015-08-11 10:14:36 +02:00
Krunoslav Zaher d4aa127e63 `trySend` to `?.on` and cleanup for `switchLatest` 2015-08-11 10:10:55 +02:00
Krunoslav Zaher 83fa0854a2 RxResult -> throws for takeWhile 2015-08-11 09:58:25 +02:00
Krunoslav Zaher cc5353792d RxResult -> throws for take 2015-08-11 09:52:33 +02:00
Krunoslav Zaher 0ab1e8d828 RxResult -> throws for skip 2015-08-11 09:49:52 +02:00
Krunoslav Zaher 9d07614be3 RxResult -> throws for flatMap 2015-08-11 09:47:28 +02:00
Krunoslav Zaher e9b620a51e Renames tests from `where` to `filter`. 2015-08-11 09:36:32 +02:00
Krunoslav Zaher 01af1a554a RxResult -> throws for filter 2015-08-11 09:34:17 +02:00
Krunoslav Zaher 4004a2d414 RxResult -> throws for map 2015-08-11 09:19:18 +02:00
Krunoslav Zaher 2372daa14c Fixes build for RxExample-iOS-no-module. 2015-08-10 13:49:18 +02:00
Krunoslav Zaher 2c33f7a89a Replaces `>-` with protocol extensions. Unit tests pass. Adds `CHANGELOG.md` 2015-08-10 01:43:30 +02:00
Krunoslav Zaher 0ca9c90f6a Merge branch 'feature/swift2.0' into rxswift-2.0 2015-08-08 19:39:07 +02:00
Krunoslav Zaher 1251f2ce14 Merge branch 'develop' into feature/swift2.0 2015-08-08 19:29:13 +02:00
Krunoslav Zaher bd514d2d15 Merge pull request #85 from garethknowles/feature/swift2.0
Xcode 7 Beta 5 Fix - Prefix and Suffix Syntax Changes
2015-08-07 12:51:15 +02:00
Gareth Knowles 3a1a9bbd57 Xcode 7 Beta 5 Fix - Prefix and Suffix Syntax Changes 2015-08-07 10:49:17 +01:00
Krunoslav Zaher 701e7bd4cc Travis Xcode7 fixes. 2015-08-06 09:26:17 +02:00
Krunoslav Zaher 8957cab8f9 Merge branch 'develop' into feature/swift2.0 2015-08-06 02:38:23 +02:00
Carlos García eb8280b4f2 calculator UI 2015-08-04 11:49:14 +02:00
Krunoslav Zaher b42c76735e Merge pull request #66 from garethknowles/feature/swift2.0
Feature/swift2.0 - Xcode 7 Beta 4 Fixes
2015-07-25 19:32:30 +02:00
Gareth Knowles eeffac4502 Fix Errors in examples for xcode 7 beta 4 2015-07-22 10:41:23 +01:00
Gareth Knowles 470d56a3e9 Fixes Xcode 7 beta 4 RxCocoa Errors 2015-07-22 10:39:48 +01:00
Gareth Knowles 93471e5e5b Fixed NSError Warnings due to no longer needed casting 2015-07-22 10:39:30 +01:00
Gareth Knowles 422d27b4f4 Fixed Xcode 7 Beta 4 Internal Type Errors 2015-07-22 10:39:09 +01:00
Krunoslav Zaher 98e1a29200 Updates to 1.8.1 2015-07-21 22:47:04 +02:00
Krunoslav Zaher e6e4e53b69 Updated to 1.8 2015-07-21 22:46:17 +02:00
Krunoslav Zaher bd284c8269 Updated to 1.7 2015-07-21 22:46:17 +02:00
Gareth Knowles 8d3533caf6 iOS 9.4 Fix for observeValueForKeyPath change 2015-07-21 22:46:17 +02:00
Krunoslav Zaher f524f20eb9 All example work except for 2 for iOS. Can't compile reactive data sources. Compiler is not yet ready for that :( 2015-07-21 22:46:17 +02:00
Krunoslav Zaher d580552436 OSX unit tests passing. iOS simulator won't even start for iOS unit tests :( 2015-07-21 22:46:17 +02:00
Seivan Heidari 09cdeca380 Update RXCocoa
And some work on RXCocoasamples.
2015-07-21 22:46:16 +02:00
Seivan Heidari 8c87a92326 Preprocessor, RxSwift & RxSwiftTests converted to Swift 2
7 Failed tests
6 related to assinging to _ doesn't retain.
1 related to Tracer
2015-07-21 22:46:16 +02:00
1017 changed files with 71355 additions and 34517 deletions

16
.gitignore vendored
View File

@ -34,3 +34,19 @@ timeline.xctimeline
# Carthage/Checkouts
Carthage/Build
# Various
.DS_Store
# Linux
*.swp
*.swo
# Swift Package Manager
.build/
Packages/

278
.jazzy.yml Normal file
View File

@ -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

View File

@ -1,10 +1,13 @@
language: objective-c
osx_image: xcode6.4
xcode_sdk: iphonesimulator8.4
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

574
CHANGELOG.md Normal file
View File

@ -0,0 +1,574 @@
# Change Log
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
* Exposes `installForwardDelegate`.
* Adds `proxyForObject` as protocol extension and deprecates global function version.
* Improves `installForwardDelegate` assert messaging.
* Improves gesture recognizer extensions to use typed gesture recognizers in `rx_event`.
* Adds `RxTextInput` protocol to enable creating reactive extensions for `UITextInput/NSTextInput`.
* Adds `rx_willDisplayCell` and `rx_didEndDisplayingCell` extensions to `UITableView`.
* Improves playgrounds.
#### Anomalies
* Fixes in documentation.
* Turns off Bitcode for `RxTests` CocoaPods integration.
* Fixes `UITextField.rx_text` and `UITextView.rx_text` integrations to be more robust when used with two way binding.
* Fixes two way binding example code so it now properly handles IME used in Asian cultures and adds explanations how to properly perform two way bindings. https://github.com/ReactiveX/RxSwift/issues/649
* Removes `distinctUntilChanged` from control extensions. https://github.com/ReactiveX/RxSwift/issues/626
## [2.4.0](https://github.com/ReactiveX/RxSwift/releases/tag/2.4)
#### Features
* adds `Driver.drive` with `Variable` parameter.
* exposes `RxSearchBarDelegateProxy`
* adds `rx_cancelButtonClicked` to `UISearchBar`.
* adds `rx_searchButtonClicked` to `UISearchBar`.
* adds `UISearchController` extensions:
* `rx_didDismiss`
* `rx_didPresent`
* `rx_present`
* `rx_willDismiss`
* `rx_willPresent`
#### Anomalies
* Fixes anomaly with `multicast` disposing subscription.
* Small grammar fixes in code.
* Fixes in documentation.
## [2.3.1](https://github.com/ReactiveX/RxSwift/releases/tag/2.3.1)
#### Features
* Xcode 7.3 / Swift 2.2 support
## [2.3.0](https://github.com/ReactiveX/RxSwift/releases/tag/2.3.0)
#### Features
* Adds `rx_badgeValue` to `UITabBarItem`.
* Adds `rx_progress` to `UIProgresView`.
* Adds `rx_selectedScopeButtonIndex` to `UISearchBar`.
* Adds `asyncInstance` to `MainScheduler`.
* Makes `name` parmeter optional for `rx_notification` extension.
* Adds `UnitTests.md`.
* Adds `Tips.md`.
* Updates playground inline documentation with running instructions.
* Synchronizes copy of `RxDataSources` source files inside example project to `0.6` release.
#### Anomalies
* Fixes anomaly with synchronization in disposable setter of `SingleAssignmentDisposable`.
* Improves `DelegateProxy` memory management.
* Fixes anomaly during two way binding of `UITextView` text value.
* Improves `single` operator so it handles reentrancy better.
## [2.2.0](https://github.com/ReactiveX/RxSwift/releases/tag/2.2.0)
#### Public Interface anomalies
* Fixes problem with `timer` operator. Changes return type from `Observable<Int64>` to `Observable<T>`. This could potentially cause code breakage, but it was an API anomaly.
* Curried functions were marked deprecated so they were replaced in `UITableView` and `UICollectionView` extensions with equivalent lambdas. This shouldn't break anyone's code, but it is a change in public interface.
This is example of those changes:
```swift
- public func rx_itemsWithCellFactory<S : Sequence, O : ObservableType where O.E == S>
(source: O)
(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.Iterator.Element) -> UITableViewCell) -> Disposable
```
* Fixes anomaly in `CLLocationManager` extensions
```swift
- public var rx_didFinishDeferredUpdatesWithError: RxSwift.Observable<NSError> { get }
+ public var rx_didFinishDeferredUpdatesWithError: RxSwift.Observable<NSError?> { get }
```
#### Features
* Adds `UIBindingObserver`.
* Adds `doOnNext` convenience operator (also added to `Driver`).
* Adds `doOnError` convenience operator.
* Adds `doOnCompleted` convenience operator (also added to `Driver`).
* Adds `skip`, `startWith` to `Driver`.
* Adds `rx_active` extension to `NSLayoutConstraint`.
* Adds `rx_refreshing` extension to `UIRefreshControl`.
* Adds `interval` and `timer` to `Driver`.
* Adds `rx_itemAccessoryButtonTapped` to `UITableView` extensions.
* Adds `rx_networkActivityIndicatorVisible` to `UIApplication`.
* Adds `rx_selected` to `UIControl`.
#### Anomalies
* Fixes anomaly with registering multiple observers to `UIBarButtonItem`.
* Fixes anomaly with blocking operators possibly over-stopping the `RunLoop`.
## [2.1.0](https://github.com/ReactiveX/RxSwift/releases/tag/2.1.0)
#### Features
* Adds `UIImagePickerController` delegate wrappers.
* Adds `SectionedViewDataSourceType` that enables third party data sources to use existing `rx_modelSelected`/`rx_modelDeselected` wrappers.
* Adds `rx_modelDeselected` to `UITableView`
* Adds `rx_itemDeselected` to `UITableView`
* Adds `rx_modelDeselected` to `UICollectionView`
* Adds `rx_itemDeselected` to `UICollectionView`
* Adds `rx_state` to `NSButton`
* Adds `rx_enabled` to `NSControl`
* Adds `UIImagePickerController` usage example to Example app.
#### Anomalies
* Removes usage of `OSSpinLock`s from all `Darwin` platforms because of problems with inversion of priority on iOS. [Original thread on swift mailing list is here](https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html)
* Reduces verbose output from `RxCocoa` project in debug mode. `TRACE_RESOURCES` is now also treated as a verbosity level setting. It is possible to get old output by using `TRACE_RESOURCES` with verbosity level `>= 2`. [#397](https://github.com/ReactiveX/RxSwift/issues/397)
* Fixes anomaly with logging of HTTP body of requests in `RxCocoa` project.
## [2.0.0](https://github.com/ReactiveX/RxSwift/releases/tag/2.0.0)
#### Features
* Changes package names to `io.rx.[library]`
* Packages data sources from `RxDataSourceStarterKit` into it's own repository [RxDataSources](https://github.com/RxSwiftCommunity/RxDataSources) under `RxSwiftCommunity`.
* Removes deprecated APIs.
#### Anomalies
* Replaces hacky code that solved anomaly caused by interaction between autocorrect and text controls notification mechanism with proper solution. #333
## [2.0.0-rc.0](https://github.com/ReactiveX/RxSwift/releases/tag/2.0.0-rc.0)
#### Features
* Adds generic `public func rx_sentMessage(selector: Selector) -> Observable<[AnyObject]>` that enables observing of messages
sent to any object. (This is enabled if DISABLE_SWIZZLING isn't set).
* use cases like `cell.rx_sentMessage("prepareForReuse")` are now supported.
* Linux support (proof of concept, but single threaded mode works)
* more info in [Documentation/Linux.md](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Linux.md)
* Initial support for `Swift Package Manager`
* works on `Linux` (`RxSwift`, `RxBlocking`, `RxTests`)
* doesn't work on OSX because it can't compile `RxCocoa` and `RxTests` (because of inclusion of `XCTest` extensions), but OSX has two other package managers and manual method.
* Project content is linked to `Sources` automagically using custom tool
* more info in [Documentation/Linux.md](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Linux.md)
* Adds `VirtualTimeScheduler` to `RxSwift`
* Adds `HistoricalScheduler` to `RxSwift`
* Improves performance of virtual schedulers using priority queue.
* Adds new `RxTests` library to enable testing of custom Rx operators.
This library contains everything needed to write unit tests in the following way:
```swift
func testMap() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable([
next(150, 1),
next(210, 0),
next(220, 1),
next(230, 2),
next(240, 4),
completed(300)
])
let res = scheduler.start { xs.map { $0 * 2 } }
let correctEvents = [
next(210, 0 * 2),
next(220, 1 * 2),
next(230, 2 * 2),
next(240, 4 * 2),
completed(300)
]
let correctSubscriptions = [
Subscription(200, 300)
]
XCTAssertEqual(res.events, correctEvents)
XCTAssertEqual(xs.subscriptions, correctSubscriptions)
}
```
* Adds test project for `RxExample-iOS` that demonstrates how to easily write marble tests using `RxTests` project.
```swift
let (
usernameEvents,
passwordEvents,
repeatedPasswordEvents,
loginTapEvents,
expectedValidatedUsernameEvents,
expectedSignupEnabledEvents
) = (
scheduler.parseEventsAndTimes("e---u1----u2-----u3-----------------", values: stringValues).first!,
scheduler.parseEventsAndTimes("e----------------------p1-----------", values: stringValues).first!,
scheduler.parseEventsAndTimes("e---------------------------p2---p1-", values: stringValues).first!,
scheduler.parseEventsAndTimes("------------------------------------", values: events).first!,
scheduler.parseEventsAndTimes("e---v--f--v--f---v--o----------------", values: validations).first!,
scheduler.parseEventsAndTimes("f--------------------------------t---", values: booleans).first!
)
```
* Adds example app for GitHub signup example that shows the same example written with and without `Driver`.
* Documents idea behind units and `Driver` in `Units.md`.
* Example of table view with editing is polished to use more functional approach.
* Adds `deferred` to `Driver` unit.
* Removes implicitly unwrapped optionals from `CLLocationManager` extensions.
* Removes implicitly unwrapped optionals from `NSURLSession` extensions.
* Polishes the `debug` operator format.
* Adds optional `cellType` parameter to Table/Collection view `rx_itemsWithCellIdentifier` method.
* Polish for calculator example in `RxExample` app.
* Documents and adds unit tests for tail recursive optimizations of `concat` operator.
* Moves `Event` equality operator to `RxTests` project.
* Adds `seealso` references to `reactivex.io`.
* Polishes headers in source files and adds tests to enforce standard header format.
* Adds `driveOnScheduler` to enable scheduler mocking for `Driver` during unit tests.
* Adds assertions to `drive*` family of functions that makes sure they are always called from main thread.
* Refactoring and polishing of internal ObjC runtime interception architecture.
#### Deprecated
* Changes `ConnectableObservable`, generic argument is now type of elements in observable sequence and not type of underlying subject. (BREAKING CHANGE)
* Removes `RxBox` and `RxMutable` box from public interface. (BREAKING CHANGE)
* `SchedulerType` now isn't parametrized on `Time` and `TimeInterval`.
* Deprecates `Variable` implementing `ObservableType` in favor of `asObservable()`.
* Now variable also sends `.Completed` to observable sequence returned from `asObservable` when deallocated.
If you were (mis)using variable to return single value
```
Variable(1).map { x in ... }
```
... you can just use `just` operator
```
Observable.just(1).map { x in ... }
```
* Deprecates free functions in favor of `Observable` factory methods, and deprecates versions of operators with hidden external parameters (scheduler, count) in favor of ones with explicit parameter names.
E.g.
`Observable.just(1)` instead of `just(1)`
`Observable.empty()` instead of `empty()`
`Observable.error()` instead of `failWith()`
`Observable.of(1, 2, 3)` instead of `sequenceOf(1, 2, 3)`
`.debounce(0.2, scheduler: MainScheduler.sharedInstance)` instead of `.debounce(0.2, MainScheduler.sharedInstance)`
`Observable.range(start:0, count: 10)` instead of `range(0, 10)`
`Observable.generate(initialState: 0, condition: { $0 < 10 }) { $0 + 1 }` instead of `generate(0, condition: { $0 < 10 }) { $0 + 1 }`
`Observable<Int>.interval(1, scheduler: MainScheduler.sharedInstance)` instead of `interval(1, MainScheduler.sharedInstance)`
...
If you want to continue using free functions form, you can define your free function aliases for `Observable` factory methods (basically copy deprecated methods).
* Deprecates `UIAlertView` extensions.
* These extensions could be stored locally if needed.
* Deprecates `UIActionSheet` extensions.
* These extensions could be stored locally if needed.
* Deprecates `rx_controlEvents` in favor of `rx_controlEvent`.
* Deprecates `MainScheduler.sharedInstance` in favor of `MainScheduler.instance`
* Deprecates `ConcurrentMainScheduler.sharedInstance` in favor of `ConcurrentMainScheduler.instance`
* Deprecates factory methods from `Drive` in favor of `Driver` factory methods.
* Deprecates `sampleLatest` in favor of `withLatestFrom`.
* Deprecates `ScopedDisposable` and `scopedDispose()` in favor of `DisposeBag`.
#### Fixed
* Improves and documents resource leak code in `RxExample`.
* Replaces `unowned` reference with `weak` references in `RxCocoa` project.
* Fixes `debug` operator not using `__FILE__` and `__LINE__` properly.
* Fixes anomaly with `timeout` operator.
* Fixes problem with spell-checker and `UIText*` losing focus.
## [2.0.0-beta.4](https://github.com/ReactiveX/RxSwift/releases/tag/2.0.0-beta.4)
#### Updated
* Adds `ignoreElements` operator.
* Adds `timeout` operator (2 overloads).
* Adds `shareReplayLatestWhileConnected` operator.
* Changes `Driver` to internally use `shareReplayLatestWhileConnected` for subscription sharing instead of `shareReplay(1)`.
* Adds `flatMapFirst` to `Driver` unit.
* Adds `replayAll` operator.
* Adds `createUnbounded` factory method to `ReplaySubject`.
* Adds optional type hints to `empty`, `failWith` and `never` (`empty(Int)` now works and means empty observable sequence of `Int`s).
* Adds `rx_hidden` to `UIView`.
* Adds `rx_alpha` to `UIView`.
* Adds `rx_attributedText` to `UILabel`.
* Adds `rx_animating` to `UIActivityIndicatorView`.
* Adds `rx_constant` to `NSLayoutConstraint`.
* Removes implicitly unwrapped optional from `NSURLSession.rx_response`.
* Exposes `rx_createDataSourceProxy`, `rx_createDelegateProxy` on `UITableView`/`UICollectionView`.
* Exposes `rx_createDelegateProxy` on `UITextView`.
* Exposes `rx_createDelegateProxy` on `UIScrollView`.
* Exposes `RxCollectionViewDataSourceProxy`.
* Exposes `RxCollectionViewDelegateProxy`.
* Exposes `RxScrollViewDelegateProxy`.
* Exposes `RxTableViewDataSourceProxy`.
* Exposes `RxTableViewDelegateProxy`.
* Deprecates `proxyForObject` in favor of `proxyForObject<P : DelegateProxyType>(type: P.Type, _ object: AnyObject) -> P`.
* Deprecates `rx_modelSelected<T>()` in favor of `rx_modelSelected<T>(modelType: T.Type)`.
* Adds `func bindTo(variable: Variable<E>) -> Disposable` extension to `ObservableType`.
* Exposes `ControlEvent` init.
* Exposes `ControlProperty` init.
* Refactoring of example app
* Divides examples into sections
* Adds really simple examples of how to do simple calculated bindings with vanilla Rx.
* Adds really simple examples of table view extensions (sectioned and non sectioned version).
* Refactoring of `GitHub sign in example` to use MVVM paradigm.
#### Fixed
* Fixes documentation for `flatMapFirst`
* Fixes problem with delegate proxies not detecting all delegate methods in delegate proxy hierarchy.
## [2.0.0-beta.3](https://github.com/ReactiveX/RxSwift/releases/tag/2.0.0-beta.3)
#### Updated
* Improves KVO mechanism.
* Type of observed object is now first argument `view.rx_observe(CGRect.self, "frame")`
* Support for observing ObjC bridged enums and `RawRepresentable` protocol
* Support for easier extending of KVO using `KVORepresentable` protocol
* Deprecates KVO extensions that don't accept type as first argument in favor of ones that do.
* Adds `flatMapLatest` (also added to `Driver` unit).
* Adds `flatMapFirst` operator (also added to `Driver` unit).
* Adds `retryWhen` operator.
* Adds `window` operator.
* Adds `single` operator.
* Adds `single` (blocking version) operator.
* Adds `rx_primaryAction` on `UIButton` for `tvOS`.
* Transforms error types in `RxSwift`/`RxCocoa` projects from `NSError`s to Swift enum types.
* `RxError`
* `RxCocoaError`
* `RxCocoaURLError`
* ...
* `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 `Sequence` in favor of `toObservable`.
* Adds `toObservable` extension to `Array`.
* Improves table view animated data source example.
* Polishing of `RxDataSourceStarterKit`
* `differentiateForSectionedView` operator
* `rx_itemsAnimatedWithDataSource` extension
* Makes blocking operators run current thread's runloop while blocking and thus disabling deadlocks.
#### Fixed
* Fixes example with `Variable` in playgrounds so it less confusing regarding memory management.
* Fixes `UIImageView` extensions to use `UIImage?` instead of `UIImage!`.
* Fixes improper usage of `CustomStringConvertible` and replaces it with `CustomDebugStringConvertible`.
## [2.0.0-beta.2](https://github.com/ReactiveX/RxSwift/releases/tag/2.0.0-beta.2)
#### Updated
* Optimizations. System now performs significantly fewer allocations and is several times faster then 2.0.0-beta.1
* Makes `AnonymousObservable` private in favor of `create` method.
* Adds `toArray` operator (non blocking version).
* Adds `withLatestFrom` operator, and also extends `Driver` with that operation.
* Adds `elementAt` operator (non blocking version).
* Adds `takeLast` operator.
* Improves `RxExample` app. Adds retries example when network becomes available again.
* Adds composite extensions to `Bag` (`on`, `disposeAllIn`).
* Renames mistyped extension on `ObserverType` from `onComplete` to `onCompleted`.
#### Fixed
* Fixes minimal platform version in OSX version of library to 10.9
## [2.0.0-beta.1](https://github.com/ReactiveX/RxSwift/releases/tag/2.0.0-beta.1)
#### Updated
* Adds `Driver` unit. This unit uses Swift compiler to prove certain properties about observable sequences. Specifically
* that fallback error handling is put in place
* results are observed on main thread
* work is performed only when there is a need (at least one subscriber)
* computation results are shared between different observers (replay latest element)
* Renames `ObserverOf` to `AnyObserver`.
* Adds new interface `ObservableConvertibleType`.
* Adds `BlockingObservable` to `RxBlocking` and makes it more consistent with `RxJava`.
* Renames `func subscribe(next:error:completed:disposed:)` to `func subscribe(onNext:onError:onCompleted:onDisposed:)`
* Adds concat convenience method `public func concat<O : ObservableConvertibleType where O.E == E>(second: O) -> RxSwift.Observable<Self.E>`
* Adds `skipUntil` operator.
* Adds `takeWhile` operator.
* Renames `takeWhile` indexed version to `takeWhileWithIndex`
* Adds `skipWhile` operator.
* Adds `skipWhileWithIndex` operator.
* Adds `using` operator.
* Renames `func doOn(next:error:completed:)` to `func doOn(onNext:onError:onCompleted:)`.
* Makes `RecursiveImmediateSchedulerOf` private.
* Makes `RecursiveSchedulerOf` private.
* Adds `ConcurrentMainScheduler`.
* Adds overflow error so now in case of overflow, operators will return `RxErrorCode.Overflow`.
* Adds `rx_modelAtIndexPath` to `UITableView` and `UICollectionView`.
* Adds `var rx_didUpdateFocusInContextWithAnimationCoordinator: ControlEvent<(context:animationCoordinator:)>` to `UITableView` and `UICollectionView`
* Makes `resultSelector` argument in `combineLatest` explicit `func combineLatest<O1, O2, R>(source1: O1, _ source2: O2, resultSelector: (O1.E, O2.E) throws -> R) -> RxSwift.Observable<R>`.
* Makes `resultSelector` argument in `zip` explicit `func combineLatest<O1, O2, R>(source1: O1, _ source2: O2, resultSelector: (O1.E, O2.E) throws -> R) -> RxSwift.Observable<R>`.
* Adds activity indicator example in `RxExample` app.
* Adds two way binding example in `RxExample` app.
* many other small features
#### Fixed
* Problem with xcodebuild 7.0.1 treating tvOS shared schemes as osx schemes.
## [2.0.0-alpha.4](https://github.com/ReactiveX/RxSwift/releases/tag/2.0.0-alpha.4)
#### Updated
* Adds `tvOS` support
* Adds `watchOS` support
* Adds auto loading example to example app
* Restores old `Variable` behavior. Variable doesn't send anything on dealloc.
* Adds performance tests target.
* Adds more detailed resource tracing during unit tests (important for further optimizations).
* Adds `UIStepper` extensions.
* Adds `UIBarButtonItem` enabled property wrapper.
* Adds response data to userInfo of error for `rx_response` extensions of `NSURLSession`.
* Adds `onNext`, `onError` and `onCompleted` convenience methods to `ObserverType`.
#### Fixed
* Fixes problem on some systems with unregistering `CurrentThreadScheduler` from current thread.
* Fixes retry parameter naming (`maxAttemptCount`).
* Fixes a lot of unit test warnings.
* Removes embedding of Swift library with built frameworks.
## [2.0.0-alpha.3](https://github.com/ReactiveX/RxSwift/releases/tag/2.0.0-alpha.3)
#### Updated
* Renames `ImmediateScheduler` protocol to `ImmediateSchedulerType`
* Renames `Scheduler` protocol to `SchedulerType`
* Adds `CurrentThreadScheduler`
* Adds `generate` operator
* Cleanup of dead observer code.
* Removes `SpinLock`s in disposables in favor of more performant `OSAtomicCompareAndSwap32`.
* Adds `buffer` operator (version with time and count).
* Adds `range` operator.
* Adds `repeat` operator.
## [2.0.0-alpha.2](https://github.com/ReactiveX/RxSwift/releases/tag/2.0.0-alpha.2)
#### Updated
* Renames `ScopedDispose` to `ScopedDisposable`
* Deprecates `observeSingleOn` in favor of `observeOn`
* Adds inline documentation
* 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.
* Deprecates `sendNext` on `Variable` in favor of just using `value` setter.
* Renames `rx_searchText` to `rx_text` on `UISearchBar+Rx`.
* Changes parameter type for `rx_imageAnimated` to be transitionType (kCATransitionFade, kCATransitionMoveIn, ...).
## [2.0.0-alpha.1](https://github.com/ReactiveX/RxSwift/releases/tag/2.0-alpha.1)
#### Fixed
* Problem in RxExample with missing `observeOn` for images.
#### Updated
* Removes deprecated APIs
* Adds `ObservableType`
* Moved from using `>-` operator to protocol extensions
* Change from `disposeBag.addDisposable` to `disposable.addDisposableTo`
* Changes in RxCocoa extensions to enable fluent style
* Rename of `do*` to `doOn*`
* Deprecates `returnElement` in favor of `just`
* Deprecates `aggregate` in favor of `reduce`
* Deprecates `variable` in favor of `shareReplay(1)` (to be consistent with RxJS version)
* Method `next` on `Variable` in favor of `sendNext`
#### Fixed
## [1.9.1](https://github.com/ReactiveX/RxSwift/releases/tag/1.9.1)
#### Updated
* Adds Calculator example app
* Performance improvements for Queue
#### Fixed
* Crash in `rx_didChangeAuthorizationStatus`. [#89](https://github.com/ReactiveX/RxSwift/issues/89)

74
CODE_OF_CONDUCT.md Normal file
View File

@ -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/

View File

@ -2,7 +2,7 @@
There are multiple ways you can contribute to this project.
The easiest way to contribute is to report possible bugs, request features, [discuss ideas](mailto:krunoslav.zaher@gmail.com?subject=[RxSwift] I have an idea) and share excitement about this project.
The easiest way to contribute is to report possible bugs, request features, [discuss ideas](https://github.com/ReactiveX/RxSwift/issues) and share excitement about this project.
You can also make pull requests.
@ -10,10 +10,16 @@ There are some best practices that will be followed during the development of th
So what does this mean in practice:
* If you notice a bug in **documentation** only, that could be considered non risky hotfix, so please make a PR to **master** branch
* If you notice a bug in **source code** please make a PR to **develop** branch because otherwise it could get a lot worse :) If needed, hotfix will be created from commit with the fix and applied to master branch after the PR has been merged into develop and tested.
* If you want to make a small contribution (dozen lines of code) that is not a bug fix please make a pull request to **develop** branch.
* If you want to make a big contribution to the project, please [discuss it](mailto:krunoslav.zaher@gmail.com?subject=[RxSwift] I have an idea) first with me so we can make sure project is going in the right direction. All pull requests with **source code** contributions should be targeted to **develop** branch.
* 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

33
Dangerfile Normal file
View File

@ -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

View File

@ -3,7 +3,7 @@ API
## RxSwift supported operators
In some cases there are multiple aliases for the same operator, because on different platforms / implementations, the same operation is sometimes called differently. Sometimes this is because historical reasons, sometimes because of reserved language keywords.
In some cases there are multiple aliases for the same operator, because on different platforms / implementations, the same operation is sometimes named differently. Sometimes this is because of historical reasons, while sometimes because of reserved language keywords.
When lacking a strong community consensus, RxSwift will usually include multiple aliases.
@ -13,28 +13,39 @@ Operators are stateless by default.
* [`asObservable`](http://reactivex.io/documentation/operators/from.html)
* [`create`](http://reactivex.io/documentation/operators/create.html)
* [`defer`](http://reactivex.io/documentation/operators/defer.html)
* [`deferred`](http://reactivex.io/documentation/operators/defer.html)
* [`empty`](http://reactivex.io/documentation/operators/empty-never-throw.html)
* [`failWith`](http://reactivex.io/documentation/operators/empty-never-throw.html)
* [`from` (array)](http://reactivex.io/documentation/operators/from.html)
* [`error`](http://reactivex.io/documentation/operators/empty-never-throw.html)
* [`toObservable` (array)](http://reactivex.io/documentation/operators/from.html)
* [`interval`](http://reactivex.io/documentation/operators/interval.html)
* [`never`](http://reactivex.io/documentation/operators/empty-never-throw.html)
* [`returnElement` / `just`](http://reactivex.io/documentation/operators/just.html)
* [`returnElements`](http://reactivex.io/documentation/operators/from.html)
* [`just`](http://reactivex.io/documentation/operators/just.html)
* [`of`](http://reactivex.io/documentation/operators/from.html)
* [`range`](http://reactivex.io/documentation/operators/range.html)
* [`repeatElement`](http://reactivex.io/documentation/operators/repeat.html)
* [`timer`](http://reactivex.io/documentation/operators/timer.html)
#### Transforming Observables
* [`buffer`](http://reactivex.io/documentation/operators/buffer.html)
* [`flatMap`](http://reactivex.io/documentation/operators/flatmap.html)
* [`map` / `select`](http://reactivex.io/documentation/operators/map.html)
* [`flatMapFirst`](http://reactivex.io/documentation/operators/flatmap.html)
* [`flatMapLatest`](http://reactivex.io/documentation/operators/flatmap.html)
* [`map`](http://reactivex.io/documentation/operators/map.html)
* [`scan`](http://reactivex.io/documentation/operators/scan.html)
* [`window`](http://reactivex.io/documentation/operators/window.html)
#### Filtering Observables
* [`debounce` / `throttle`](http://reactivex.io/documentation/operators/debounce.html)
* [`distinctUntilChanged`](http://reactivex.io/documentation/operators/distinct.html)
* [`filter` / `where`](http://reactivex.io/documentation/operators/filter.html)
* [`elementAt`](http://reactivex.io/documentation/operators/elementat.html)
* [`filter`](http://reactivex.io/documentation/operators/filter.html)
* [`sample`](http://reactivex.io/documentation/operators/sample.html)
* [`skip`](http://reactivex.io/documentation/operators/skip.html)
* [`take`](http://reactivex.io/documentation/operators/take.html)
* [`takeLast`](http://reactivex.io/documentation/operators/takelast.html)
* [`single`](http://reactivex.io/documentation/operators/first.html)
#### Combining Observables
@ -48,6 +59,7 @@ Operators are stateless by default.
* [`catch`](http://reactivex.io/documentation/operators/catch.html)
* [`retry`](http://reactivex.io/documentation/operators/retry.html)
* [`retryWhen`](http://reactivex.io/documentation/operators/retry.html)
#### Observable Utility Operators
@ -56,10 +68,15 @@ Operators are stateless by default.
* [`observeOn` / `observeSingleOn`](http://reactivex.io/documentation/operators/observeon.html)
* [`subscribe`](http://reactivex.io/documentation/operators/subscribe.html)
* [`subscribeOn`](http://reactivex.io/documentation/operators/subscribeon.html)
* [`timeout`](http://reactivex.io/documentation/operators/timeout.html)
* [`using`](http://reactivex.io/documentation/operators/using.html)
* debug
#### Conditional and Boolean Operators
* [`amb`](http://reactivex.io/documentation/operators/amb.html)
* [`skipWhile`](http://reactivex.io/documentation/operators/skipwhile.html)
* [`skipUntil`](http://reactivex.io/documentation/operators/skipuntil.html)
* [`takeUntil`](http://reactivex.io/documentation/operators/takeuntil.html)
* [`takeWhile`](http://reactivex.io/documentation/operators/takewhile.html)
@ -67,6 +84,7 @@ Operators are stateless by default.
* [`concat`](http://reactivex.io/documentation/operators/concat.html)
* [`reduce` / `aggregate`](http://reactivex.io/documentation/operators/reduce.html)
* [`toArray`](http://reactivex.io/documentation/operators/to.html)
#### Connectable Observable Operators
@ -74,7 +92,7 @@ Operators are stateless by default.
* [`publish`](http://reactivex.io/documentation/operators/publish.html)
* [`refCount`](http://reactivex.io/documentation/operators/refcount.html)
* [`replay`](http://reactivex.io/documentation/operators/replay.html)
* variable / sharedWithCachedLastResult
* [`shareReplay`](http://reactivex.io/documentation/operators/replay.html)
Creating new operators is also pretty straightforward.
@ -84,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
@ -100,18 +118,20 @@ extension NSObject {
```swift
extension NSObject {
extension Reactive where Base: NSObject {
public func rx_observe<Element>(
keyPath: String,
public func observe<Element>(
type: E.Type,
_ keyPath: String,
options: NSKeyValueObservingOptions = .New | .Initial,
retainSelf: Bool = true
) -> Observable<Element?> {}
#if !DISABLE_SWIZZLING
public func rx_observeWeakly<Element>(
keyPath: String,
public func observeWeakly<Element>(
type: E.Type,
_ keyPath: String,
options: NSKeyValueObservingOptions = .New | .Initial
) -> Observable<Element?> {}
@ -120,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> {}
}
```
@ -150,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> {}
}
```
@ -191,260 +211,281 @@ extension CLLocationManager {
```swift
extension UIControl {
extension Reactive where Base: UIControl {
public func rx_controlEvents(controlEvents: UIControlEvents) -> Observable<Void> { }
public func rx_subscribeEnabledTo(source: Observable<Bool>) -> Disposable {}
public func controlEvent(controlEvents: UIControlEvents) -> ControlEvent<Void> {}
public var enabled: ObserverOf<Bool> {}
}
```
```swift
extension UIButton {
extension Reactive where Base: UIButton {
public var rx_tap: Observable<Void> {}
public var tap: ControlEvent<Void> {}
}
```
```swift
extension UITextField {
extension Reactive where Base: UITextField {
public var rx_text: Observable<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: Observable<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: Observable<String> {}
public var searchText: ControlProperty<String> {}
}
```
```swift
extension UILabel {
extension Reactive where Base: UILabel {
public func rx_subscribeTextTo(source: Observable<String>) -> Disposable {}
public var text: ObserverOf<String> {}
}
```
```swift
extension UIDatePicker {
extension Reactive where Base: UIDatePicker {
public var rx_date: Observable<NSDate> {}
public var date: ControlProperty<NSDate> {}
}
```
```swift
extension UIImageView {
extension Reactive where Base: UIImageView {
public func rx_subscribeImageTo(source: Observable<UIImage?>) -> Disposable {}
public var image: ObserverOf<UIImage!> {}
public func rx_subscribeImageTo
(animated: Bool)
(source: Observable<UIImage?>)
-> Disposable {}
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: Observable<CGPoint> {}
public var contentOffset: ControlProperty<CGPoint> {}
}
```
```swift
extension UIBarButtonItem {
extension Reactive where Base: UIBarButtonItem {
public var rx_tap: Observable<Void> {}
public var tap: ControlEvent<Void> {}
}
```
```swift
extension UISlider {
extension Reactive where Base: UISlider {
public var rx_value: Observable<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_subscribeWithReactiveDataSource<DataSource: protocol<RxTableViewDataSourceType, UITableViewDataSource>>(dataSource: DataSource)
-> Observable<DataSource.Element> -> Disposable {}
public func itemsWithCellFactory(source: O)(cellFactory: (UITableView, Int, S.Iterator.Element) -> UITableViewCell) -> Disposable {}
public func rx_subscribeItemsTo<Item>(cellFactory: (UITableView, Int, Item) -> UITableViewCell)
-> Observable<[Item]> -> Disposable {}
public func itemsWithCellIdentifier(cellIdentifier: String, cellType: Cell.Type = Cell.self)(source: O)(configureCell: (Int, S.Iterator.Element, Cell) -> Void) -> Disposable {}
public func rx_subscribeItemsToWithCellIdentifier<Item, Cell: UITableViewCell>(cellIdentifier: String, configureCell: (NSIndexPath, Item, Cell) -> Void)
-> Observable<[Item]> -> Disposable {}
public func itemsWithDataSource(dataSource: DataSource)(source: O) -> Disposable {}
public var rx_itemSelected: Observable<NSIndexPath> {}
public var itemSelected: ControlEvent<IndexPath> {}
public var rx_itemInserted: Observable<NSIndexPath> {}
public var itemDeselected: ControlEvent<IndexPath> {}
public var rx_itemDeleted: Observable<NSIndexPath> {}
public var itemInserted: ControlEvent<IndexPath> {}
public var rx_itemMoved: Observable<ItemMovedEvent> {}
public var itemDeleted: ControlEvent<IndexPath> {}
// This method only works in case one of the `rx_subscribeItemsTo` methods was used.
public func rx_modelSelected<T>() -> Observable<T> {}
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 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 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_subscribeWithReactiveDataSource<DataSource: protocol<RxCollectionViewDataSourceType, UICollectionViewDataSource>>(dataSource: DataSource)
-> Observable<DataSource.Element> -> Disposable {}
public func itemsWithCellFactory(source: O)(cellFactory: (UICollectionView, Int, S.Iterator.Element) -> UICollectionViewCell) -> Disposable {}
public func rx_subscribeItemsTo<Item>(cellFactory: (UICollectionView, Int, Item) -> UICollectionViewCell)
-> Observable<[Item]> -> Disposable {}
public func itemsWithCellIdentifier(cellIdentifier: String, cellType: Cell.Type = Cell.self)(source: O)(configureCell: (Int, S.Iterator.Element, Cell) -> Void) -> Disposable {}
public func rx_subscribeItemsToWithCellIdentifier<Item, Cell: UICollectionViewCell>(cellIdentifier: String, configureCell: (Int, Item, Cell) -> Void)
-> Observable<[Item]> -> Disposable {}
public func itemsWithDataSource(dataSource: DataSource)(source: O) -> Disposable {}
public var rx_itemSelected: Observable<NSIndexPath> {}
public var itemSelected: ControlEvent<IndexPath> {}
// This method only works in case one of the `rx_subscribeItemsTo` methods was used.
public func rx_modelSelected<T>() -> Observable<T> {}
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 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: Observable<UIGestureRecognizer> {}
public var event: ControlEvent<UIGestureRecognizer> {}
}
```
```swift
extension UIActionSheet {
extension Reactive where Base: UIImagePickerController {
public var rx_delegate: DelegateProxy {}
public var didFinishPickingMediaWithInfo: Observable<[String : AnyObject]> {}
public var rx_clickedButtonAtIndex: Observable<Int> {}
public var rx_willDismissWithButtonIndex: Observable<Int> {}
public var rx_didDismissWithButtonIndex: Observable<Int> {}
}
```
```swift
extension UIAlertView {
public var rx_delegate: DelegateProxy {}
public var rx_clickedButtonAtIndex: Observable<Int> {}
public var rx_willDismissWithButtonIndex: Observable<Int> {}
public var rx_didDismissWithButtonIndex: Observable<Int> {}
public var didCancel: Observable<()> {}
}
```
```swift
extension UISegmentedControl {
extension Reactive where Base: UISegmentedControl {
public var rx_value: Observable<Int> {}
public var value: ControlProperty<Int> {}
}
```
```swift
extension UISwitch {
extension Reactive where Base: UISwitch {
public var rx_value: Observable<Bool> {}
public var value: ControlProperty<Bool> {}
}
```
```swift
extension Reactive where Base: UIActivityIndicatorView {
public var animating: AnyObserver<Bool> {}
}
```
```swift
extension Reactive where Base: UINavigationItem {
public var title: AnyObserver<String?> {}
}
```
**OSX**
```swift
extension NSControl {
extension Reactive where Base: NSControl {
public var rx_controlEvents: Observable<()> {}
public var controlEvent: ControlEvent<()> {}
public var enabled: AnyObserver<Bool> {}
}
```
```swift
extension NSSlider {
extension Reactive where Base: NSSlider {
public var rx_value: Observable<Double> {}
public var value: ControlProperty<Double> {}
}
```
```swift
extension NSButton {
extension Reactive where Base: NSButton {
public var rx_tap: Observable<Void> {}
public var tap: ControlEvent<Void> {}
public var state: ControlProperty<Int> {}
}
```
```swift
extension NSImageView {
extension Reactive where Base: NSImageView {
public func rx_subscribeImageTo(source: Observable<NSImage?>) -> Disposable {}
public var image: ObserverOf<NSImage?> {}
public func rx_subscribeImageTo
(animated: Bool)
(source: Observable<NSImage?>) -> Disposable {}
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: Observable<String> {}
public var text: ControlProperty<String> {}
}
```
```swift
extension Reactive where Base: UITabBarItem {
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)> {}
public func rx_subscribeTextTo(source: Observable<String>) -> Disposable {}
}
```

View File

@ -0,0 +1,19 @@
## Comparison with ReactiveCocoa
RxSwift is somewhat similar to ReactiveCocoa since ReactiveCocoa borrows a large number of concepts from Rx.
One of the main goals of this project was to create a significantly simpler interface that is more aligned with other Rx implementations, offers a richer concurrency model, offers more optimization opportunities and is more aligned with built-in Swift error handling mechanisms.
We've also decided to only rely on the Swift/llvm compiler and not introduce any external dependencies.
Probably the main difference between these projects is in their approach in building abstractions.
The main goal of RxSwift project is to provide environment agnostic compositional computation glue abstracted in the form of observable sequences.
We then aim to improve the experience of using RxSwift on specific platforms. To do this, RxCocoa uses generic computations to build more practical abstractions and wrap Foundation/Cocoa/UKit frameworks. That means that other libraries give context and semantics to the generic computation engine RxSwift provides such as `Driver`, `ControlProperty`, `ControlEvent`s and more.
One of the benefits to representing all of these abstractions as a single concept - _observable sequences_ - is that all computation abstractions built on top of them are also composable in the same fundamental way. They all follow the same contract and implement the same interface.
It is also easy to create flexible subscription (resource) sharing strategies or use one of the built-in ones: `share`, `shareReplay`, `publish`, `multicast`, `shareReplayLatestWhileConnected`...
This library also offers a fine-tunable concurrency model. If concurrent schedulers are used, observable sequence operators will preserve sequence properties. The same observable sequence operators will also know how to detect and optimally use known serial schedulers. ReactiveCocoa has a more limited concurrency model and only allows serial schedulers.
Multithreaded programming is really hard and detecting non trivial loops is even harder. That's why all operators are built in a fault tolerant way. Even if element generation occurs during element processing (recursion), operators will try to handle that situation and prevent deadlocks. This means that in the worst possible case programming error will cause stack overflow, but users won't have to manually kill the app, and you will get a crash report in error reporting systems so you can find and fix the problem.

View File

@ -11,29 +11,29 @@ enum Event<Element> {
}
```
Let's discuss pros and cons of `ErrorType` being generic.
Let's discuss the pros and cons of `ErrorType` being generic.
If you have generic error type you create additional impedance mismatch between two observables.
If you have a generic error type, you create additional impedance mismatch between two observables.
Let's say you have:
`Observable<String, E1>` and `Observable<String, E2>`
There isn't much you can do with them without figuring out what will be the resulting error type.
There isn't much you can do with them without figuring out what the resulting error type will be.
Will it be `E1`, `E2` or some new `E3` maybe? So you need a new set of operators just to solve that impedance mismatch.
Will it be `E1`, `E2` or some new `E3` maybe? So, you would need a new set of operators just to solve that impedance mismatch.
This for sure hurts composition properties, and Rx really doesn't care about why sequence fails, it just usually forwards failure further down the observable chain.
This hurts composition properties, and Rx isn't concerned with why a sequence fails, it just usually forwards failures further down the observable chain.
There is additional problem that maybe in some cases operators will fail for some internal error, and in that case you won't be able to construct resulting error and report failure.
There is an additional problem that, in some cases, operators might fail due to some internal error, in which case you wouldn't be able to construct a resulting error and report failure.
But ok, let's ignore that and assume we can use that to model sequences that don't error out. It looks like it could be useful for that purpose?
But OK, let's ignore that and assume we can use that to model sequences that don't error out. Could it be useful for that purpose?
Well yes, it potentially could be, but lets consider why would you want to use sequences that don't error out.
Well yes, it potentially could be, but let's consider why you would want to use sequences that don't error out.
One obvious application would be for permanent streams in UI layer that drive entire UI. But when you consider that case, it's not really only sufficient to use compiler to prove that sequences don't error out, you also need to prove other properties. Like that elements are observed on `MainScheduler`.
One obvious application would be for permanent streams in the UI layer that drive the entire UI. When you consider that case, it's not really sufficient to only use the compiler to prove that sequences don't error out, you also need to prove other properties. For instance, that elements are observed on `MainScheduler`.
What you really need is a generic way to prove traits for sequences (`Observables`). And you could be interested in a lot of properties. For example:
What you really need is a generic way to prove traits for observable sequences. There are a lot of properties you could be interested in. For example:
* sequence terminates in finite time (server side)
* sequence contains only one element (if you are running some computation)
@ -41,155 +41,19 @@ What you really need is a generic way to prove traits for sequences (`Observable
* sequence doesn't error out, never terminates and elements are delivered on main scheduler, and has refcounted sharing (UI)
* sequence doesn't error out, never terminates and elements are delivered on specific background scheduler (audio engine)
What you really want is a general compiler enforced system of traits for observable sequences, and a set of invariant operators for those wanted properties.
What you really want is a general compiler-enforced system of traits for observable sequences, and a set of invariant operators for those wanted properties.
A good analogy IMHO would be
A good analogy would be:
```
1, 3.14, e, 2.79, 1 + 1i <-> Observable<E>
1m/s, 1T, 5kg, 1.3 pounds <-> Errorless observable, UI observable, Finite observable ...
```
There are many ways how to do that in Swift by either using composition or inheritance of observables.
There are many ways to do such a thing in Swift by either using composition or inheritance of observables.
Additional benefit of using unit system is that you can prove that UI code is executing on same scheduler and thus use lockless operators for all transformations.
An additional benefit of using a unit system is that you can prove that UI code is executing on the same scheduler and thus use lockless operators for all transformations.
Since Rx already doesn't have locks for single sequence operations, and all of the remaining locks are in statefull components (aka UI), that would practically remove all of the remaining locks out of Rx code and create compiler enforced lockless Rx code.
Since RxSwift already doesn't have locks for single sequence operations, and all of the locks that do exist are in stateful components (e.g. UI), there are practically no locks in RxSwift code, which allows for such details to be compiler enforced.
So IMHO, there really is no benefit of using typed Errors that couldn't be achieved cleaner in other ways while preserving Rx compositional semantics. And other ways also have huge other benefits.
## Pipe operator
This is the definition of `>-` operator.
```swift
func >- <In, Out>(lhs: In, rhs: In -> Out) -> Out {
return rhs(lhs)
}
```
This enables us to write
```swift
a >- map { $0 * 2 } >- filter { $0 > 0 }
```
instead of
```swift
a.map { $0 * 2 }.filter { $0 > 0 }
```
This is another explanation:
```swift
a >- b >- c is equivalent to c(b(a))
```
So why was this introduced and not just use "." and extensions? Short answer is that Swift extensions weren't powerful enough, but there are other reasons as well.
Next version of RxSwift for Swift 2.0 will probably also include extensions that will enable the use of
`.`.
">-" also enables us to chain results easily. For example, if using protocol extensions typical example would look like this.
```swift
disposeBag.addDisposable(
observable
.map { n in
n * 2
}
.subscribeNext { n in
print(n)
}
)
```
This code could be written more elegantly using `>-` operator.
```swift
observable
>- map { n in
n * 2
}
>- subscribeNext { n in
print(n)
}
>- disposeBag.addDisposable
```
None of the Rx public interfaces depend on the >- operator.
It was actually introduced quite late and you can use Rx operators (map, filter ...) without it.
### Replacing `>-` with your own operator
If you dislike `>-` operator and want to use `|>` or `~>` operators, just define them in your project in this form:
```swift
infix operator |> { associativity left precedence 91 }
public func |> <In, Out>(source: In, @noescape transform: In -> Out) -> Out {
return transform(source)
}
```
or
```swift
infix operator ~> { associativity left precedence 91 }
public func ~> <In, Out>(source: In, @noescape transform: In -> Out) -> Out {
return transform(source)
}
```
and you can use them instead of `>-` operator.
```swift
let a /*: Observable<Int>*/ = Variable(1)
let b /*: Observable<Int>*/ = Variable(2)
combineLatest(a, b) { $0 + $1 }
|> filter { $0 >= 0 }
|> map { "\($0) is positive" }
|> subscribeNext { println($0) }
```
```swift
let a /*: Observable<Int>*/ = Variable(1)
let b /*: Observable<Int>*/ = Variable(2)
combineLatest(a, b) { $0 + $1 }
~> filter { $0 >= 0 }
~> map { "\($0) is positive" }
~> subscribeNext { println($0) }
```
### Why wasn't standard function application operator used?
I've first tried to find a similar operator in swift core libraries, but couldn't find it. That meant that I'll need to define something myself or find some third party library that contains reference function application operator definition and use it.
Otherwise all of the example code would be unreadable.
### Why wasn't some standard library used for that operator?
Well, I'm not sure there is a clear consensus in the community about funtion application operators or libraries that define them.
### Why wasn't function application operator defined only for `Observables` and `Disposables`?
One of the solutions could have been to provide a specialized operator that just works for `Observables` and `Disposables`.
In that case, if an identically named general purpose function application operator is defined somewhere else, there would still be collision, priority or ambiguity problems.
### Why wasn't some more standard operator like `|>` or `~>` used?
`|>` or `~>` are probably more commonly used operators in swift, so if there was another definition for them in Rx as general purpose function application operators, there is a high probability they would collide with definitions in other frameworks or project.
The simplest and safest solution IMHO was to create some new operator that made sense in this context and there is a low probability anyone else uses it.
In case the operator naming choice was wrong, name is rare and community eventually reaches consensus on the matter, it's more easier to find and replace it in user projects.
### Rationale why `>-` was chosen
* It's short, only two characters
* It looks like a sink to the right, which is a function it actually performs, so it's intuitive.
* It doesn't create a lot of visual noise. `|>` compared to `>-` IMHO looks a lot more intrusive. When my visual cortex parses `|>` it creates an illusion of a filled triangle, and when it parses `>-`, it sees three lines that don't cover any surface area, but are easily recognizable. Of course, that experience can be different for other people, but since I really wanted to create something that's pleasurable for me to use, that's a good argument. I'm just hoping that other people have the same experience.
* In the worst case scenario, if this operator is awkward to somebody, they can easily replace it using instructions above.
There really is no benefit to using typed Errors that couldn't be achieved in other cleaner ways while preserving Rx compositional semantics.

View File

@ -0,0 +1,13 @@
## RxExamples
To run the example app:
* Open `Rx.xcworkspace`
* Choose one of example schemes (RxExample-iOS, RxExample-OSX) and hit `Run`.
You can also run the example app using CocoaPods.
```
pod try RxSwift
```

View File

@ -1,100 +1,90 @@
Examples
========
[Definition of `>-` operator is here](DesignRationale.md#pipe-operator)
1. [Calculated variable](#calculated-variable)
1. [Simple UI bindings](#simple-ui-bindings)
1. [Autocomplete](#autocomplete)
1. [more examples](../RxExample)
1. [Playgrounds](../Playgrounds)
1. [Playgrounds](Playgrounds.md)
## Calculated variable
Let's first start with some imperative swift code.
The purpose of example is to bind identifier `c` to a value calculated from `a` and `b` if some condition is satisfied.
First, let's start with some imperative code.
The purpose of this example is to bind the identifier `c` to a value calculated from `a` and `b` if some condition is satisfied.
Here is the imperative swift code that calculates the value of `c`:
Here is the imperative code that calculates the value of `c`:
```swift
// this is usual imperative code
// this is standard imperative code
var c: String
var a = 1 // this will only assign value `1` to `a` once
var b = 2 // this will only assign value `2` to `b` once
var a = 1 // this will only assign the value `1` to `a` once
var b = 2 // this will only assign the value `2` to `b` once
if a + b >= 0 {
c = "\(a + b) is positive" // this will only assign value to `c` once
c = "\(a + b) is positive" // this will only assign the value to `c` once
}
```
The value of `c` is now `3 is positive`. But if we change the value of `a` to `4`, `c` will still contain the old value.
The value of `c` is now `3 is positive`. However, if we change the value of `a` to `4`, `c` will still contain the old value.
```swift
a = 4 // c will still be equal "3 is positive" which is not good
// c should be equal to "6 is positive" because 4 + 2 = 6
a = 4 // `c` will still be equal to "3 is positive" which is not good
// we want `c` to be equal to "6 is positive" since 4 + 2 = 6
```
This is not the wanted behavior.
This is not the desired behavior.
To integrate RxSwift framework into your project just include framework in your project and write `import RxSwit`.
This is the same logic using RxSwift.
This is the improved logic using RxSwift:
```swift
let a /*: Observable<Int>*/ = Variable(1) // a = 1
let b /*: Observable<Int>*/ = Variable(2) // b = 2
// This will "bind" rx variable `c` to definition
// if a + b >= 0 {
// c = "\(a + b) is positive"
// }
let c = combineLatest(a, b) { $0 + $1 } // combines latest values of variables `a` and `b` using `+`
>- filter { $0 >= 0 } // if `a + b >= 0` is true, `a + b` is passed to map operator
>- map { "\($0) is positive" } // maps `a + b` to "\(a + b) is positive"
// combines latest values of variables `a` and `b` using `+`
let c = Observable.combineLatest(a.asObservable(), b.asObservable()) { $0 + $1 }
.filter { $0 >= 0 } // if `a + b >= 0` is true, `a + b` is passed to the map operator
.map { "\($0) is positive" } // maps `a + b` to "\(a + b) is positive"
// Since initial values are a = 1, b = 2
// 1 + 2 = 3 which is >= 0, `c` is intially equal to "3 is positive"
// Since the initial values are a = 1 and b = 2
// 1 + 2 = 3 which is >= 0, so `c` is initially equal to "3 is positive"
// To pull values out of rx variable `c`, subscribe to values from `c`.
// `subscribeNext` means subscribe to next (fresh) values of variable `c`.
// That also includes the inital value "3 is positive".
c >- subscribeNext { println($0) } // prints: "3 is positive"
// To pull values out of the Rx `Observable` `c`, subscribe to values from `c`.
// `subscribe(onNext:)` means subscribe to the next (fresh) values of `c`.
// That also includes the initial value "3 is positive".
c.subscribe(onNext: { print($0) }) // prints: "3 is positive"
// Now let's increase the value of `a`
// a = 4 is in RxSwift
a.next(4) // prints: 6 is positive
// Sum of latest values is now `4 + 2`, `6` is >= 0, map operator
// produces "6 is positive" and that result is "assigned" to `c`.
// Since the value of `c` changed, `{ println($0) }` will get called,
// and "6 is positive" is printed.
// Now, let's increase the value of `a`
a.value = 4 // prints: 6 is positive
// The sum of the latest values, `4` and `2`, is now `6`.
// Since this is `>= 0`, the `map` operator produces "6 is positive"
// and that result is "assigned" to `c`.
// Since the value of `c` changed, `{ print($0) }` will get called,
// and "6 is positive" will be printed.
// Now let's change the value of `b`
// b = -8 is in RxSwift
b.next(-8) // doesn't print anything
// Sum of latest values is `4 + (-8)`, `-4` is not >= 0, map doesn't
// get executed.
// That means that `c` still contains "6 is positive" and that's correct.
// Since `c` hasn't been updated, that means next value hasn't been produced,
// and `{ println($0) }` won't be called.
// ...
// Now, let's change the value of `b`
b.value = -8 // doesn't print anything
// The sum of the latest values, `4 + (-8)`, is `-4`.
// Since this is not `>= 0`, `map` doesn't get executed.
// This means that `c` still contains "6 is positive"
// Since `c` hasn't been updated, a new "next" value hasn't been produced,
// and `{ print($0) }` won't be called.
```
## Simple UI bindings
* instead of binding to variables, let's bind to text field values (rx_text)
* next, parse that into an int and calculate if the number is prime using an async API (map)
* if text field value is changed before async call completes, new async call will be enqueued (concat)
* bind results to label (resultLabel.rx_subscribeTextTo)
* 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>
>- map { WolframAlphaIsPrime($0.toInt() ?? 0) } // type is Observable<Observable<Prime>>
>- concat // type is Observable<Prime>
>- map { "number \($0.n) is prime? \($0.isPrime)" } // type is Observable<String>
>- resultLabel.rx_subscribeTextTo // return Disposable that can be used to unbind everything
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
// This will set resultLabel.text to "number 43 is prime? true" after
// This will set `resultLabel.text` to "number 43 is prime? true" after
// server call completes.
primeTextField.text = "43"
@ -104,13 +94,13 @@ primeTextField.text = "43"
subscription.dispose()
```
All of the operators used in this example are the same operators used in the first example with variables. Nothing special about it.
All of the operators used in this example are the same operators used in the first example with variables. There's nothing special about it.
## Autocomplete
If you are new to Rx, next example will probably be a little overwhelming, but it's here to demonstrate how RxSwift code looks like in real world examples.
If you are new to Rx, the next example will probably be a little overwhelming at first. However, it's here to demonstrate how RxSwift code looks in the real-world.
The third example is a real world, complex UI async validation logic, with progress notifications.
This example contains complex async UI validation logic with progress notifications.
All operations are cancelled the moment `disposeBag` is deallocated.
Let's give it a shot.
@ -118,61 +108,63 @@ Let's give it a shot.
```swift
// bind UI control values directly
// use username from `usernameOutlet` as username values source
self.usernameOutlet.rx_text >- map { username in
self.usernameOutlet.rx.text
.map { username in
// synchronous validation, nothing special here
if count(username) == 0 {
// Convenience for constructing synchronous result.
// In case there is mixed synchronous and asychronous code inside the same
// method, this will construct an async result that is resolved immediatelly.
return returnElement((valid: false, message: "Username can't be empty."))
}
...
// Every user interface probably shows some state while async operation
// is executing.
// Let's assume that we want to show "Checking availability" while waiting for result.
// valid parameter can be
// * true - is valid
// * false - not valid
// * nil - validation pending
let loadingValue = (valid: nil, message: "Checking availability ...")
// This will fire a server call to check if the username already exists.
// Guess what, its type is `Observable<ValidationResult>`
return API.usernameAvailable(username) >- map { available in
if available {
return (true, "Username available")
}
else {
return (false, "Username already taken")
// synchronous validation, nothing special here
if username.isEmpty {
// Convenience for constructing synchronous result.
// In case there is mixed synchronous and asynchronous code inside the same
// method, this will construct an async result that is resolved immediately.
return Observable.just((valid: false, message: "Username can't be empty."))
}
// ...
// User interfaces should probably show some state while async operations
// are executing.
// Let's assume that we want to show "Checking availability" while waiting for a result.
// Valid parameters can be:
// * true - is valid
// * false - is not valid
// * nil - validation pending
typealias LoadingInfo = (valid: String?, message: String?)
let loadingValue : LoadingInfo = (valid: nil, message: "Checking availability ...")
// This will fire a server call to check if the username already exists.
// Its type is `Observable<ValidationResult>`
return API.usernameAvailable(username)
.map { available in
if available {
return (true, "Username available")
}
else {
return (false, "Username already taken")
}
}
// use `loadingValue` until server responds
.startWith(loadingValue)
}
// use `loadingValue` until server responds
>- startWith(loadingValue)
}
// Since we now have `Observable<Observable<ValidationResult>>`
// we somehow need to return to normal `Observable` world.
// We could use `concat` operator from second example, but we really
// want to cancel pending asynchronous operation if new username is
// provided.
// That's what `switchLatest` does
>- switchLatest
// we need to somehow return to a simple `Observable<ValidationResult>`.
// We could use the `concat` operator from the second example, but we really
// want to cancel pending asynchronous operations if a new username is provided.
// 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.
// This will produce a `Disposable` object that can unbind everything and cancel
// pending async operations.
>- subscribeNext { valid in
.subscribe(onNext: { valid in
errorLabel.textColor = validationColor(valid)
errorLabel.text = valid.message
}
// Why would we do it manually, that's tedious,
// let's dispose everything automagically on view controller dealloc.
>- disposeBag.addDisposable
})
// This will produce a `Disposable` object that can unbind everything and cancel
// pending async operations.
// Instead of doing it manually, which is tedious,
// let's dispose everything automagically upon view controller dealloc.
.addDisposableTo(disposeBag)
```
Can't get any simpler than this. There are [more examples](../RxExample) in the repository, so feel free to check them out.
It doesn't get any simpler than that. There are [more examples](../RxExample) in the repository, so feel free to check them out.
They include examples on how to use it in the context of MVVM pattern or without it.
They include examples on how to use Rx in the context of MVVM pattern or without it.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
## Build / Install / Run
Rx doesn't contain any external dependencies.
These are currently supported options:
### Manual
Open Rx.xcworkspace, choose `RxExample` and hit run. This method will build everything and run sample app
### [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 'RxBlocking', '~> 2.0'
pod 'RxTests', '~> 2.0'
end
```
replace `YOUR_TARGET_NAME`, then type in the `Podfile` directory:
```
$ pod install
```
### [Carthage](https://github.com/Carthage/Carthage)
**Xcode 7.1 required**
Add this to `Cartfile`
```
github "ReactiveX/RxSwift" ~> 2.0
```
```
$ carthage update
```
### Manually using git submodules
* Add RxSwift as a submodule
```
$ git submodule add git@github.com:ReactiveX/RxSwift.git
```
* Drag `Rx.xcodeproj` into Project Navigator
* Go to `Project > Targets > Build Phases > Link Binary With Libraries`, click `+` and select `RxSwift-[Platform]` and `RxCocoa-[Platform]` targets

31
Documentation/Linux.md Normal file
View File

@ -0,0 +1,31 @@
Linux
=====
We've made a proof of concept for Linux.
To test it, create `Package.swift` in your test directory with the following content:
```
import PackageDescription
let package = Package(
name: "MyShinyUnicornCat",
dependencies: [
.Package(url: "https://github.com/ReactiveX/RxSwift.git", Version(2, 0, 0))
]
)
```
What works:
* Distribution using Swift Package Manager
* Single Threaded mode (CurrentThreadScheduler)
* Half of the unit tests are passing.
* Projects that can be compiled and "used":
* RxSwift
* RxBlocking
* RxTests
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 `Swift.Error` on `Linux`, so don't use errors, otherwise you can get weird crashes.

View File

@ -3,19 +3,18 @@ Math Behind Rx
## Duality between Observer and Iterator / Enumerator / Generator / Sequences
There is a duality between observer and generator pattern. That's what enables transition from async callback world to synchronous world of sequence transformations.
There is a duality between the observer and generator patterns. This is what enables us to transition from the async callback world to the synchronous world of sequence transformations.
In short, enumerator and observer pattern both describe sequences. It's pretty obvious why does enumerator defined sequence, but what about observer.
In short, the enumerator and observer patterns both describe sequences. It's fairly obvious why the enumerator defines a sequence, but the observer is slightly more complicated.
There is also a pretty simple explanation that doesn't include a lot of math. Assume that you are observing mouse movements. Every received mouse movement is an element of a sequence of mouse movements over time.
There is, however, a pretty simple example that doesn't require a lot of mathematical knowledge. Assume that you are observing the position of your mouse cursor on screen at given times. Over time, these mouse positions form a sequence. This is, in essence, an observable sequence.
In short, there are two basic ways elements of a sequence can be accessed.
There are two basic ways elements of a sequence can be accessed:
* Push interface - Observer (observed elements over time make a sequence)
* Pull interface - Iterator / Enumerator / Generator
To learn more about this, these videos should help
You can also see a more formal explanation in this video:
You can also see a more formal explanation explained in a fun way in this video:
[Expert to Expert: Brian Beckman and Erik Meijer - Inside the .NET Reactive Framework (Rx) (video)](https://www.youtube.com/watch?v=looJcaeboBY)
* [Expert to Expert: Brian Beckman and Erik Meijer - Inside the .NET Reactive Framework (Rx) (video)](https://www.youtube.com/watch?v=looJcaeboBY)
* [Reactive Programming Overview (Jafar Husain from Netflix)](https://www.youtube.com/watch?v=dwP1TNXE6fc)

View File

@ -0,0 +1,26 @@
# Migration from RxSwift 1.9 to RxSwift 2.0
The migration should be pretty straightforward. Changes are mostly cosmetic, so all features are still there.
* Find replace all `>- ` to `.`
* Find replace all `variable` to `shareReplay(1)`
* Find replace all `catch` to `catchErrorJustReturn`
* Find replace all `returnElement` to `Observable.just`
* Find replace all `failWith` to `Observable.error`
* Find replace all `never` to `Observable.never`
* Find replace all `empty` to `Observable.empty`
* Since we've moved from `>-` to `.`, free functions are now methods, so use `.switchLatest()`, `.distinctUntilChanged()`, ... instead of `>- switchLatest`, `>- distinctUntilChanged`
* We've moved from free functions to extensions so it's now `[a, b, c].concat()`, `.merge()`, ... instead of `concat([a, b, c])`, `merge(sequences)`
* Similarly, it's now `subscribe { n in ... }.addDisposableTo(disposeBag)` instead of `>- disposeBag.addDisposable`
* The method `next` on `Variable` is now `value` setter
* If you want to use `UITableView` and/or `UICollectionView`, this is the basic use case now:
```swift
viewModel.rows
.bindTo(resultsTableView.rx_itemsWithCellIdentifier("WikipediaSearchCell", cellType: WikipediaSearchCell.self)) { (_, viewModel, cell) in
cell.viewModel = viewModel
}
.addDisposableTo(disposeBag)
```
If you have any doubts about how some concept in RxSwift 2.0 works, check out the [Example app](../RxExample) or playgrounds.

View File

@ -0,0 +1,20 @@
**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.**
```
*Short description of missing functionality*:
E.g. I want this library to implement xxx operator.
*Short code example of how you would like to use the API*:
code goes here
*The reason why I need this functionality*:
E.g. I was trying to ....
*Code I have right now*:
code snippet that demonstrates how you've attempted to solve the problem
```

View File

@ -0,0 +1,8 @@
## Playgrounds
To use playgrounds:
* Open `Rx.xcworkspace`
* Build the `RxSwift-OSX` scheme
* Open `Rx` playground in the `Rx.xcworkspace` tree view.
* Choose `View > Debug Area > Show Debug Area`

View File

@ -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
println("This is performed on background scheduler")
.observeOn(backgroundScheduler)
.map { n in
print("This is performed on the background scheduler")
}
>- observeOn(MainScheduler.sharedInstance)
>- map { n in
println("This is performed on main scheduler")
.observeOn(MainScheduler.instance)
.map { n in
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)`.
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,12 +63,12 @@ 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 {
typealias TimeInterval
typealias Time
associatedtype TimeInterval
associatedtype Time
var now : Time {
get
@ -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,36 +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 a "trampoline scheduler".
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 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 peformed on a specific `dispatch_queue_t`. You can also pass a serial dispatch queue, it shouldn't cause any problems.
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 peformed on a specific `NSOperationQueue`.
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`.

50
Documentation/Tips.md Normal file
View File

@ -0,0 +1,50 @@
Tips
====
* Always strive to model your systems or their parts as pure functions. Those pure functions can be tested easily and can be used to modify operator behaviors.
* When you are using Rx, first try to compose built-in operators.
* If using some combination of operators often, create your convenience operators.
e.g.
```swift
extension ObservableType where E: MaybeCool {
@warn_unused_result(message="http://git.io/rxs.uo")
public func coolElements()
-> Observable<E> {
return filter { e -> Bool in
return e.isCool
}
}
}
```
* Rx operators are as general as possible, but there will always be edge cases that will be hard to model. In those cases you can just create your own operator and possibly use one of the built-in operators as a reference.
* Always use operators to compose subscriptions.
**Avoid nesting subscribe calls at all cost. This is a code smell.**
```swift
textField.rx_text.subscribeNext { text in
performURLRequest(text).subscribeNext { result in
...
}
.addDisposableTo(disposeBag)
}
.addDisposableTo(disposeBag)
```
**Preferred way of chaining disposables by using operators.**
```swift
textField.rx_text
.flatMapLatest { text in
// Assuming this doesn't fail and returns result on main scheduler,
// otherwise `catchError` and `observeOn(MainScheduler.instance)` can be used to
// correct this.
return performURLRequest(text)
}
...
.addDisposableTo(disposeBag) // only one top most disposable
```

View File

@ -0,0 +1,97 @@
Unit Tests
==========
## Testing custom operators
RxSwift uses `RxTests` for all operator tests, located in the AllTests-* target inside the project `Rx.xcworkspace`.
This is an example of a typical `RxSwift` operator unit test:
```swift
func testMap_Range() {
// Initializes test scheduler.
// Test scheduler implements virtual time that is
// detached from local machine clock.
// This enables running the simulation as fast as possible
// and proving that all events have been handled.
let scheduler = TestScheduler(initialClock: 0)
// Creates a mock hot observable sequence.
// The sequence will emit events at desginated
// times, no matter if there are observers subscribed or not.
// (that's what hot means).
// This observable sequence will also record all subscriptions
// made during its lifetime (`subscriptions` property).
let xs = scheduler.createHotObservable([
next(150, 1), // first argument is virtual time, second argument is element value
next(210, 0),
next(220, 1),
next(230, 2),
next(240, 4),
completed(300) // virtual time when completed is sent
])
// `start` method will by default:
// * Run the simulation and record all events
// using observer referenced by `res`.
// * Subscribe at virtual time 200
// * Dispose subscription at virtual time 1000
let res = scheduler.start { xs.map { $0 * 2 } }
let correctMessages = [
next(210, 0 * 2),
next(220, 1 * 2),
next(230, 2 * 2),
next(240, 4 * 2),
completed(300)
]
let correctSubscriptions = [
Subscription(200, 300)
]
XCTAssertEqual(res.events, correctMessages)
XCTAssertEqual(xs.subscriptions, correctSubscriptions)
}
```
## Testing operator compositions (view models, components)
Examples of how to test operator compositions are contained inside `Rx.xcworkspace` > `RxExample-iOSTests` target.
It's easy to define `RxTests` extensions so you can write your tests in a readable way. Provided examples inside `RxExample-iOSTests` are just suggestions on how you can write those extensions, but there are a lot of possibilities on how to write those tests.
```swift
// expected events and test data
let (
usernameEvents,
passwordEvents,
repeatedPasswordEvents,
loginTapEvents,
expectedValidatedUsernameEvents,
expectedSignupEnabledEvents
) = (
scheduler.parseEventsAndTimes("e---u1----u2-----u3-----------------", values: stringValues).first!,
scheduler.parseEventsAndTimes("e----------------------p1-----------", values: stringValues).first!,
scheduler.parseEventsAndTimes("e---------------------------p2---p1-", values: stringValues).first!,
scheduler.parseEventsAndTimes("------------------------------------", values: events).first!,
scheduler.parseEventsAndTimes("e---v--f--v--f---v--o----------------", values: validations).first!,
scheduler.parseEventsAndTimes("f--------------------------------t---", values: booleans).first!
)
```
## Integration tests
It is also possible to write integration tests by using `RxBlocking` operators.
Importing operators from `RxBlocking` library will enable blocking the current thread and wait for sequence results.
```swift
let result = try fetchResource(location)
.toBlocking()
.toArray()
XCTAssertEqual(result, expectedResult)
```

279
Documentation/Units.md Normal file
View File

@ -0,0 +1,279 @@
Units
=====
This document will try to describe what units are, why they are a useful concept, and how to use and create them.
* [Why](#why)
* [How they work](#how-they-work)
* [Why they are named Units](#why-they-are-named-units)
* [RxCocoa units](#rxcocoa-units)
* [Driver unit](#driver-unit)
* [Why it's named Driver](#why-its-named-driver)
* [Practical usage example](#practical-usage-example)
## Why
Swift has a powerful type system that can be used to improve correctness and stability of applications and make using Rx a more intuitive and straightforward experience.
**Units are specific only to the [RxCocoa](https://github.com/ReactiveX/RxSwift/tree/master/RxCocoa) project. However, the same principles could easily be implemented in other Rx implementations, if necessary. There is no private API magic needed.**
**Units are totally optional. You can use raw observable sequences everywhere in your program and all RxCocoa APIs work with observable sequences.**
Units also help communicate and ensure observable sequence properties across interface boundaries.
Here are some of the properties that are important when writing Cocoa/UIKit applications.
* Can't error out
* Observe on main scheduler
* Subscribe on main scheduler
* Sharing side effects
## How they work
At its core, it's just a struct with a reference to observable sequence.
You can think of them as a kind of builder pattern for observable sequences. When a sequence is built, calling `.asObservable()` will transform a unit into a vanilla observable sequence.
## Why they are named Units
Using a couple analogies will help us reason about unfamiliar concepts. Here are some analogies showing how units in physics and RxCocoa (Rx units) are similar.
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, ...) |
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.
Numbers are the basic compositional glue when working with physical units: usually real or complex numbers.<br/>
Observable sequences are the basic compositional glue when working with Rx units.
Physical units and [dimensional analysis](https://en.wikipedia.org/wiki/Dimensional_analysis#Checking_equations_that_involve_dimensions) can alleviate certain classes of errors during complex calculations.<br/>
Type checking Rx units can alleviate certain classes of logic errors when writing reactive programs.
Numbers have operators: `+`, `-`, `*`, `/`.<br/>
Observable sequences also have operators: `map`, `filter`, `flatMap` ...
Physics units define operations by using corresponding number operations. E.g.
`/` operation on physical units is defined using `/` operation on numbers.
11 m / 0.5 s = ...
* First, convert the unit to **numbers** and **apply** `/` **operator** `11 / 0.5 = 22`
* Then, calculate the unit (m / s)
* Lastly, combine the result = 22 m / s
Rx units define operations by using corresponding observable sequence operations (this is how operators work internally). E.g.
The `map` operation on `Driver` is defined using the `map` operation on its observable sequence.
```swift
let d: Driver<Int> = Driver.just(11)
driver.map { $0 / 0.5 } = ...
```
* First, convert `Driver` to **observable sequence** and **apply** `map` **operator**
```swift
let mapped = driver.asObservable().map { $0 / 0.5 } // this `map` is defined on observable sequence
```
* Then, combine that to get the unit value
```swift
let result = Driver(mapped)
```
There is a set of basic units in physics [(`m`, `kg`, `s`, `A`, `K`, `cd`, `mol`)](https://en.wikipedia.org/wiki/SI_base_unit) that is orthogonal.<br/>
There is a set of basic interesting properties for observable sequences in `RxCocoa` that is orthogonal.
* Can't error out
* Observe on main scheduler
* Subscribe on main scheduler
* Sharing side effects
Derived units in physics sometimes have special names.<br/>
E.g.
```
N (Newton) = kg * m / s / s
C (Coulomb) = A * s
T (Tesla) = kg / A / s / s
```
Rx derived units also have special names.<br/>
E.g.
```
Driver = (can't error out) * (observe on main scheduler) * (sharing side effects)
ControlProperty = (sharing side effects) * (subscribe on main scheduler)
```
Conversion between different units in physics is done with the help of operators defined on numbers `*`, `/`.<br/>
Conversion between different Rx units in done with the help of observable sequence operators.
E.g.
```
Can't error out = catchError
Observe on main scheduler = observeOn(MainScheduler.instance)
Subscribe on main scheduler = subscribeOn(MainScheduler.instance)
Sharing side effects = share* (one of the `share` operators)
```
## RxCocoa units
### Driver unit
* Can't error out
* Observe on main scheduler
* Sharing side effects (`shareReplayLatestWhileConnected`)
### ControlProperty / ControlEvent
* Can't error out
* Subscribe on main scheduler
* Observe on main scheduler
* 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.
### Why it's named Driver
Its intended use case was to model sequences that drive your application.
E.g.
* Drive UI from CoreData model
* Drive UI using values from other UI elements (bindings)
...
Like normal operating system drivers, in case a sequence errors out, your application will stop responding to user input.
It is also extremely important that those elements are observed on the main thread because UI elements and application logic are usually not thread safe.
Also, `Driver` unit builds an observable sequence that shares side effects.
E.g.
### Practical usage example
This is a typical beginner example.
```swift
let results = query.rx.text
.throttle(0.3, scheduler: MainScheduler.instance)
.flatMapLatest { query in
fetchAutoCompleteItems(query)
}
results
.map { "\($0.count)" }
.bindTo(resultCount.rx.text)
.addDisposableTo(disposeBag)
results
.bindTo(resultsTableView.rx.itemsWithCellIdentifier("Cell")) { (_, result, cell) in
cell.textLabel?.text = "\(result)"
}
.addDisposableTo(disposeBag)
```
The intended behavior of this code was to:
* Throttle user input
* Contact server and fetch a list of user results (once per query)
* Bind the results to two UI elements: results table view and a label that displays the number of results
So, what are the problems with this code?:
* If the `fetchAutoCompleteItems` observable sequence errors out (connection failed or parsing error), this error would unbind everything and the UI wouldn't respond any more to new queries.
* If `fetchAutoCompleteItems` returns results on some background thread, results would be bound to UI elements from a background thread which could cause non-deterministic crashes.
* Results are bound to two UI elements, which means that for each user query, two HTTP requests would be made, one for each UI element, which is not the intended behavior.
A more appropriate version of the code would look like this:
```swift
let results = query.rx.text
.throttle(0.3, scheduler: MainScheduler.instance)
.flatMapLatest { query in
fetchAutoCompleteItems(query)
.observeOn(MainScheduler.instance) // results are returned on MainScheduler
.catchErrorJustReturn([]) // in the worst case, errors are handled
}
.shareReplay(1) // HTTP requests are shared and results replayed
// to all UI elements
results
.map { "\($0.count)" }
.bindTo(resultCount.rx.text)
.addDisposableTo(disposeBag)
results
.bindTo(resultTableView.rx.itemsWithCellIdentifier("Cell")) { (_, result, cell) in
cell.textLabel?.text = "\(result)"
}
.addDisposableTo(disposeBag)
```
Making sure all of these requirements are properly handled in large systems can be challenging, but there is a simpler way of using the compiler and units to prove these requirements are met.
The following code looks almost the same:
```swift
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)
.asDriver(onErrorJustReturn: []) // Builder just needs info about what to return in case of error.
}
results
.map { "\($0.count)" }
.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
cell.textLabel?.text = "\(result)"
}
.addDisposableTo(disposeBag)
```
So what is happening here?
This first `asDriver` method converts the `ControlProperty` unit to a `Driver` unit.
```swift
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.
The second change is:
```swift
.asDriver(onErrorJustReturn: [])
```
Any observable sequence can be converted to `Driver` unit, as long as it satisfies 3 properties:
* Can't error out
* Observe on main scheduler
* Sharing side effects (`shareReplayLatestWhileConnected`)
So how do you make sure those properties are satisfied? Just use normal Rx operators. `asDriver(onErrorJustReturn: [])` is equivalent to following code.
```
let safeSequence = xs
.observeOn(MainScheduler.instance) // observe events on main scheduler
.catchErrorJustReturn(onErrorJustReturn) // can't error out
.shareReplayLatestWhileConnected // side effects sharing
return Driver(raw: safeSequence) // wrap it up
```
The final piece is using `drive` instead of using `bindTo`.
`drive` is defined only on the `Driver` unit. This means that if you see `drive` somewhere in code, that observable sequence can never error out and it observes on the main thread, which is safe for binding to a UI element.
Note however that, theoretically, someone could still define a `drive` method to work on `ObservableType` or some other interface, so to be extra safe, creating a temporary definition with `let results: Driver<[Results]> = ...` before binding to UI elements would be necessary for complete proof. However, we'll leave it up to the reader to decide whether this is a realistic scenario or not.

122
Documentation/Warnings.md Normal file
View File

@ -0,0 +1,122 @@
Warnings
========
### <a name="unused-disposable"></a>Unused disposable (unused-disposable)
The following is valid for the `subscribe*`, `bind*` and `drive*` family of functions that return `Disposable`.
You will receive a warning for doing something such as this:
```Swift
let xs: Observable<E> ....
xs
.filter { ... }
.map { ... }
.switchLatest()
.subscribe(onNext: {
...
}, onError: {
...
})
```
The `subscribe` function returns a subscription `Disposable` that can be used to cancel computation and free resources. However, not using it (and thus not disposing it) will result in an error.
The preferred way of terminating these fluent calls is by using a `DisposeBag`, either through chaining a call to `.addDisposableTo(disposeBag)` or by adding the disposable directly to the bag.
```Swift
let xs: Observable<E> ....
let disposeBag = DisposeBag()
xs
.filter { ... }
.map { ... }
.switchLatest()
.subscribe(onNext: {
...
}, onError: {
...
})
.addDisposableTo(disposeBag) // <--- note `addDisposableTo`
```
When `disposeBag` gets deallocated, the disposables contained within it will be automatically disposed as well.
In the case where `xs` terminates in a predictable way with either a `Completed` or `Error` message, not handling the subscription `Disposable` won't leak any resources. However, even in this case, using a dispose bag is still the preferred way to handle subscription disposables. It ensures that element computation is always terminated at a predictable moment, and makes your code robust and future proof because resources will be properly disposed even if the implementation of `xs` changes.
Another way to make sure subscriptions and resources are tied to the lifetime of some object is by using the `takeUntil` operator.
```Swift
let xs: Observable<E> ....
let someObject: NSObject ...
_ = xs
.filter { ... }
.map { ... }
.switchLatest()
.takeUntil(someObject.deallocated) // <-- note the `takeUntil` operator
.subscribe(onNext: {
...
}, onError: {
...
})
```
If ignoring the subscription `Disposable` is the desired behavior, this is how to silence the compiler warning.
```Swift
let xs: Observable<E> ....
_ = xs // <-- note the underscore
.filter { ... }
.map { ... }
.switchLatest()
.subscribe(onNext: {
...
}, onError: {
...
})
```
### <a name="unused-observable"></a>Unused observable sequence (unused-observable)
You will receive a warning for doing something such as this:
```Swift
let xs: Observable<E> ....
xs
.filter { ... }
.map { ... }
```
This code defines an observable sequence that is filtered and mapped from the `xs` sequence but then ignores the result.
Since this code just defines an observable sequence and then ignores it, it doesn't actually do anything.
Your intention was probably to either store the observable sequence definition and use it later ...
```Swift
let xs: Observable<E> ....
let ys = xs // <--- names definition as `ys`
.filter { ... }
.map { ... }
```
... or start computation based on that definition
```Swift
let xs: Observable<E> ....
let disposeBag = DisposeBag()
xs
.filter { ... }
.map { ... }
.subscribe(onNext: { nextElement in // <-- note the `subscribe*` method
// use the element
print(nextElement)
})
.addDisposableTo(disposeBag)
```

296
Documentation/Why.md Normal file
View File

@ -0,0 +1,296 @@
## Why
**Rx enables building apps in a declarative way.**
### Bindings
```swift
Observable.combineLatest(firstName.rx_text, lastName.rx_text) { $0 + " " + $1 }
.map { "Greetings, \($0)" }
.bindTo(greetingLabel.rx_text)
```
This also works with `UITableView`s and `UICollectionView`s.
```swift
viewModel
.rows
.bindTo(resultsTableView.rx_itemsWithCellIdentifier("WikipediaSearchCell", cellType: WikipediaSearchCell.self)) { (_, viewModel, cell) in
cell.title = viewModel.title
cell.url = viewModel.url
}
.addDisposableTo(disposeBag)
```
**Official suggestion is to always use `.addDisposableTo(disposeBag)` even though that's not necessary for simple bindings.**
### Retries
It would be great if APIs wouldn't fail, but unfortunately they do. Let's say there is an API method:
```swift
func doSomethingIncredible(forWho: String) throws -> IncredibleThing
```
If you are using this function as it is, it's really hard to do retries in case it fails. Not to mention complexities modeling [exponential backoffs](https://en.wikipedia.org/wiki/Exponential_backoff). Sure it's possible, but the code would probably contain a lot of transient states that you really don't care about, and it wouldn't be reusable.
Ideally, you would want to capture the essence of retrying, and to be able to apply it to any operation.
This is how you can do simple retries with Rx
```swift
doSomethingIncredible("me")
.retry(3)
```
You can also easily create custom retry operators.
### Delegates
Instead of doing the tedious and non-expressive:
```swift
public func scrollViewDidScroll(scrollView: UIScrollView) { [weak self] // what scroll view is this bound to?
self?.leftPositionConstraint.constant = scrollView.contentOffset.x
}
```
... write
```swift
self.resultsTableView
.rx_contentOffset
.map { $0.x }
.bindTo(self.leftPositionConstraint.rx_constant)
```
### KVO
Instead of:
```
`TickTock` was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object.
```
and
```objc
-(void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
```
Use [`rx_observe` and `rx_observeWeakly`](GettingStarted.md#kvo)
This is how they can be used:
```swift
view.rx_observe(CGRect.self, "frame")
.subscribeNext { frame in
print("Got new frame \(frame)")
}
```
or
```swift
someSuspiciousViewController
.rx_observeWeakly(Bool.self, "behavingOk")
.subscribeNext { behavingOk in
print("Cats can purr? \(behavingOk)")
}
```
### Notifications
Instead of using:
```swift
@available(iOS 4.0, *)
public func addObserverForName(name: String?, object obj: AnyObject?, queue: NSOperationQueue?, usingBlock block: (NSNotification) -> Void) -> NSObjectProtocol
```
... just write
```swift
NSNotificationCenter.defaultCenter()
.rx_notification(UITextViewTextDidBeginEditingNotification, object: myTextView)
.map { /*do something with data*/ }
....
```
### Transient state
There are also a lot of problems with transient state when writing async programs. A typical example is an autocomplete search box.
If you were to write the autocomplete code without Rx, the first problem that probably needs to be solved is when `c` in `abc` is typed, and there is a pending request for `ab`, the pending request gets cancelled. OK, that shouldn't be too hard to solve, you just create an additional variable to hold reference to the pending request.
The next problem is if the request fails, you need to do that messy retry logic. But OK, a couple more fields that capture the number of retries that need to be cleaned up.
It would be great if the program would wait for some time before firing a request to the server. After all, we don't want to spam our servers in case somebody is in the process of typing something very long. An additional timer field maybe?
There is also a question of what needs to be shown on screen while that search is executing, and also what needs to be shown in case we fail even with all of the retries.
Writing all of this and properly testing it would be tedious. This is that same logic written with Rx.
```swift
searchTextField.rx_text
.throttle(0.3, scheduler: MainScheduler.instance)
.distinctUntilChanged()
.flatMapLatest { query in
API.getSearchResults(query)
.retry(3)
.startWith([]) // clears results on new search term
.catchErrorJustReturn([])
}
.subscribeNext { results in
// bind to ui
}
```
There are no additional flags or fields required. Rx takes care of all that transient mess.
### Compositional disposal
Let's assume that there is a scenario where you want to display blurred images in a table view. First, the images should be fetched from a URL, then decoded and then blurred.
It would also be nice if that entire process could be cancelled if a cell exits the visible table view area since bandwidth and processor time for blurring are expensive.
It would also be nice if we didn't just immediately start to fetch an image once the cell enters the visible area since, if user swipes really fast, there could be a lot of requests fired and cancelled.
It would be also nice if we could limit the number of concurrent image operations because, again, blurring images is an expensive operation.
This is how we can do it using Rx:
```swift
// this is a conceptual solution
let imageSubscription = imageURLs
.throttle(0.2, scheduler: MainScheduler.instance)
.flatMapLatest { imageURL in
API.fetchImage(imageURL)
}
.observeOn(operationScheduler)
.map { imageData in
return decodeAndBlurImage(imageData)
}
.observeOn(MainScheduler.instance)
.subscribeNext { blurredImage in
imageView.image = blurredImage
}
.addDisposableTo(reuseDisposeBag)
```
This code will do all that and, when `imageSubscription` is disposed, it will cancel all dependent async operations and make sure no rogue image is bound to the UI.
### Aggregating network requests
What if you need to fire two requests and aggregate results when they have both finished?
Well, there is of course the `zip` operator
```swift
let userRequest: Observable<User> = API.getUser("me")
let friendsRequest: Observable<Friends> = API.getFriends("me")
Observable.zip(userRequest, friendsRequest) { user, friends in
return (user, friends)
}
.subscribeNext { user, friends in
// bind them to the user interface
}
```
So what if those APIs return results on a background thread, and binding has to happen on the main UI thread? There is `observeOn`.
```swift
let userRequest: Observable<User> = API.getUser("me")
let friendsRequest: Observable<[Friend]> = API.getFriends("me")
Observable.zip(userRequest, friendsRequest) { user, friends in
return (user, friends)
}
.observeOn(MainScheduler.instance)
.subscribeNext { user, friends in
// bind them to the user interface
}
```
There are many more practical use cases where Rx really shines.
### State
Languages that allow mutation make it easy to access global state and mutate it. Uncontrolled mutations of shared global state can easily cause [combinatorial explosion] (https://en.wikipedia.org/wiki/Combinatorial_explosion#Computing).
But on the other hand, when used in a smart way, imperative languages can enable writing more efficient code closer to hardware.
The usual way to battle combinatorial explosion is to keep state as simple as possible, and use [unidirectional data flows](https://developer.apple.com/videos/play/wwdc2014-229) to model derived data.
This is where Rx really shines.
Rx is that sweet spot between functional and imperative worlds. It enables you to use immutable definitions and pure functions to process snapshots of mutable state in a reliable composable way.
So what are some practical examples?
### Easy integration
What if you need to create your own observable? It's pretty easy. This code is taken from RxCocoa and that's all you need to wrap HTTP requests with `NSURLSession`
```swift
extension NSURLSession {
public func rx_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))
return
}
guard let httpResponse = response as? NSHTTPURLResponse else {
observer.on(.Error(RxCocoaURLError.NonHTTPResponse(response: response)))
return
}
observer.on(.Next(data, httpResponse))
observer.on(.Completed)
}
task.resume()
return AnonymousDisposable {
task.cancel()
}
}
}
}
```
### Benefits
In short, using Rx will make your code:
* Composable <- Because Rx is composition's nickname
* Reusable <- Because it's composable
* Declarative <- Because definitions are immutable and only data changes
* Understandable and concise <- Raising the level of abstraction and removing transient states
* Stable <- Because Rx code is thoroughly unit tested
* Less stateful <- Because you are modeling applications as unidirectional data flows
* Without leaks <- Because resource management is easy
### It's not all or nothing
It is usually a good idea to model as much of your application as possible using Rx.
But what if you don't know all of the operators and whether or not there even exists some operator that models your particular case?
Well, all of the Rx operators are based on math and should be intuitive.
The good news is that about 10-15 operators cover most typical use cases. And that list already includes some of the familiar ones like `map`, `filter`, `zip`, `observeOn`, ...
There is a huge list of [all Rx operators](http://reactivex.io/documentation/operators.html) and list of all of the [currently supported RxSwift operators](API.md).
For each operator, there is a [marble diagram](http://reactivex.io/documentation/operators/retry.html) that helps to explain how it works.
But what if you need some operator that isn't on that list? Well, you can make your own operator.
What if creating that kind of operator is really hard for some reason, or you have some legacy stateful piece of code that you need to work with? Well, you've got yourself in a mess, but you can [jump out of Rx monads](GettingStarted.md#life-happens) easily, process the data, and return back into it.

3
Gemfile Normal file
View File

@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'danger'

34
Gemfile.lock Normal file
View File

@ -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

51
ISSUE_TEMPLATE.md Normal file
View File

@ -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

View File

@ -1,5 +1,5 @@
**The MIT License**
**Copyright (c) 2015 Krunoslav Zaher**
**Copyright © 2015 Krunoslav Zaher**
**All rights reserved.**
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

69
Package.swift Normal file
View File

@ -0,0 +1,69 @@
import PackageDescription
#if os(OSX)
let package = Package(
name: "RxSwift",
targets: [
Target(
name: "RxSwift"
),
Target(
name: "RxTests",
dependencies: [
.Target(name: "RxSwift")
]
),
Target(
name: "RxBlocking",
dependencies: [
.Target(name: "RxSwift")
]
),
Target(
name: "AllTests",
dependencies: [
.Target(name: "RxSwift"),
.Target(name: "RxBlocking"),
.Target(name: "RxTests")
]
)
],
exclude: [
"Sources/RxCocoa",
"Sources/RxTests",
"Sources/AllTests"
]
)
#elseif os(Linux)
let package = Package(
name: "RxSwift",
targets: [
Target(
name: "RxSwift"
),
Target(
name: "RxTests",
dependencies: [
.Target(name: "RxSwift")
]
),
Target(
name: "RxBlocking",
dependencies: [
.Target(name: "RxSwift")
]
),
Target(
name: "AllTests",
dependencies: [
.Target(name: "RxSwift"),
.Target(name: "RxBlocking"),
.Target(name: "RxTests")
]
)
],
exclude: [
"Sources/RxCocoa",
]
)
#endif

View File

@ -1,209 +0,0 @@
import Cocoa
import RxSwift
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Why use RxSwift?
A vast majority of the code we write revolves around responding to external actions. When a user manipulates a control, we need to write an @IBAction to respond to that. We need to observe Notifications to detect when the keyboard changes position. We must provide blocks to execute when URL Sessions respond with data. And we use KVO to detect changes in variables.
All of these various systems makes our code needlessly complex. Wouldn't it be better if there was one consistent system that handled all of our call/response code? Rx is such a system.
## Observables
The key to understanding RxSwift is in understanding the notion of Observables. Creating them, manipulating them, and subscribing to them in order to react to changes.
## Creating and Subscribing to Observables
The first step in understanding this library is in understanding how to create Observables. There are a number of functions available to make Observables.
Creating an Observable is one thing, but if nothing subscribes to the observable, then nothing will come of it so both are explained simultaneously.
*/
/*:
### empty
`empty` creates an observable that contains no objects. The only message it sends is the `.Completed` message.
*/
example("Empty observable") {
let emptyObservable: Observable<Int> = empty()
let emptySubscriber = emptyObservable >- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}
/*:
As you can see, no values are ever sent to the subscriber of an empty observable. It just completes and is done.
*/
/*:
### never
`never` creates an observable that contains no objects and never completes or errors out.
*/
example("Never observable") {
let neverObservable: Observable<String> = never()
let neverSubscriber = neverObservable >- subscribe { _ in
println("This block is never called.")
}
}
/*:
### returnElement/just
These two functions behave identically. They send two messages to subscribers. The first message is the value and the second message is `.Complete`.
*/
example("returnElement/just") {
let oneObservable = just(32)
let oneObservableSubscriber = oneObservable
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}
/*:
Here we see that the `.Next` event is sent just once, then the `.Completed` event is sent.
*/
/*:
### returnElements
Now we are getting to some more interesting ways to create an Observable. This function creates an observable that produces a number of values before completing.
*/
example("returnElements") {
let multipleObservable/* : Observable<Int> */ = returnElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
let multipleObservableSubscriber = multipleObservable
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}
/*:
With the above, you will see that the `.Next` event was sent ten times, once for each element. Then `.Complete` was sent.
*/
/*:
### from
We can also create an observable from any SequenceType, such as an array
*/
example("from") {
let fromArrayObservable = from([1, 2, 3, 4, 5])
let fromArrayObservableSubscriber = fromArrayObservable
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}
/*:
Now these functions are all well and good, but the really useful ones are in the RxCocoa library.
`rx_observe` exist on every NSObject and wraps KVO.
`rx_tap` exists on buttons and wraps @IBActions
`rx_notification` wraps NotificationCenter events
... and so on.
Take some time and search for code matching `-> Observable` in the RxCocoa framework to get a sense of how every action can be modeled as an observable. You can even create your own functions that make Observable objects.
## Subscribing
Up to this point, I have only used the `subscribe` method to listen to Observables, but there are several others.
*/
example("subscribeNext") {
let nextOnlySubscriber = returnElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
>- subscribeNext { value in
println("\(value)")
}
}
/*:
With the above we only interest ourselves in the values returned by the observable without regard to whether/when it completes or errors. Many of the observables that we use have an indefinite lifespan. There is also `subscribeCompleted` and `subscribeError` for when you are looking for when an observable will stop sending.
Also note that you can have multiple subscribers following to the same observable (as I did in the example above.) All the subscribers will be notified when an event occurs.
*/
/*:
## Reducing a sequence
Now that you understand how to create Observables and subscribe to them. Let's look at the various ways we can manipulate an observable sequence. First lets examine ways to reduce a sequence into fewer events.
### where/filter
The most common way to reduce a sequence is to apply a filter to it and the most generic of these is `where` or `filter`. You will see in the code below that the messages containing odd numbers are being removed so the subscriber wont see them.
*/
example("filter") {
let onlyEvensSubscriber = returnElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
>- filter {
$0 % 2 == 0
}
>- subscribeNext { value in
println("\(value)")
}
}
/*:
### distinctUntilChanged
This filter tracks the last value emitted and removes like values. This function is good for reducing noise in a sequence.
*/
example("distinctUntilChanged") {
let distinctUntilChangedSubscriber = returnElements(1, 2, 3, 1, 1, 4)
>- distinctUntilChanged
>- subscribeNext { value in
println("\(value)")
}
}
/*:
In the example above, the values 1, 2, 3, 1, 4 will be printed. The extra 1 will be filtered out.
There are several different versions of `distinctUntilChanged`. Have a look in the file Observable+Single.swift to review them.
*/
/*:
## Aggregating a sequence
### `aggregate`
This function will perform a function on each element in the sequence until it is completed, then send a message with the aggregate value. It works much like the Swift `reduce` function works on sequences.
*/
example("aggregate") {
let aggregateSubscriber = returnElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
>- aggregate(0, +)
>- subscribeNext { value in
println("\(value)")
}
}
/*:
To be continued...
*/

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='rendered'>
<timeline fileName='timeline.xctimeline'/>
</playground>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:../../Projects/OSXPlayground.playground">
</FileRef>
</Workspace>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Timeline
version = "3.0">
<TimelineItems>
</TimelineItems>
</Timeline>

View File

@ -1,268 +0,0 @@
import Cocoa
import RxSwift
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Combination operators
Operators that work with multiple source Observables to create a single Observable.
### `startWith`
Return an observeble which emits a specified item before emitting the items from the source Observable.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/startwith.html )
*/
example("startWith") {
let aggregateSubscriber = from([4, 5, 6, 7, 8, 9])
>- startWith(3)
>- startWith(2)
>- startWith(1)
>- startWith(0)
>- subscribeNext { int in
println(int)
}
}
/*:
### `combineLatest`
Takes several source Obserbables and a closure as parameters, returns an Observable which emits the latest items of each source Obsevable, procesed through the closure.
Once each source Observables have each emitted an item, `combineLatest` emits an item every time either source Observable emits an item.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/combinelatest.html )
The next example shows how
*/
example("combineLatest 1st") {
let intOb1 = PublishSubject<String>()
let intOb2 = PublishSubject<Int>()
combineLatest(intOb1, intOb2) {
"\($0) \($1)"
}
>- subscribeNext {
println($0)
}
println("send A to first channel")
sendNext(intOb1, "A")
println("note that nothing outputs")
println("\nsend 1 to second channel")
sendNext(intOb2, 1)
println("now that there is something in both channels, there is output")
println("\nsend B to first channel")
sendNext(intOb1, "B")
println("now that both channels are full, whenever either channel emits a value, the combined channel also emits a value")
println("\nsend 2 to second channel")
sendNext(intOb2, 2)
println("note that the combined channel emits a value whenever either sub-channel emits a value, even if the value is the same")
}
//: This example show once in each channel there are output for each new channel output the resulting observable also produces an output
example("combineLatest 2nd") {
let intOb1 = just(2)
let intOb2 = from([0, 1, 2, 3, 4])
combineLatest(intOb1, intOb2) {
$0 * $1
}
>- subscribeNext {
println($0)
}
}
/*:
There are a serie of functions `combineLatest`, they take from two to ten sources Obserbables and the closure
The next sample shows combineLatest called with three sorce Observables
*/
example("combineLatest 3rd") {
let intOb1 = just(2)
let intOb2 = from([0, 1, 2, 3])
let intOb3 = from([0, 1, 2, 3, 4])
combineLatest(intOb1, intOb2, intOb3) {
($0 + $1) * $2
}
>- subscribeNext {
println($0)
}
}
/*:
### `zip`
Takes several source Observables and a closure as parameters, returns an Observable which emit the items of the second Obsevable procesed, through the closure, with the last item of first Observable
The Observable returned by `zip` emits an item only when all of the imputs Observables have emited an item
[More info in reactive.io website](http://reactivex.io/documentation/operators/zip.html)
*/
example("zip 1st") {
let intOb1 = PublishSubject<String>()
let intOb2 = PublishSubject<Int>()
zip(intOb1, intOb2) {
"\($0) \($1)"
}
>- subscribeNext {
println($0)
}
println("send A to first channel")
sendNext(intOb1, "A")
println("note that nothing outputs")
println("\nsend 1 to second channel")
sendNext(intOb2, 1)
println("now that both source channels have output, there is output")
println("\nsend B to first channel")
sendNext(intOb1, "B")
println("note that nothing outputs, since channel 1 has two outputs but channel 2 only has one")
println("\nsend C to first channel")
sendNext(intOb1, "C")
println("note that nothing outputs, it is the same as in the previous step, since channel 1 has three outputs but channel 2 only has one")
println("\nsend 2 to second channel")
sendNext(intOb2, 2)
println("note that the combined channel emits a value with the second output of each channel")
}
//: This example show once in each channel there are output for each new channel output the resulting observable also produces an output
example("zip 2nd") {
let intOb1 = just(2)
let intOb2 = from([0, 1, 2, 3, 4])
zip(intOb1, intOb2) {
$0 * $1
}
>- subscribeNext {
println($0)
}
}
/*:
There are a serie of functions `zip`, they take from two to ten sources Obserbables and the closure
The next sample shows zip called with three sorce Observables
*/
example("zip 3rd") {
let intOb1 = from([0, 1])
let intOb2 = from([0, 1, 2, 3])
let intOb3 = from([0, 1, 2, 3, 4])
zip(intOb1, intOb2, intOb3) {
($0 + $1) * $2
}
>- subscribeNext {
println($0)
}
}
/*:
### `merge`
Combine multiple Observables, of the same type, into one by merging their emissions
[More info in reactive.io website]( http://reactivex.io/documentation/operators/merge.html )
*/
example("merge 1st") {
let subject1 = PublishSubject<Int>()
let subject2 = PublishSubject<Int>()
merge(returnElements(subject1, subject2))
>- subscribeNext { int in
println(int)
}
sendNext(subject1, 20)
sendNext(subject1, 40)
sendNext(subject1, 60)
sendNext(subject2, 1)
sendNext(subject1, 80)
sendNext(subject1, 100)
sendNext(subject2, 1)
}
example("merge 2nd") {
let subject1 = PublishSubject<Int>()
let subject2 = PublishSubject<Int>()
returnElements(subject1, subject2)
>- merge(maxConcurrent: 2)
>- subscribeNext { int in
println(int)
}
sendNext(subject1, 20)
sendNext(subject1, 40)
sendNext(subject1, 60)
sendNext(subject2, 1)
sendNext(subject1, 80)
sendNext(subject1, 100)
sendNext(subject2, 1)
}
/*:
### `switchLatest`
Convert an Observable that emits Observables into a single Observable that emits the items emitted by the most-recently-emitted of those Observables.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/switch.html )
*/
example("switchLatest") {
let var1 = Variable(0)
let var2 = Variable(200)
// var3 is like an Observable<Observable<Int>>
let var3 = Variable(var1 as Observable<Int>)
let d = var3
>- switchLatest
>- subscribeNext { (e: Int) -> Void in
println("\(e)")
}
var1.next(1)
var1.next(2)
var1.next(3)
var1.next(4)
var3.next(var2)
var2.next(201)
println("Note which no listen to var1")
var1.next(5)
var1.next(6)
var1.next(7)
sendCompleted(var1)
var2.next(202)
var2.next(203)
var2.next(204)
}

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='rendered'/>

View File

@ -1,69 +0,0 @@
import Cocoa
import RxSwift
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Conditional and Boolean Operators
Operators that evaluate one or more Observables or items emitted by Observables.
### `takeUntil`
Discard any items emitted by an Observable after a second Observable emits an item or terminates.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/takeuntil.html )
*/
example("takeUntil") {
let observable1 = PublishSubject<Int>()
let observable2 = PublishSubject<Int>()
observable1
>- takeUntil(observable2)
>- subscribeNext { int in
println(int)
}
sendNext(observable1, 1)
sendNext(observable1, 2)
sendNext(observable1, 3)
sendNext(observable1, 4)
sendNext(observable2, 1)
sendNext(observable1, 5)
}
/*:
### `takeWhile`
Mirror items emitted by an Observable until a specified condition becomes false
[More info in reactive.io website]( http://reactivex.io/documentation/operators/takewhile.html )
*/
example("takeWhile") {
let observable1 = PublishSubject<Int>()
observable1
>- takeWhile { int in
int < 4
}
>- subscribeNext { int in
println(int)
}
sendNext(observable1, 1)
sendNext(observable1, 2)
sendNext(observable1, 3)
sendNext(observable1, 4)
sendNext(observable1, 5)
}

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='rendered'/>

View File

@ -1,226 +0,0 @@
import Cocoa
import RxSwift
import XCPlayground
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Connectable Observable Operators
A Connectable Observable resembles an ordinary Observable, except that it does not begin emitting items when it is subscribed to, but only when its connect() method is called. In this way you can wait for all intended Subscribers to subscribe to the Observable before the Observable begins emitting items.
Specialty Observables that have more precisely-controlled subscription dynamics.
*/
func sampleWithoutConnectableOperators() {
let int1 = interval(1, MainScheduler.sharedInstance)
int1
>- subscribeNext {
println("first subscription \($0)")
}
delay(5) {
int1
>- subscribeNext {
println("second subscription \($0)")
}
}
}
sampleWithoutConnectableOperators()
/*:
### `multicast`
[More info in reactive.io website]( http://reactivex.io/documentation/operators/publish.html )
*/
func sampleWithMulticast() {
let subject1 = PublishSubject<Int64>()
subject1
>- subscribeNext {
println("Subject \($0)")
}
let int1 = interval(1, MainScheduler.sharedInstance)
>- multicast(subject1)
int1
>- subscribeNext {
println("first subscription \($0)")
}
delay(2) {
int1.connect()
}
delay(4) {
int1
>- subscribeNext {
println("second subscription \($0)")
println("---")
}
}
delay(6) {
int1
>- subscribeNext {
println("thirth subscription \($0)")
}
}
}
//sampleWithMulticast()
/*:
### `replay`
Ensure that all observers see the same sequence of emitted items, even if they subscribe after the Observable has begun emitting items.
publish = multicast + replay subject
[More info in reactive.io website]( http://reactivex.io/documentation/operators/replay.html )
*/
func sampleWithReplayBuffer0() {
let int1 = interval(1, MainScheduler.sharedInstance)
>- replay(0)
int1
>- subscribeNext {
println("first subscription \($0)")
}
delay(2) {
int1.connect()
}
delay(4) {
int1
>- subscribeNext {
println("second subscription \($0)")
println("---")
}
}
delay(6) {
int1
>- subscribeNext {
println("thirth subscription \($0)")
}
}
}
//sampleWithReplayBuffer0()
func sampleWithReplayBuffer2() {
println("--- sampleWithReplayBuffer2 ---\n")
let int1 = interval(1, MainScheduler.sharedInstance)
>- replay(2)
int1
>- subscribeNext {
println("first subscription \($0)")
}
delay(2) {
int1.connect()
}
delay(4) {
int1
>- subscribeNext {
println("second subscription \($0)")
println("---")
}
}
delay(6) {
int1
>- subscribeNext {
println("third subscription \($0)")
}
}
}
//sampleWithReplayBuffer2()
/*:
### `publish`
Convert an ordinary Observable into a connectable Observable.
publish = multicast + publish subject
so publish is basically replay(0)
[More info in reactive.io website]( http://reactivex.io/documentation/operators/publish.html )
*/
func sampleWithPublish() {
let int1 = interval(1, MainScheduler.sharedInstance)
>- publish
int1
>- subscribeNext {
println("first subscription \($0)")
}
delay(2) {
int1.connect()
}
delay(4) {
int1
>- subscribeNext {
println("second subscription \($0)")
println("---")
}
}
delay(6) {
int1
>- subscribeNext {
println("third subscription \($0)")
}
}
}
//sampleWithPublish()
/*:
### `refCount`
Make a Connectable Observable behave like an ordinary Observable.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/refcount.html )
*/
/*:
### `Variable` / `sharedWithCachedLastResult`
*/
XCPSetExecutionShouldContinueIndefinitely(continueIndefinitely: true)

View File

@ -1,17 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}
import Foundation
public func delay(delay:Double, closure:()->()) {
dispatch_after(
dispatch_time(
DISPATCH_TIME_NOW,
Int64(delay * Double(NSEC_PER_SEC))
),
dispatch_get_main_queue(), closure)
}

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' auto-termination-delay='11' display-mode='rendered'>
<timeline fileName='timeline.xctimeline'/>
</playground>

View File

@ -1,216 +0,0 @@
import Cocoa
import RxSwift
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Creating observables
Operators that originate new Observables.
### `empty`
Creates an observable that contains no objects. The only message it sends is the `.Completed` message.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/empty-never-throw.html )
*/
example("Empty observable") {
let emptyObservable: Observable<Int> = empty()
let emptySubscriber = emptyObservable >- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}
/*:
As you can see, no values are ever sent to the subscriber of an empty observable. It just completes and is done.
### `never`
Creates an observable that contains no objects and never completes or errors out.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/empty-never-throw.html )
*/
example("Never observable") {
let neverObservable: Observable<String> = never()
let neverSubscriber = neverObservable
>- subscribe { _ in
println("This block is never called.")
}
}
/*:
### `failWith`
Creates an observable that contains no objects and send only a error out.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/empty-never-throw.html )
*/
example("failWith") {
let error = NSError(domain: "Test", code: -1, userInfo: nil)
let errorObservable: Observable<Int> = failWith(error)
let errorSubscriber = errorObservable
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}
/*:
### `returnElement` / `just`
These two functions behave identically. They send two messages to subscribers. The first message is the value and the second message is `.Complete`.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/just.html )
*/
example("returnElement/just") {
let oneObservable = just(32)
let oneObservableSubscriber = oneObservable
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}
/*:
Here we see that the `.Next` event is sent just once, then the `.Completed` event is sent.
### `returnElements`
Now we are getting to some more interesting ways to create an Observable. This function creates an observable that produces a number of values before completing.
*/
example("returnElements") {
let multipleObservable/* : Observable<Int> */ = returnElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
let multipleObservableSubscriber = multipleObservable
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}
/*:
With the above, you will see that the `.Next` event was sent ten times, once for each element. Then `.Complete` was sent.
### `from`
We can also create an observable from any SequenceType, such as an array
[More info in reactive.io website]( http://reactivex.io/documentation/operators/from.html )
*/
example("from") {
let fromArrayObservable = from([1, 2, 3, 4, 5])
let fromArrayObservableSubscriber = fromArrayObservable
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}
/*:
### `create`
Create an Observable from scratch by means of a function
[More info in reactive.io website]( http://reactivex.io/documentation/operators/create.html )
*/
example("create") {
println("creating")
let observable: Observable<Int> = create { observer in
println("emmiting")
sendNext(observer, 0)
sendNext(observer, 1)
sendNext(observer, 2)
return AnonymousDisposable {}
}
observable
>- subscribeNext {
println($0)
}
observable
>- subscribeNext {
println($0)
}
}
/*:
### `defer`
Create an Observable from a function which create an observable. But do not create the Observable until the observer subscribes, and create a fresh Observable for each observer
[More info in reactive.io website]( http://reactivex.io/documentation/operators/defer.html )
*/
example("defer") {
let defered: Observable<Int> = defer {
println("creating")
return create { observer in
println("emmiting")
sendNext(observer, 0)
sendNext(observer, 1)
sendNext(observer, 2)
return AnonymousDisposable {}
}
}
defered
>- subscribeNext {
println($0)
}
defered
>- subscribeNext {
println($0)
}
}

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='rendered'/>

View File

@ -1,123 +0,0 @@
import Cocoa
import RxSwift
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Error Handling Operators
Operators that help to recover from error notifications from an Observable.
*/
/*:
### `catch`
Recover from an onError notification by continuing the sequence without error
[More info in reactive.io website]( http://reactivex.io/documentation/operators/catch.html )
*/
example("catch 1st") {
let observable1 = PublishSubject<Int>()
let observable2 = PublishSubject<Int>()
observable1
>- catch { error in
return observable2
}
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
sendNext(observable1, 1)
sendNext(observable1, 2)
sendNext(observable1, 3)
sendNext(observable1, 4)
sendError(observable1, NSError(domain: "Test", code: 0, userInfo: nil))
sendNext(observable2, 100)
sendNext(observable2, 200)
sendNext(observable2, 300)
sendNext(observable2, 400)
sendCompleted(observable2)
}
example("catch 2nd") {
let observable1 = PublishSubject<Int>()
observable1
>- catch(100)
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
sendNext(observable1, 1)
sendNext(observable1, 2)
sendNext(observable1, 3)
sendNext(observable1, 4)
sendError(observable1, NSError(domain: "Test", code: 0, userInfo: nil))
}
/*:
### `retry`
If a source Observable emits an error, resubscribe to it in the hopes that it will complete without error
[More info in reactive.io website]( http://reactivex.io/documentation/operators/retry.html )
*/
example("retry") {
var count = 1 // bad practice, only for example purposes
let observable: Observable<Int> = create { observer in
let error = NSError(domain: "Test", code: 0, userInfo: nil)
sendNext(observer, 0)
sendNext(observer, 1)
sendNext(observer, 2)
if count < 2 {
sendError(observer, error)
count++
}
sendNext(observer, 3)
sendNext(observer, 4)
sendNext(observer, 5)
sendCompleted(observer)
return AnonymousDisposable {}
}
observable
>- retry
>- subscribe { event in
switch event {
case .Next(let box):
println("\(box.value)")
case .Completed:
println("completed")
case .Error(let error):
println("\(error)")
}
}
}

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='rendered'/>

View File

@ -1,59 +0,0 @@
import Cocoa
import RxSwift
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Filtering Observables
Operators that selectively emit items from a source Observable.
### `where` / `filter`
emit only those items from an Observable that pass a predicate test
[More info in reactive.io website]( http://reactivex.io/documentation/operators/filter.html )
*/
example("filter") {
let onlyEvensSubscriber = returnElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
>- filter {
$0 % 2 == 0
}
>- subscribeNext { value in
println("\(value)")
}
}
/*:
### `distinctUntilChanged`
suppress duplicate items emitted by an Observable
[More info in reactive.io website]( http://reactivex.io/documentation/operators/distinct.html )
*/
example("distinctUntilChanged") {
let distinctUntilChangedSubscriber = returnElements(1, 2, 3, 1, 1, 4)
>- distinctUntilChanged
>- subscribeNext { value in
println("\(value)")
}
}
/*:
### `take`
Emit only the first n items emitted by an Observable
[More info in reactive.io website]( http://reactivex.io/documentation/operators/take.html )
*/
example("take") {
let distinctUntilChangedSubscriber = returnElements(1, 2, 3, 4, 5, 6)
>- take(3)
>- subscribeNext { value in
println("\(value)")
}
}

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='rendered'>
<timeline fileName='timeline.xctimeline'/>
</playground>

View File

@ -1,69 +0,0 @@
import Cocoa
import RxSwift
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Mathematical and Aggregate Operators
Operators that operate on the entire sequence of items emitted by an Observable
### `concat`
Emit the emissions from two or more Observables without interleaving them.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/concat.html )
*/
example("concat") {
let var1 = Variable(0)
let var2 = Variable(200)
// var3 is like an Observable<Observable<Int>>
let var3 = Variable(var1 as Observable<Int>)
let d = var3
>- concat
>- subscribeNext { (e: Int) -> Void in
println("\(e)")
}
var1.next(1)
var1.next(2)
var1.next(3)
var1.next(4)
var3.next(var2)
var2.next(201)
var1.next(5)
var1.next(6)
var1.next(7)
sendCompleted(var1)
var2.next(202)
var2.next(203)
var2.next(204)
}
/*:
### `reduce` / `aggregate`
Apply a function to each item emitted by an Observable, sequentially, and emit the final value.
This function will perform a function on each element in the sequence until it is completed, then send a message with the aggregate value. It works much like the Swift `reduce` function works on sequences.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/reduce.html )
*/
example("aggregate") {
let aggregateSubscriber = returnElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
>- aggregate(0, +)
>- subscribeNext { value in
println("\(value)")
}
}

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='rendered'/>

View File

@ -1,103 +0,0 @@
import Cocoa
import RxSwift
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Transforming Observables
Operators that transform items that are emitted by an Observable.
### `map` / `select`
Transform the items emitted by an Observable by applying a function to each item
[More info in reactive.io website]( http://reactivex.io/documentation/operators/map.html )
*/
example("map") {
let observable1: Observable<Character> = create { observer in
sendNext(observer, Character("A"))
sendNext(observer, Character("B"))
sendNext(observer, Character("C"))
return AnonymousDisposable {}
}
observable1
>- map { char in
char.hashValue
}
>- subscribeNext { int in
println(int)
}
}
/*:
### `flatMap`
Transform the items emitted by an Observable into Observables, then flatten the emissions from those into a single Observable
[More info in reactive.io website]( http://reactivex.io/documentation/operators/flatmap.html )
*/
example("flatMap") {
let observable1: Observable<Int> = create { observer in
sendNext(observer, 1)
sendNext(observer, 2)
sendNext(observer, 3)
return AnonymousDisposable {}
}
let observable2: Observable<String> = create { observer in
sendNext(observer, "A")
sendNext(observer, "B")
sendNext(observer, "C")
sendNext(observer, "D")
sendNext(observer, "F")
sendNext(observer, "--")
return AnonymousDisposable {}
}
observable1
>- flatMap { int in
observable2
}
>- subscribeNext {
println($0)
}
}
/*:
### `scan`
Apply a function to each item emitted by an Observable, sequentially, and emit each successive value
[More info in reactive.io website]( http://reactivex.io/documentation/operators/scan.html )
*/
example("scan") {
let observable: Observable<Int> = create { observer in
sendNext(observer, 0)
sendNext(observer, 1)
sendNext(observer, 2)
sendNext(observer, 3)
sendNext(observer, 4)
sendNext(observer, 5)
return AnonymousDisposable {}
}
observable
>- scan(0) { acum, elem in
acum + elem
}
>- subscribeNext {
println($0)
}
}

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='rendered'>
<timeline fileName='timeline.xctimeline'/>
</playground>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Timeline
version = "3.0">
<TimelineItems>
</TimelineItems>
</Timeline>

View File

@ -1,142 +0,0 @@
import Cocoa
import RxSwift
/*:
# To use playgrounds please open `Rx.xcworkspace`, build `RxSwift-OSX` scheme and then open playgrounds in `Rx.xcworkspace` tree view.
*/
/*:
## Observable Utility Operators
A toolbox of useful Operators for working with Observables.
### `subscribe`
Create an Disposable which listen events from source Observable, the given closure take the Even and is responsible for the actions to perform when the it is produced.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/subscribe.html )
*/
example("subscribe") {
let intOb1 = PublishSubject<Int>()
intOb1
>- subscribe { event in
println(event)
}
sendNext(intOb1, 1)
sendCompleted(intOb1)
}
/*:
There are several variants of the `subscribe` operator. They works over one posible event type:
### `subscribeNext`
Create an Disposable which listen only Next event from source Observable, the given closure take the Even's value and is responsible for the actions to perform only when the Next even is produced.
*/
example("subscribeNext") {
let intOb1 = PublishSubject<Int>()
intOb1
>- subscribeNext { int in
println(int)
}
sendNext(intOb1, 1)
sendCompleted(intOb1)
}
/*:
### `subscribeCompleted`
Create an Disposable which listen only Completed event from source Observable, the given closure take the Even's value and is responsible for the actions to perform only when the Completed even is produced.
*/
example("subscribeCompleted") {
let intOb1 = PublishSubject<Int>()
intOb1
>- subscribeCompleted {
println("It's completed")
}
sendNext(intOb1, 1)
sendCompleted(intOb1)
}
/*:
### `subscribeError
Create an Disposable which listen only Error event from source Observable, the given closure take the Even's value and is responsible for the actions to perform only when the Error even is produced
*/
example("subscribeError") {
let intOb1 = PublishSubject<Int>()
intOb1
>- subscribeError { error in
println(error)
}
sendNext(intOb1, 1)
sendError(intOb1, NSError(domain: "Examples", code: -1, userInfo: nil))
}
/*:
### `do`
Returns the same source Observable but the given closure responsible for the actions to perform when the even is produced. The gived closure obtain the event produced by the source observable
[More info in reactive.io website]( http://reactivex.io/documentation/operators/do.html )
*/
example("do") {
let intOb1 = PublishSubject<Int>()
let intOb2 = intOb1
>- `do` { event in
println("first \(event)")
}
intOb2
>- subscribeNext { int in
println("second \(int)")
}
sendNext(intOb1, 1)
}
/*:
### `doOnNext`
It is a variant of the `do` operator. Returns the same source Observable but the given closure responsible for the actions to perform when the Next even is produced. The gived closure obtain the value of the Next event produced by the source observable.
[More info in reactive.io website]( http://reactivex.io/documentation/operators/do.html )
*/
example("doOnNext") {
let intOb1 = PublishSubject<Int>()
let intOb2 = intOb1
>- doOnNext { int in
println("first \(int)")
}
intOb2
>- subscribeNext { int in
println("second \(int)")
}
sendNext(intOb1, 1)
}

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='rendered'/>

View File

@ -1,68 +0,0 @@
import Cocoa
import RxSwift
/*:
To use playgrounds please open Rx.xcworkspace, build RxSwift-OSX scheme and then open playgrounds in Rx.xcworkspace tree view.
*/
func writeSequenceToConsole(name: String, sequence: Observable<String>) {
sequence
>- subscribeNext {
println("Subscription: \(name), value: \($0)")
}
}
/*:
## PublishSubject
PublishSubject can begin emitting items immediately upon creation, but there is a risk that one or more items may be lost between the time the Subject is created and the observer subscribes to it.
*/
example("PublishSubject") {
let subject = PublishSubject<String>()
writeSequenceToConsole("1", subject)
sendNext(subject, "a")
sendNext(subject, "b")
writeSequenceToConsole("2", subject)
sendNext(subject, "c")
sendNext(subject, "d")
}
/*:
## ReplaySubject
ReplaySubject emits to any observer all of the items, in the buffer, that were emitted by the source
*/
example("ReplaySubject") {
let subject = ReplaySubject<String>(bufferSize: 1)
writeSequenceToConsole("1", subject)
sendNext(subject, "a")
sendNext(subject, "b")
writeSequenceToConsole("2", subject)
sendNext(subject, "c")
sendNext(subject, "d")
}
/*:
## BehaviorSubject a.k.a. Variable
BehaviorSubject is similar to ReplaySubject except it only remembers the last item. This means that all subscribers will receive a value immediately (unless it is already completed).
*/
example("BehaviorSubject") {
let subject = BehaviorSubject(value: "z")
writeSequenceToConsole("1", subject)
sendNext(subject, "a")
sendNext(subject, "b")
writeSequenceToConsole("2", subject)
sendNext(subject, "c")
sendNext(subject, "d")
}

View File

@ -1,6 +0,0 @@
public func example(description: String, action: () -> ()) {
println("\n--- \(description) example ---")
action()
}

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' requires-full-environment='true' display-mode='rendered'/>

View File

@ -24,7 +24,7 @@
/* Begin PBXFileReference section */
C81108771AF5114D001C13E4 /* Preprocessor */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Preprocessor; sourceTree = BUILT_PRODUCTS_DIR; };
C811087A1AF5114D001C13E4 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
C811087A1AF5114D001C13E4 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = main.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -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;
};

View File

@ -3,41 +3,42 @@
// Preprocessor
//
// Created by Krunoslav Zaher on 4/22/15.
// Copyright (c) 2015 Krunoslav Zaher. All rights reserved.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
if Process.argc != 3 {
println("./Preprocessor <source-files-root> <derived-data> ")
print("./Preprocessor <source-files-root> <derived-data> ")
exit(-1)
}
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.\\n// Take a look at `Preprocessor` target in RxSwift project \\n\"]\n")
functionContentComponents.append("components.append(\(escape(components[0])))\n")
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(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("\"\".join(components).writeToFile(\"\(outputPath)\", atomically: false, encoding: NSUTF8StringEncoding, error: nil);")
functionContentComponents.append("try! components.joined(separator:\"\").write(toFile:\"\(outputPath)\", atomically: false, encoding: String.Encoding.utf8)")
return "".join(functionContentComponents)
return functionContentComponents.joined(separator: "")
}
func runCommand(path: String) {
let pid = NSProcessInfo().processIdentifier
_ = ProcessInfo().processIdentifier
let task = NSTask()
let task = Task()
task.launchPath = "/bin/bash"
task.arguments = ["-c", "xcrun swift \"\(path)\""]
@ -71,29 +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! {
if (file.pathExtension ?? "") != "tt" {
for file in files {
if ((file as NSString).pathExtension ?? "") != "tt" {
continue
}
let path = sourceFilesRoot.stringByAppendingPathComponent(file as! String)
print(file)
let outputPath = path.substringToIndex(path.endIndex.predecessor().predecessor().predecessor()) + ".swift"
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"
generateAllFiles.append("_ = { () -> Void in\n\(processFile(path, outputPath))\n}()\n")
generateAllFiles.append("_ = { () -> Void in\n\(processFile(path: path, outputPath: outputPath))\n}()\n")
}
let script = "".join(generateAllFiles)
let scriptPath = derivedData.stringByAppendingPathComponent("_preprocessor.sh")
let script = generateAllFiles.joined(separator: "")
let scriptPath = (derivedData as NSString).appendingPathComponent("_preprocessor.sh")
script.writeToFile(scriptPath, atomically: true, encoding: NSUTF8StringEncoding, error: nil)
runCommand(scriptPath)
do {
try script.write(toFile: scriptPath, atomically: true, encoding: String.Encoding.utf8)
} catch _ {
}
runCommand(path: scriptPath)

538
README.md
View File

@ -1,9 +1,13 @@
<img src="assets/Rx_Logo_M.png" width="36" height="36"> RxSwift: ReactiveX for Swift
<img src="assets/Rx_Logo_M.png" alt="Miss Electric Eel 2016" width="36" height="36"> RxSwift: ReactiveX for Swift
======================================
[![Travis CI](https://travis-ci.org/ReactiveX/RxSwift.svg?branch=master)](https://travis-ci.org/ReactiveX/RxSwift)
[![Travis CI](https://travis-ci.org/ReactiveX/RxSwift.svg?branch=master)](https://travis-ci.org/ReactiveX/RxSwift) ![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20OSX%20%7C%20tvOS%20%7C%20watchOS%20%7C%20Linux%28experimental%29-333333.svg) ![pod](https://img.shields.io/cocoapods/v/RxSwift.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
Xcode 6.3 / Swift 1.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.
@ -17,386 +21,113 @@ Like the original Rx, its intention is to enable easy composition of asynchronou
KVO observing, async operations and streams are all unified under [abstraction of sequence](Documentation/GettingStarted.md#observables-aka-sequences). This is the reason why Rx is so simple, elegant and powerful.
## I came here because I want to ...
```
RxSwift
|
├-LICENSE.md
├-README.md
├-RxSwift - platform agnostic core
├-RxCocoa - extensions for UI, NSURLSession, KVO ...
├-RxBlocking - set of blocking operators for unit testing
├-RxExample - example apps: taste of Rx
└-Rx.xcworkspace - workspace that contains all of the projects hooked up
```
###### ... understand
Hang out with us on [rxswift.slack.com](http://slack.rxswift.org) <img src="http://slack.rxswift.org/badge.svg">
* [why use rx?](Documentation/Why.md)
* [the basics, getting started with RxSwift](Documentation/GettingStarted.md)
* [units](Documentation/Units.md) - what is `Driver`, `ControlProperty`, and `Variable` ... and why do they exist?
* [testing](Documentation/UnitTests.md)
* [tips and common errors](Documentation/Tips.md)
* [debugging](Documentation/GettingStarted.md#debugging)
* [the math behind Rx](Documentation/MathBehindRx.md)
* [what are hot and cold observable sequences?](Documentation/HotAndColdObservables.md)
* [what does the the public API look like?](Documentation/API.md)
1. [Why](#why)
1. [State](#state)
1. [Bindings](#bindings)
1. [Retries](#retries)
1. [Transient state](#transient-state)
1. [Aggregating network requests](#aggregating-network-requests)
1. [Easy integration](#easy-integration)
1. [Compositional disposal](#compositional-disposal)
1. [Delegates](#delegates)
1. [Notifications](#notifications)
1. [KVO](#kvo)
1. [Benefits](#benefits)
1. [It's not all or nothing](#its-not-all-or-nothing)
1. [Getting started](Documentation/GettingStarted.md)
1. [Examples](Documentation/Examples.md)
1. [API - RxSwift operators / RxCocoa extensions](Documentation/API.md)
1. [Build / Install / Run](#build--install--run)
1. [Math behind](Documentation/MathBehindRx.md)
1. [Hot and cold observables](Documentation/HotAndColdObservables.md)
1. [Feature comparison with other frameworks](#feature-comparison-with-other-frameworks)
1. [Roadmap](https://github.com/kzaher/RxSwift/wiki/roadmap)
1. [References](#references)
## Why
###### ... install
Producing stable code fast is usually unexpectedly hard using just your vanilla language of choice.
* Integrate RxSwift/RxCocoa with my app. [Installation Guide](Documentation/Installation.md)
There are many unexpected pitfalls that can ruin all of your hard work and halt development of new features.
###### ... hack around
### State
* with the example app. [Running Example App](Documentation/ExampleApp.md)
* with operators in playgrounds. [Playgrounds](Documentation/Playgrounds.md)
Languages that allow mutation make it easy to access global state and mutate it. Uncontrolled mutations of shared global state can easily cause [combinatorial explosion] (https://en.wikipedia.org/wiki/Combinatorial_explosion#Computing).
###### ... interact
But on the other hand, when used in smart way, imperative languages can enable writing more efficient code closer to hardware.
* All of this is great, but it would be nice to talk with other people using RxSwift and exchange experiences. <br />[![Slack channel](http://rxswift-slack.herokuapp.com/badge.svg)](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)
The usual way to battle combinatorial explosion is to keep state as simple as possible, and use [unidirectional data flows](https://developer.apple.com/videos/wwdc/2014/#229) to model derived data.
This is what Rx really shines at.
###### ... compare
Rx is that sweet spot between functional and imperative world. It enables you to use immutable definitions and pure functions to process snapshots of mutable state in a reliable composable way.
* [with other libraries](Documentation/ComparisonWithOtherLibraries.md).
So what are some of the practical examples?
### Bindings
###### ... find compatible
When writing embedded UI applications you would ideally want your program interface to be just a [pure function](https://en.wikipedia.org/wiki/Pure_function) of the [truth of the system](https://developer.apple.com/videos/wwdc/2014/#229). In that way user interface could be optimally redrawn only when truth changes, and there wouldn't be any inconsistencies.
* libraries from [RxSwiftCommunity](https://github.com/RxSwiftCommunity).
* [Pods using RxSwift](https://cocoapods.org/?q=uses%3Arxswift).
These are so called bindings and Rx can help you model your system that way.
###### ... see the broader vision
[Definition of `>-` operator is here](Documentation/DesignRationale.md#pipe-operator)
* Does this exist for Android? [RxJava](https://github.com/ReactiveX/RxJava)
* Where is all of this going, what is the future, what about reactive architectures, how do you design entire apps this way? [Cycle.js](https://github.com/cyclejs/cycle-core) - this is javascript, but [RxJS](https://github.com/Reactive-Extensions/RxJS) is javascript version of Rx.
```swift
combineLatest(firstName.rx_text, lastName.rx_text) { $0 + " " + $1 }
>- map { "Greeting \($0)" }
>- subscribeNext { greeting in
greetingLabel.text = greeting
}
```
## Usage
### Retries
It would be great if APIs wouldn't fail, but unfortunately they do. Let's say there is an API method
```swift
func doSomethingIncredible(forWho: String) throws -> IncredibleThing
```
If you are using this function as it is, it's really hard to do retries in case it fails. Not to mention complexities modelling [exponential backoffs](https://en.wikipedia.org/wiki/Exponential_backoff). Sure it's possible, but code would probably contain a lot of transient states that you really don't care about, and it won't be reusable.
You would ideally want to capture the essence of retrying, and to be able to apply it to any operation.
This is how you can do simple retries with Rx
```swift
doSomethingIncredible("me")
>- retry(3)
```
You can also easily create custom retry operators.
### Transient state
There is also a lot of problems with transient state when writing async programs. Typical example is autocomplete search box.
If you were to write the autocomplete code without Rx, first problem that probably needs to be solved is when `c` in `abc` is typed, and there is a pending request for `ab`, pending request gets cancelled. Ok, that shouldn't be too hard to solve, you just create additional variable to hold reference to pending request.
The next problem is if the request fails, you need to do that messy retry logic. But ok, a couple of more fields that capture number of retries that need to be cleaned up.
It would be great if program would wait for some time before firing that request to server, after all, we don't want to spam our servers in case somebody is in the process of fast typing something very long. Additional timer field maybe?
There is also a question of what needs to be shown on screen while that search is executing, and also what needs to be shown in case we fail even with all of the retries.
Writing all of this and properly testing it would be tedious. This is that same logic written with Rx.
```swift
searchTextField.rx_text
>- throttle(0.3, MainScheduler.sharedInstance)
>- distinctUntilChanged
>- map { query in
API.getSearchResults(query)
>- retry(3)
>- startWith([]) // clears results on new search term
>- catch([])
}
>- switchLatest
>- map { results in
// bind to ui
}
```
There is no additional flags or fields required. Rx takes care of all that transient mess.
### Aggregating network requests
What if you need to fire two requests, and aggregate results when they have both finished?
Well, there is of course `zip` operator
```swift
let userRequest: Observable<User> = API.getUser("me")
let friendsRequest: Observable<Friends> = API.getFriends("me")
zip(userRequest, friendsRequest) { user, friends in
return (user, friends)
}
>- subscribeNext { user, friends in
// bind them to user interface
}
```
So what if those APIs return results on a background thread, and binding has to happen on main UI thread? There is `observeOn`.
```swift
let userRequest: Observable<User> = API.getUser("me")
let friendsRequest: Observable<[Friend]> = API.getFriends("me")
zip(userRequest, friendsRequest) { user, friends in
return (user, friends)
}
>- observeOn(MainScheduler.sharedInstance)
>- subscribeNext { user, friends in
// bind them to user interface
}
```
There are many more practical use cases where Rx really shines.
### Easy integration
And what if you need to create your own observable? It's pretty easy. This code is taken from RxCocoa and that's all you need to wrap HTTP requests with `NSURLSession`
```swift
extension NSURLSession {
public func rx_response(request: NSURLRequest) -> Observable<(NSData!, NSURLResponse!)> {
return create { observer in
let task = self.dataTaskWithRequest(request) { (data, response, error) in
if data == nil || response == nil {
sendError(observer, error ?? UnknownError)
}
else {
sendNext(observer, (data, response))
sendCompleted(observer)
}
}
task.resume()
return AnonymousDisposable {
task.cancel()
}
<table>
<tr>
<th width="30%">Here's an example</th>
<th width="30%">In Action</th>
</tr>
<tr>
<td>Define search for GitHub repositories ...</td>
<th rowspan="9"><img src="https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/GithubSearch.gif"></th>
</tr>
<tr>
<td><div class="highlight highlight-source-swift"><pre>
let searchResults = searchBar.rx.text
.throttle(0.3, scheduler: MainScheduler.instance)
.distinctUntilChanged()
.flatMapLatest { query -> Observable<[Repository]> in
if query.isEmpty {
return Observable.just([])
}
return searchGitHub(query)
.catchErrorJustReturn([])
}
}
```
### Compositional disposal
Lets assume that there is a scenario where you want to display blurred images in a table view. The images should be first fetched from URL, then decoded and then blurred.
It would also be nice if that entire process could be cancelled if cell exists visible table view area because bandwidth and processor time for blurring are expensive.
It would also be nice if we didn't just immediately start to fetch image once the cell enters visible area because if user swipes really fast there could be a lot of requests fired and cancelled.
It would be also nice if we could limit the number of concurrent image operations because blurring images is an expensive operation.
This is how we can do it using Rx.
```swift
let imageSubscripton = just(imageURL)
>- throttle(0.2, MainScheduler.sharedInstance)
>- flatMap { imageURL in
API.fetchImage(imageURL)
.observeOn(MainScheduler.instance)</pre></div></td>
</tr>
<tr>
<td>... then bind the results to your tableview</td>
</tr>
<tr>
<td width="30%"><div class="highlight highlight-source-swift"><pre>
searchResults
.bindTo(tableView.rx.items(cellIdentifier: "Cell")) {
(index, repository: Repository, cell) in
cell.textLabel?.text = repository.name
cell.detailTextLabel?.text = repository.url
}
>- observeOn(operationScheduler)
>- map { imageData in
return decodeAndBlurImage(imageData)
}
>- observeOn(MainScheduler.sharedInstance)
>- subscribeNext { blurredImage in
imageView.image = blurredImage
}
//
override func prepareForReuse() {
imageSubscripton.dispose()
}
```
This code will do all that, and when `imageSubscription` is disposed it will cancel all dependent async operations and make sure no rogue image is bound to UI.
.addDisposableTo(disposeBag)</pre></div></td>
</tr>
</table>
### Delegates
## Requirements
Delegates can be used both as a hook for customizing behavior and as an observing mechanism.
* Xcode 8.0 beta 6 (8S201h)
* Swift 3.0
Each usage has it's drawbacks, but Rx can help remedy some of the problem with using delegates as a observing mechanism.
* iOS 8.0+
* Mac OS X 10.10+
* tvOS 9.0+
* watchOS 2.0+
Using delegates and optional methods to report changes can be problematic because there can be usually only one delegate registered, so there is no way to register multiple observers.
Also, delegates usually don't fire initial value upon invoking delegate setter, so you'll also need to read that initial value in some other way. That is kind of tedios.
RxCocoa not only provides wrappers for popular UIKit/Cocoa classes, but it also provides a generic mechanism called `DelegateProxy` that enables wrapping your own delegates and exposing them as observable sequences.
This is real code taken from `UISearchBar` integration.
It uses delegate as a notification mechanism to create an `Observable<String>` that immediately returns current search text upon subscription, and then emits changed search values.
```swift
extension UISearchBar {
public var rx_delegate: DelegateProxy {
return proxyForObject(self) as RxSearchBarDelegateProxy
}
public var rx_searchText: Observable<String> {
return defer { [weak self] in
let text = self?.text ?? ""
return self?.rx_delegate.observe("searchBar:textDidChange:") ?? empty()
>- map { a in
return a[1] as? String ?? ""
}
>- startWith(text)
}
}
}
```
Definition of `RxSearchBarDelegateProxy` can be found [here](RxCocoa/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift)
This is how that API can be now used
```swift
searchBar.rx_searchText
>- subscribeNext { searchText in
println("Current search text '\(searchText)'")
}
```
### Notifications
Notifications enable registering multiple observers easily, but they are also untyped. Values need to be extracted from either `userInfo` or original target once they fire.
They are just a notification mechanism, and initial value usually has to be acquired in some other way.
That leads to this tedious pattern:
```swift
let initialText = object.text
doSomething(initialText)
// ....
func controlTextDidChange(notification: NSNotification) {
doSomething(object.text)
}
```
You can use `rx_notification` to create an observable sequence with wanted properties in a similar fashion like `searchText` was constructed in delegate example, and thus reduce scattering of logic and duplication of code.
### KVO
KVO is a handy observing mechanism, but not without flaws. It's biggest flaw is confusing memory management.
In case of observing a property on some object, the object has to outlive the KVO observer registration otherwise your system will crash with an exception.
```
`TickTock` was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object.
```
There are some rules that you can follow when observing some object that is a direct descendant or ancestor in ownership chain, but if that relation is unknown, then it becomes tricky.
It also has a really awkward callback method that needs to be implemented
```objc
-(void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
```
RxCocoa provides a really convenient observable sequence that solves those issues called [`rx_observe` and `rx_observeWeakly`](Documentation/GettingStarted.md#kvo)
This is how they can be used:
```swift
view.rx_observe("frame")
>- subscribeNext { (frame: CGRect?) in
println("Got new frame \(frame)")
}
```
or
```swift
someSuspiciousViewController.rx_observeWeakly("behavingOk")
>- subscribeNext { (behavingOk: Bool?) in
println("Cats can purr? \(behavingOk)")
}
```
### Benefits
In short using Rx will make your code:
* composable <- because Rx is composition's nick name
* reusable <- because it's composable
* declarative <- because definitions are immutable and only data changes
* understandable and concise <- raising level of abstraction and removing transient states
* stable <- because Rx code is thoroughly unit tested
* less stateful <- because you are modeling application as unidirectional data flows
* without leaks <- because resource management is easy
### It's not all or nothing
It is usually a good idea to model as much of your application as possible using Rx.
But what if you don't know all of the operators and does there even exist some operator that models your particular case?
Well, all of the Rx operators are based on math and should be intuitive.
The good news is that about 10-15 operators cover most typical use cases. And that list already includes some of the familiar ones like `map`, `filter`, `zip`, `observeOn` ...
There is a huge list of [all Rx operators](http://reactivex.io/documentation/operators.html) and list of all of the [currently supported RxSwift operators](Documentation/API.md).
For each operator there is [marble diagram](http://reactivex.io/documentation/operators/retry.html) that helps to explain how does it work.
But what if you need some operator that isn't on that list? Well, you can make your own operator.
What if creating that kind of operator is really hard for some reason, or you have some legacy stateful piece of code that you need to work with? Well, you've got yourself in a mess, but you can [jump out of Rx monad](Documentation/GettingStarted.md#life-happens) easily, process the data, and return back into it.
## Build / Install / Run
## Installation
Rx doesn't contain any external dependencies.
These are currently supported options:
These are currently the supported options:
### Manual
Open Rx.xcworkspace, choose `RxExample` and hit run. This method will build everything and run sample app
Open Rx.xcworkspace, choose `RxExample` and hit run. This method will build everything and run the sample app
### [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
@ -404,11 +135,33 @@ Open Rx.xcworkspace, choose `RxExample` and hit run. This method will build ever
# Podfile
use_frameworks!
pod 'RxSwift'
pod 'RxCocoa'
target 'YOUR_TARGET_NAME' do
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', '~> 3.0.0.alpha.1'
pod 'RxTests', '~> 3.0.0.alpha.1'
end
```
type in `Podfile` directory
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
@ -416,83 +169,27 @@ $ pod install
### [Carthage](https://github.com/Carthage/Carthage)
It's little tricky, but possible. Carthage still has troubles resolving multiple targets inside same repository (https://github.com/Carthage/Carthage/issues/395).
This is the workaround:
Add this to `Cartfile`
```
git "git@github.com:kzaher/RxSwift.git" "latest-carthage/rxswift"
git "git@github.com:kzaher/RxSwift.git" "latest-carthage/rxcocoa"
```
Unfortunately, you can update only one target at a time because Carthage doesn't know how to resolve them properly. You'll probably need to do something like:
```
git "git@github.com:kzaher/RxSwift.git" "latest-carthage/rxswift"
#git "git@github.com:kzaher/RxSwift.git" "latest-carthage/rxcocoa"
```
```bash
carthage update
github "ReactiveX/RxSwift" "3.0.0.alpha.1"
```
```
#git "git@github.com:kzaher/RxSwift.git" "latest-carthage/rxswift"
git "git@github.com:kzaher/RxSwift.git" "latest-carthage/rxcocoa"
$ carthage update
```
```bash
carthage update
### Manually using git submodules
* Add RxSwift as a submodule
```
$ git submodule add git@github.com:ReactiveX/RxSwift.git
```
### iOS 7
* Drag `Rx.xcodeproj` into Project Navigator
* Go to `Project > Targets > Build Phases > Link Binary With Libraries`, click `+` and select `RxSwift-[Platform]` and `RxCocoa-[Platform]` targets
iOS 7 is little tricky, but it can be done. The main problem is that iOS 7 doesn't support dynamic frameworks.
These are the steps to include RxSwift/RxCocoa projects in an iOS7 project
* RxSwift/RxCocoa projects have no external dependencies so just manually **including all of the `.swift`, `.m`, `.h` files** in build target should import all of the necessary source code.
You can either do that by copying the files manually or using git submodules.
`git submodule add git@github.com:kzaher/RxSwift.git`
After you've included files from `RxSwift/RxSwift` and `RxSwift/RxCocoa` folders, you'll need to remove files that are platform specific.
If you are compiling for **`iOS`**, please **remove references** to OSX specific files located in **`RxCocoa/RxCocoa/OSX`**.
If you are compiling for **`OSX`**, please **remove references** to iOS specific files located in **`RxCocoa/RxCocoa/iOS`**.
* Add **`RX_NO_MODULE`** as a custom Swift preprocessor flag
Go to your target's `Build Settings > Swift Compiler - Custom Flags` and add `-D RX_NO_MODULE`
* Include **`RxCocoa.h`** in your bridging header
If you already have a bridging header, adding `#import "RxCocoa.h"` should be sufficient.
If you don't have a bridging header, you can go to your target's `Build Settings > Swift Compiler - Code Generation > Objective-C Bridging Header` and point it to `[path to RxCocoa.h parent directory]/RxCocoa.h`.
## Feature comparison with other frameworks
| | Rx[Swift] | ReactiveCocoa | Bolts | PromiseKit |
|:---------------------------------------------------------:|:---------:|:----------------------:|:-----:|:----------:|
| Language | swift | objc/swift | objc | objc/swift |
| Basic Concept | Sequence | Signal SignalProducer | Task | Promise |
| Cancellation | • | • | • | • |
| Async operations | • | • | • | • |
| map/filter/... | • | • | • | |
| cache invalidation | • | • | | |
| cross platform | • | | • | |
| blocking operators for unit testing | • | | N/A | N/A |
| Lockless single sequence operators (map, filter, ...) | • | | N/A | N/A |
| Unified hot and cold observables | • | | N/A | N/A |
| RefCount | • | | N/A | N/A |
| Concurrent schedulers | • | | N/A | N/A |
| Generated optimized narity operators (combineLatest, zip) | • | | N/A | N/A |
| Reentrant operators | • | | N/A | N/A |
** Comparison with RAC with respect to v3.0-RC.1
## References
@ -500,6 +197,7 @@ If you don't have a bridging header, you can go to your target's `Build Settings
* [Reactive Extensions GitHub (GitHub)](https://github.com/Reactive-Extensions)
* [Erik Meijer (Wikipedia)](http://en.wikipedia.org/wiki/Erik_Meijer_%28computer_scientist%29)
* [Expert to Expert: Brian Beckman and Erik Meijer - Inside the .NET Reactive Framework (Rx) (video)](https://youtu.be/looJcaeboBY)
* [Reactive Programming Overview (Jafar Husain from Netflix)](https://www.youtube.com/watch?v=dwP1TNXE6fc)
* [Subject/Observer is Dual to Iterator (paper)](http://csl.stanford.edu/~christos/pldi2010.fit/meijer.duality.pdf)
* [Rx standard sequence operators visualized (visualization tool)](http://rxmarbles.com/)
* [Haskell](https://www.haskell.org/)

View File

@ -0,0 +1,160 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxSwift
/*:
# Combination Operators
Operators that combine multiple source `Observable`s into a single `Observable`.
## `startWith`
Emits the specified sequence of elements before beginning to emit the elements from the source `Observable`. [More info](http://reactivex.io/documentation/operators/startwith.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/startwith.png)
*/
example("startWith") {
let disposeBag = DisposeBag()
Observable.of("🐶", "🐱", "🐭", "🐹")
.startWith("1")
.startWith("2")
.startWith("3", "🅰️", "🅱️")
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
> As this example demonstrates, `startWith` can be chained on a last-in-first-out basis, i.e., each successive `startWith`'s elements will be prepended before the prior `startWith`'s elements.
----
## `merge`
Combines elements from source `Observable` sequences into a single new `Observable` sequence, and will emit each element as it is emitted by each source `Observable` sequence. [More info](http://reactivex.io/documentation/operators/merge.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/merge.png)
*/
example("merge") {
let disposeBag = DisposeBag()
let subject1 = PublishSubject<String>()
let subject2 = PublishSubject<String>()
Observable.of(subject1, subject2)
.merge()
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
subject1.onNext("🅰️")
subject1.onNext("🅱️")
subject2.onNext("")
subject2.onNext("")
subject1.onNext("🆎")
subject2.onNext("")
}
/*:
----
## `zip`
Combines up to 8 source `Observable` sequences into a single new `Observable` sequence, and will emit from the combined `Observable` sequence the elements from each of the source `Observable` sequences at the corresponding index. [More info](http://reactivex.io/documentation/operators/zip.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/zip.png)
*/
example("zip") {
let disposeBag = DisposeBag()
let stringSubject = PublishSubject<String>()
let intSubject = PublishSubject<Int>()
Observable.zip(stringSubject, intSubject) { stringElement, intElement in
"\(stringElement) \(intElement)"
}
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
stringSubject.onNext("🅰️")
stringSubject.onNext("🅱️")
intSubject.onNext(1)
intSubject.onNext(2)
stringSubject.onNext("🆎")
intSubject.onNext(3)
}
/*:
----
## `combineLatest`
Combines up to 8 source `Observable` sequences into a single new `Observable` sequence, and will begin emitting from the combined `Observable` sequence the latest elements of each source `Observable` sequence once all source sequences have emitted at least one element, and also when any of the source `Observable` sequences emits a new element. [More info](http://reactivex.io/documentation/operators/combinelatest.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/combinelatest.png)
*/
example("combineLatest") {
let disposeBag = DisposeBag()
let stringSubject = PublishSubject<String>()
let intSubject = PublishSubject<Int>()
Observable.combineLatest(stringSubject, intSubject) { stringElement, intElement in
"\(stringElement) \(intElement)"
}
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
stringSubject.onNext("🅰️")
stringSubject.onNext("🅱️")
intSubject.onNext(1)
intSubject.onNext(2)
stringSubject.onNext("🆎")
}
//: There is also a `combineLatest` extension on `Array`:
example("Array.combineLatest") {
let disposeBag = DisposeBag()
let stringObservable = Observable.just("❤️")
let fruitObservable = Observable.from(["🍎", "🍐", "🍊"])
let animalObservable = Observable.of("🐶", "🐱", "🐭", "🐹")
[stringObservable, fruitObservable, animalObservable].combineLatest {
"\($0[0]) \($0[1]) \($0[2])"
}
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
> The `combineLatest` extension on `Array` requires that all source `Observable` sequences are of the same type.
----
## `switchLatest`
Transforms the elements emitted by an `Observable` sequence into `Observable` sequences, and emits elements from the most recent inner `Observable` sequence. [More info](http://reactivex.io/documentation/operators/switch.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/switch.png)
*/
example("switchLatest") {
let disposeBag = DisposeBag()
let subject1 = BehaviorSubject(value: "⚽️")
let subject2 = BehaviorSubject(value: "🍎")
let variable = Variable(subject1)
variable.asObservable()
.switchLatest()
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
subject1.onNext("🏈")
subject1.onNext("🏀")
variable.value = subject2
subject1.onNext("⚾️")
subject2.onNext("🍐")
}
/*:
> In this example, adding onto `subject1` after setting `variable.value` to `subject2` has no effect, because only the most recent inner `Observable` sequence (`subject2`) will emit elements.
*/
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,133 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxSwift
playgroundShouldContinueIndefinitely()
/*:
## Connectable Operators
Connectable `Observable` sequences resembles ordinary `Observable` sequences, except that they not begin emitting elements when subscribed to, but instead, only when their `connect()` method is called. In this way, you can wait for all intended subscribers to subscribe to a connectable `Observable` sequence before it begins emitting elements.
> Within each example on this page is a commented-out method. Uncomment that method to run the example, and then comment it out again to stop running the example.
#
Before learning about connectable operators, let's take a look at an example of a non-connectable operator:
*/
func sampleWithoutConnectableOperators() {
printExampleHeader(#function)
let interval = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
_ = interval
.subscribe(onNext: { print("Subscription: 1, Event: \($0)") })
delay(5) {
_ = interval
.subscribe(onNext: { print("Subscription: 2, Event: \($0)") })
}
}
//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)
![](http://reactivex.io/documentation/operators/images/interval.c.png)
----
## `publish`
Converts the source `Observable` sequence into a connectable sequence. [More info](http://reactivex.io/documentation/operators/publish.html)
![](http://reactivex.io/documentation/operators/images/publishConnect.c.png)
*/
func sampleWithPublish() {
printExampleHeader(#function)
let intSequence = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
.publish()
_ = intSequence
.subscribe(onNext: { print("Subscription 1:, Event: \($0)") })
delay(2) { _ = intSequence.connect() }
delay(4) {
_ = intSequence
.subscribe(onNext: { print("Subscription 2:, Event: \($0)") })
}
delay(6) {
_ = intSequence
.subscribe(onNext: { print("Subscription 3:, Event: \($0)") })
}
}
//sampleWithPublish() // Uncomment to run this example; comment to stop running
//: > Schedulers are an abstraction of mechanisms for performing work, such as on specific threads or dispatch queues. [More info](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Schedulers.md)
/*:
----
## `replay`
Converts the source `Observable` sequence into a connectable sequence, and will replay `bufferSize` number of previous emissions to each new subscriber. [More info](http://reactivex.io/documentation/operators/replay.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/replay.png)
*/
func sampleWithReplayBuffer() {
printExampleHeader(#function)
let intSequence = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
.replay(5)
_ = intSequence
.subscribe(onNext: { print("Subscription 1:, Event: \($0)") })
delay(2) { _ = intSequence.connect() }
delay(4) {
_ = intSequence
.subscribe(onNext: { print("Subscription 2:, Event: \($0)") })
}
delay(8) {
_ = intSequence
.subscribe(onNext: { print("Subscription 3:, Event: \($0)") })
}
}
// sampleWithReplayBuffer() // Uncomment to run this example; comment to stop running
/*:
----
## `multicast`
Converts the source `Observable` sequence into a connectable sequence, and broadcasts its emissions via the specified `subject`.
*/
func sampleWithMulticast() {
printExampleHeader(#function)
let subject = PublishSubject<Int>()
_ = subject
.subscribe(onNext: { print("Subject: \($0)") })
let intSequence = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
.multicast(subject)
_ = intSequence
.subscribe(onNext: { print("\tSubscription 1:, Event: \($0)") })
delay(2) { _ = intSequence.connect() }
delay(4) {
_ = intSequence
.subscribe(onNext: { print("\tSubscription 2:, Event: \($0)") })
}
delay(6) {
_ = intSequence
.subscribe(onNext: { print("\tSubscription 3:, Event: \($0)") })
}
}
//sampleWithMulticast() // Uncomment to run this example; comment to stop running
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,212 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxSwift
/*:
# Creating and Subscribing to `Observable`s
There are several ways to create and subscribe to `Observable` sequences.
## never
Creates a sequence that never terminates and never emits any events. [More info](http://reactivex.io/documentation/operators/empty-never-throw.html)
*/
example("never") {
let disposeBag = DisposeBag()
let neverSequence = Observable<String>.never()
let neverSequenceSubscription = neverSequence
.subscribe { _ in
print("This will never be printed")
}
neverSequenceSubscription.addDisposableTo(disposeBag)
}
/*:
----
## empty
Creates an empty `Observable` sequence that only emits a Completed event. [More info](http://reactivex.io/documentation/operators/empty-never-throw.html)
*/
example("empty") {
let disposeBag = DisposeBag()
Observable<Int>.empty()
.subscribe { event in
print(event)
}
.addDisposableTo(disposeBag)
}
/*:
> This example also introduces chaining together creating and subscribing to an `Observable` sequence.
----
## just
Creates an `Observable` sequence with a single element. [More info](http://reactivex.io/documentation/operators/just.html)
*/
example("just") {
let disposeBag = DisposeBag()
Observable.just("🔴")
.subscribe { event in
print(event)
}
.addDisposableTo(disposeBag)
}
/*:
----
## of
Creates an `Observable` sequence with a fixed number of elements.
*/
example("of") {
let disposeBag = DisposeBag()
Observable.of("🐶", "🐱", "🐭", "🐹")
.subscribe(onNext: { element in
print(element)
})
.addDisposableTo(disposeBag)
}
/*:
> 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) },
onError: { print("Error:", $0) },
onCompleted: { print("Completed") },
onDisposed: { print("Disposed") }
)
```
----
## from
Creates an `Observable` sequence from a `SequenceType`, such as an `Array`, `Dictionary`, or `Set`.
*/
example("from") {
let disposeBag = DisposeBag()
Observable.from(["🐶", "🐱", "🐭", "🐹"])
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
> This example also demonstrates using the default argument name `$0` instead of explicitly naming the argument.
----
## create
Creates a custom `Observable` sequence. [More info](http://reactivex.io/documentation/operators/create.html)
*/
example("create") {
let disposeBag = DisposeBag()
let myJust = { (element: String) -> Observable<String> in
return Observable.create { observer in
observer.on(.next(element))
observer.on(.completed)
return Disposables.create()
}
}
myJust("🔴")
.subscribe { print($0) }
.addDisposableTo(disposeBag)
}
/*:
----
## range
Creates an `Observable` sequence that emits a range of sequential integers and then terminates. [More info](http://reactivex.io/documentation/operators/range.html)
*/
example("range") {
let disposeBag = DisposeBag()
Observable.range(start: 1, count: 10)
.subscribe { print($0) }
.addDisposableTo(disposeBag)
}
/*:
----
## repeatElement
Creates an `Observable` sequence that emits the given element indefinitely. [More info](http://reactivex.io/documentation/operators/repeat.html)
*/
example("repeatElement") {
let disposeBag = DisposeBag()
Observable.repeatElement("🔴")
.take(3)
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
> This example also introduces using the `take` operator to return a specified number of elements from the start of a sequence.
----
## generate
Creates an `Observable` sequence that generates values for as long as the provided condition evaluates to `true`.
*/
example("generate") {
let disposeBag = DisposeBag()
Observable.generate(
initialState: 0,
condition: { $0 < 3 },
iterate: { $0 + 1 }
)
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## deferred
Creates a new `Observable` sequence for each subscriber. [More info](http://reactivex.io/documentation/operators/defer.html)
*/
example("deferred") {
let disposeBag = DisposeBag()
var count = 1
let deferredSequence = Observable<String>.deferred {
print("Creating \(count)")
count += 1
return Observable.create { observer in
print("Emitting...")
observer.onNext("🐶")
observer.onNext("🐱")
observer.onNext("🐵")
return Disposables.create()
}
}
deferredSequence
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
deferredSequence
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## error
Creates an `Observable` sequence that emits no items and immediately terminates with an error.
*/
example("error") {
let disposeBag = DisposeBag()
Observable<Int>.error(TestError.test)
.subscribe { print($0) }
.addDisposableTo(disposeBag)
}
/*:
----
## doOn
Invokes a side-effect action for each emitted event and returns (passes through) the original event. [More info](http://reactivex.io/documentation/operators/do.html)
*/
example("doOn") {
let disposeBag = DisposeBag()
Observable.of("🍎", "🍐", "🍊", "🍋")
.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.
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,83 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxSwift
/*:
# Debugging Operators
Operators to help debug Rx code.
## `debug`
Prints out all subscriptions, events, and disposals.
*/
example("debug") {
let disposeBag = DisposeBag()
var count = 1
let sequenceThatErrors = Observable<String>.create { observer in
observer.onNext("🍎")
observer.onNext("🍐")
observer.onNext("🍊")
if count < 5 {
observer.onError(TestError.test)
print("Error encountered")
count += 1
}
observer.onNext("🐶")
observer.onNext("🐱")
observer.onNext("🐭")
observer.onCompleted()
return Disposables.create()
}
sequenceThatErrors
.retry(3)
.debug()
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `RxSwift.resourceCount`
Provides a count of all Rx resource allocations, which is useful for detecting leaks during development.
*/
#if NOT_IN_PLAYGROUND
#else
example("RxSwift.resourceCount") {
print(RxSwift.resourceCount)
let disposeBag = DisposeBag()
print(RxSwift.resourceCount)
let variable = Variable("🍎")
let subscription1 = variable.asObservable().subscribe(onNext: { print($0) })
print(RxSwift.resourceCount)
let subscription2 = variable.asObservable().subscribe(onNext: { print($0) })
print(RxSwift.resourceCount)
subscription1.dispose()
print(RxSwift.resourceCount)
subscription2.dispose()
print(RxSwift.resourceCount)
}
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.
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,30 @@
//: [Back](@previous)
/*:
Follow these instructions to enable `RxSwift.resourceCount` in your project:
#
**CocoaPods**
1. Add a `post_install` hook to your Podfile, e.g.:
```
target 'AppTarget' do
pod 'RxSwift'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'RxSwift'
target.build_configurations.each do |config|
if config.name == 'Debug'
config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
end
end
end
end
end
```
2. Run `pod update`.
3. Build project (**Product** **Build**).
#
**Carthage**
1. Run `carthage build --configuration Debug`.
2. Build project (**Product** **Build**).
*/

View File

@ -0,0 +1,131 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxSwift
/*:
# Error Handling Operators
Operators that help to recover from error notifications from an Observable.
## `catchErrorJustReturn`
Recovers from an Error event by returning an `Observable` sequence that emits a single element and then terminates. [More info](http://reactivex.io/documentation/operators/catch.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/catch.png)
*/
example("catchErrorJustReturn") {
let disposeBag = DisposeBag()
let sequenceThatFails = PublishSubject<String>()
sequenceThatFails
.catchErrorJustReturn("😊")
.subscribe { print($0) }
.addDisposableTo(disposeBag)
sequenceThatFails.onNext("😬")
sequenceThatFails.onNext("😨")
sequenceThatFails.onNext("😡")
sequenceThatFails.onNext("🔴")
sequenceThatFails.onError(TestError.test)
}
/*:
----
## `catchError`
Recovers from an Error event by switching to the provided recovery `Observable` sequence. [More info](http://reactivex.io/documentation/operators/catch.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/catch.png)
*/
example("catchError") {
let disposeBag = DisposeBag()
let sequenceThatFails = PublishSubject<String>()
let recoverySequence = PublishSubject<String>()
sequenceThatFails
.catchError {
print("Error:", $0)
return recoverySequence
}
.subscribe { print($0) }
.addDisposableTo(disposeBag)
sequenceThatFails.onNext("😬")
sequenceThatFails.onNext("😨")
sequenceThatFails.onNext("😡")
sequenceThatFails.onNext("🔴")
sequenceThatFails.onError(TestError.test)
recoverySequence.onNext("😊")
}
/*:
----
## `retry`
Recovers repeatedly Error events by resubscribing to the `Observable` sequence, indefinitely. [More info](http://reactivex.io/documentation/operators/retry.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/retry.png)
*/
example("retry") {
let disposeBag = DisposeBag()
var count = 1
let sequenceThatErrors = Observable<String>.create { observer in
observer.onNext("🍎")
observer.onNext("🍐")
observer.onNext("🍊")
if count == 1 {
observer.onError(TestError.test)
print("Error encountered")
count += 1
}
observer.onNext("🐶")
observer.onNext("🐱")
observer.onNext("🐭")
observer.onCompleted()
return Disposables.create()
}
sequenceThatErrors
.retry()
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `retry(_:)`
Recovers repeatedly from Error events by resubscribing to the `Observable` sequence, up to `maxAttemptCount` number of retries. [More info](http://reactivex.io/documentation/operators/retry.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/retry.png)
*/
example("retry maxAttemptCount") {
let disposeBag = DisposeBag()
var count = 1
let sequenceThatErrors = Observable<String>.create { observer in
observer.onNext("🍎")
observer.onNext("🍐")
observer.onNext("🍊")
if count < 5 {
observer.onError(TestError.test)
print("Error encountered")
count += 1
}
observer.onNext("🐶")
observer.onNext("🐱")
observer.onNext("🐭")
observer.onCompleted()
return Disposables.create()
}
sequenceThatErrors
.retry(3)
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,231 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxSwift
/*:
# Filtering and Conditional Operators
Operators that selectively emit elements from a source `Observable` sequence.
## `filter`
Emits only those elements from an `Observable` sequence that meet the specified condition. [More info](http://reactivex.io/documentation/operators/filter.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/filter.png)
*/
example("filter") {
let disposeBag = DisposeBag()
Observable.of(
"🐱", "🐰", "🐶",
"🐸", "🐱", "🐰",
"🐹", "🐸", "🐱")
.filter {
$0 == "🐱"
}
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `distinctUntilChanged`
Suppresses sequential duplicate elements emitted by an `Observable` sequence. [More info](http://reactivex.io/documentation/operators/distinct.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/distinct.png)
*/
example("distinctUntilChanged") {
let disposeBag = DisposeBag()
Observable.of("🐱", "🐷", "🐱", "🐱", "🐱", "🐵", "🐱")
.distinctUntilChanged()
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `elementAt`
Emits only the element at the specified index of all elements emitted by an `Observable` sequence. [More info](http://reactivex.io/documentation/operators/elementat.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/elementat.png)
*/
example("elementAt") {
let disposeBag = DisposeBag()
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
.elementAt(3)
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `single`
Emits only the first element (or the first element that meets a condition) emitted by an `Observable` sequence. Will throw an error if the `Observable` sequence does not emit exactly one element.
*/
example("single") {
let disposeBag = DisposeBag()
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
.single()
.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) }
.addDisposableTo(disposeBag)
}
/*:
----
## `take`
Emits only the specified number of elements from the beginning of an `Observable` sequence. [More info](http://reactivex.io/documentation/operators/take.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/take.png)
*/
example("take") {
let disposeBag = DisposeBag()
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
.take(3)
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `takeLast`
Emits only the specified number of elements from the end of an `Observable` sequence. [More info](http://reactivex.io/documentation/operators/takelast.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/takelast.png)
*/
example("takeLast") {
let disposeBag = DisposeBag()
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
.takeLast(3)
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `takeWhile`
Emits elements from the beginning of an `Observable` sequence as long as the specified condition evaluates to `true`. [More info](http://reactivex.io/documentation/operators/takewhile.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/takewhile.png)
*/
example("takeWhile") {
let disposeBag = DisposeBag()
Observable.of(1, 2, 3, 4, 5, 6)
.takeWhile { $0 < 4 }
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `takeUntil`
Emits elements from a source `Observable` sequence until a reference `Observable` sequence emits an element. [More info](http://reactivex.io/documentation/operators/takeuntil.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/takeuntil.png)
*/
example("takeUntil") {
let disposeBag = DisposeBag()
let sourceSequence = PublishSubject<String>()
let referenceSequence = PublishSubject<String>()
sourceSequence
.takeUntil(referenceSequence)
.subscribe { print($0) }
.addDisposableTo(disposeBag)
sourceSequence.onNext("🐱")
sourceSequence.onNext("🐰")
sourceSequence.onNext("🐶")
referenceSequence.onNext("🔴")
sourceSequence.onNext("🐸")
sourceSequence.onNext("🐷")
sourceSequence.onNext("🐵")
}
/*:
----
## `skip`
Suppresses emitting the specified number of elements from the beginning of an `Observable` sequence. [More info](http://reactivex.io/documentation/operators/skip.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/skip.png)
*/
example("skip") {
let disposeBag = DisposeBag()
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
.skip(2)
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `skipWhile`
Suppresses emitting the elements from the beginning of an `Observable` sequence that meet the specified condition. [More info](http://reactivex.io/documentation/operators/skipwhile.html)
![](http://reactivex.io/documentation/operators/images/skipWhile.c.png)
*/
example("skipWhile") {
let disposeBag = DisposeBag()
Observable.of(1, 2, 3, 4, 5, 6)
.skipWhile { $0 < 4 }
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `skipWhileWithIndex`
Suppresses emitting the elements from the beginning of an `Observable` sequence that meet the specified condition, and emits the remaining elements. The closure is also passed each element's index.
*/
example("skipWhileWithIndex") {
let disposeBag = DisposeBag()
Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵")
.skipWhileWithIndex { element, index in
index < 3
}
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `skipUntil`
Suppresses emitting the elements from a source `Observable` sequence until a reference `Observable` sequence emits an element. [More info](http://reactivex.io/documentation/operators/skipuntil.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/skipuntil.png)
*/
example("skipUntil") {
let disposeBag = DisposeBag()
let sourceSequence = PublishSubject<String>()
let referenceSequence = PublishSubject<String>()
sourceSequence
.skipUntil(referenceSequence)
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
sourceSequence.onNext("🐱")
sourceSequence.onNext("🐰")
sourceSequence.onNext("🐶")
referenceSequence.onNext("🔴")
sourceSequence.onNext("🐸")
sourceSequence.onNext("🐷")
sourceSequence.onNext("🐵")
}
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,85 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous)
*/
import RxSwift
/*:
# Introduction
## Why use RxSwift?
A vast majority of the code we write involves responding to external events. When a user manipulates a control, we need to write an `@IBAction` handler to respond. We need to observe notifications to detect when the keyboard changes position. We must provide closures to execute when URL sessions respond with data. And we use KVO to detect changes to variables.
All of these various systems makes our code needlessly complex. Wouldn't it be better if there was one consistent system that handled all of our call/response code? Rx is such a system.
RxSwift is the official implementation of [Reactive Extensions](http://reactivex.io) (aka Rx), which exist for [most major languages and platforms](http://reactivex.io/languages.html).
*/
/*:
## Concepts
**Every `Observable` instance is just a sequence.**
The key advantage for an `Observable` sequence vs. Swift's `SequenceType` is that it can also receive elements asynchronously. _This is the essence of RxSwift._ Everything else expands upon this concept.
* An `Observable` (`ObservableType`) is equivalent to a `SequenceType`.
* The `ObservableType.subscribe(_:)` method is equivalent to `SequenceType.generate()`.
* `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.
Sequence grammar explains this more concisely:
`next* (error | completed)?`
And this can also be explained more visually using diagrams:
`--1--2--3--4--5--6--|----> // "|" = Terminates normally`
`--a--b--c--d--e--f--X----> // "X" = Terminates with an error`
`--tap--tap----------tap--> // "|" = Continues indefinitely, such as a sequence of button taps`
> These diagrams are called marble diagrams. You can learn more about them at [RxMarbles.com](http://rxmarbles.com).
*/
/*:
### Observables and observers (aka subscribers)
`Observable`s will not execute their subscription closure unless there is a subscriber. In the following example, the closure of the `Observable` will never be executed, because there are no subscribers:
*/
example("Observable with no subscribers") {
_ = Observable<String>.create { observerOfString -> Disposable in
print("This will never be printed")
observerOfString.on(.next("😬"))
observerOfString.on(.completed)
return Disposables.create()
}
}
/*:
----
In the following example, the closure will be executed when `subscribe(_:)` is called:
*/
example("Observable with subscriber") {
_ = Observable<String>.create { observerOfString in
print("Observable created")
observerOfString.on(.next("😉"))
observerOfString.on(.completed)
return Disposables.create()
}
.subscribe { event in
print(event)
}
}
/*:
> Don't concern yourself with the details of how these `Observable`s were created in these examples. We'll get into that [next](@next).
#
> `subscribe(_:)` returns a `Disposable` instance that represents a disposable resource such as a subscription. It was ignored in the previous simple example, but it should normally be properly handled. This usually means adding it to a `DisposeBag` instance. All examples going forward will include proper handling, because, well, practice makes _permanent_ 🙂. You can learn more about this in the [Disposing section](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/GettingStarted.md#disposing) of the [Getting Started guide](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/GettingStarted.md).
*/
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,72 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxSwift
/*:
# Mathematical and Aggregate Operators
Operators that operate on the entire sequence of items emitted by an `Observable`.
## `toArray`
Converts an `Observable` sequence into an array, emits that array as a new single-element `Observable` sequence, and then terminates. [More info](http://reactivex.io/documentation/operators/to.html)
![](http://reactivex.io/documentation/operators/images/to.c.png)
*/
example("toArray") {
let disposeBag = DisposeBag()
Observable.range(start: 1, count: 10)
.toArray()
.subscribe { print($0) }
.addDisposableTo(disposeBag)
}
/*:
----
## `reduce`
Begins with an initial seed value, and then applies an accumulator closure to all elements emitted by an `Observable` sequence, and returns the aggregate result as a single-element `Observable` sequence. [More info](http://reactivex.io/documentation/operators/reduce.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/reduce.png)
*/
example("reduce") {
let disposeBag = DisposeBag()
Observable.of(10, 100, 1000)
.reduce(1, accumulator: +)
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `concat`
Joins elements from inner `Observable` sequences of an `Observable` sequence in a sequential manner, waiting for each sequence to terminate successfully before emitting elements from the next sequence. [More info](http://reactivex.io/documentation/operators/concat.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/concat.png)
*/
example("concat") {
let disposeBag = DisposeBag()
let subject1 = BehaviorSubject(value: "🍎")
let subject2 = BehaviorSubject(value: "🐶")
let variable = Variable(subject1)
variable.asObservable()
.concat()
.subscribe { print($0) }
.addDisposableTo(disposeBag)
subject1.onNext("🍐")
subject1.onNext("🍊")
variable.value = subject2
subject2.onNext("I would be ignored")
subject2.onNext("🐱")
subject1.onCompleted()
subject2.onNext("🐭")
}
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,21 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
## Table of Contents:
1. [Introduction](Introduction)
1. [Creating and Subscribing to Observables](Creating_and_Subscribing_to_Observables)
1. [Working with Subjects](Working_with_Subjects)
1. [Combining Operators](Combining_Operators)
1. [Transforming Operators](Transforming_Operators)
1. [Filtering and Conditional Operators](Filtering_and_Conditional_Operators)
1. [Mathematical and Aggregate Operators](Mathematical_and_Aggregate_Operators)
1. [Connectable Operators](Connectable_Operators)
1. [Error Handling Operators](Error_Handling_Operators)
1. [Debugging Operators](Debugging_Operators)
*/
//: [Next](@next)

View File

@ -0,0 +1,78 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxSwift
/*:
# Transforming Operators
Operators that transform Next event elements emitted by an `Observable` sequence.
## `map`
Applies a transforming closure to elements emitted by an `Observable` sequence, and returns a new `Observable` sequence of the transformed elements. [More info](http://reactivex.io/documentation/operators/map.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/map.png)
*/
example("map") {
let disposeBag = DisposeBag()
Observable.of(1, 2, 3)
.map { $0 * $0 }
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
/*:
----
## `flatMap` and `flatMapLatest`
Transforms the elements emitted by an `Observable` sequence into `Observable` sequences, and merges the emissions from both `Observable` sequences into a single `Observable` sequence. This is also useful when, for example, when you have an `Observable` sequence that itself emits `Observable` sequences, and you want to be able to react to new emissions from either `Observable` sequence. The difference between `flatMap` and `flatMapLatest` is, `flatMapLatest` will only emit elements from the most recent inner `Observable` sequence. [More info](http://reactivex.io/documentation/operators/flatmap.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/flatmap.png)
*/
example("flatMap and flatMapLatest") {
let disposeBag = DisposeBag()
struct Player {
var score: Variable<Int>
}
let 👦🏻 = Player(score: Variable(80))
let 👧🏼 = Player(score: Variable(90))
let player = Variable(👦🏻)
player.asObservable()
.flatMap { $0.score.asObservable() } // Change flatMap to flatMapLatest and observe change in printed output
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
👦🏻.score.value = 85
player.value = 👧🏼
👦🏻.score.value = 95 // Will be printed when using flatMap, but will not be printed when using flatMapLatest
👧🏼.score.value = 100
}
/*:
> In this example, using `flatMap` may have unintended consequences. After assigning 👧🏼 to `player.value`, `👧🏼.score` will begin to emit elements, but the previous inner `Observable` sequence (`👦🏻.score`) will also still emit elements. By changing `flatMap` to `flatMapLatest`, only the most recent inner `Observable` sequence (`👧🏼.score`) will emit elements, i.e., setting `👦🏻.score.value` to `95` has no effect.
#
> `flatMapLatest` is actually a combination of the `map` and `switchLatest` operators.
*/
/*:
----
## `scan`
Begins with an initial seed value, and then applies an accumulator closure to each element emitted by an `Observable` sequence, and returns each intermediate result as a single-element `Observable` sequence. [More info](http://reactivex.io/documentation/operators/scan.html)
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/scan.png)
*/
example("scan") {
let disposeBag = DisposeBag()
Observable.of(10, 100, 1000)
.scan(1) { aggregateValue, newValue in
aggregateValue + newValue
}
.subscribe(onNext: { print($0) })
.addDisposableTo(disposeBag)
}
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,110 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxSwift-OSX** scheme (**Product** **Build**).
1. Open **Rx** playground in the **Project navigator**.
1. Show the Debug Area (**View** **Debug Area** **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxSwift
/*:
# Working with Subjects
A Subject is a sort of bridge or proxy that is available in some implementations of Rx that acts as both an observer and `Observable`. Because it is an observer, it can subscribe to one or more `Observable`s, and because it is an `Observable`, it can pass through the items it observes by reemitting them, and it can also emit new items. [More info](http://reactivex.io/documentation/subject.html)
*/
extension ObservableType {
/**
Add observer with `id` and print each emitted event.
- parameter id: an identifier for the subscription.
*/
func addObserver(_ id: String) -> Disposable {
return subscribe { print("Subscription:", id, "Event:", $0) }
}
}
func writeSequenceToConsole<O: ObservableType>(name: String, sequence: O) -> Disposable {
return sequence.subscribe { event in
print("Subscription: \(name), event: \(event)")
}
}
/*:
## PublishSubject
Broadcasts new events to all observers as of their time of the subscription.
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/publishsubject.png "PublishSubject")
*/
example("PublishSubject") {
let disposeBag = DisposeBag()
let subject = PublishSubject<String>()
subject.addObserver("1").addDisposableTo(disposeBag)
subject.onNext("🐶")
subject.onNext("🐱")
subject.addObserver("2").addDisposableTo(disposeBag)
subject.onNext("🅰️")
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.
----
## ReplaySubject
Broadcasts new events to all subscribers, and the specified `bufferSize` number of previous events to new subscribers.
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/replaysubject.png)
*/
example("ReplaySubject") {
let disposeBag = DisposeBag()
let subject = ReplaySubject<String>.create(bufferSize: 1)
subject.addObserver("1").addDisposableTo(disposeBag)
subject.onNext("🐶")
subject.onNext("🐱")
subject.addObserver("2").addDisposableTo(disposeBag)
subject.onNext("🅰️")
subject.onNext("🅱️")
}
/*:
----
## BehaviorSubject
Broadcasts new events to all subscribers, and the most recent (or initial) value to new subscribers.
![](https://raw.githubusercontent.com/kzaher/rxswiftcontent/master/MarbleDiagrams/png/behaviorsubject.png)
*/
example("BehaviorSubject") {
let disposeBag = DisposeBag()
let subject = BehaviorSubject(value: "🔴")
subject.addObserver("1").addDisposableTo(disposeBag)
subject.onNext("🐶")
subject.onNext("🐱")
subject.addObserver("2").addDisposableTo(disposeBag)
subject.onNext("🅰️")
subject.onNext("🅱️")
subject.addObserver("3").addDisposableTo(disposeBag)
subject.onNext("🍐")
subject.onNext("🍊")
}
/*:
> Notice what's missing in these previous examples? A Completed event. `PublishSubject`, `ReplaySubject`, and `BehaviorSubject` do not automatically emit Completed events when they are about to be disposed of.
----
## Variable
Wraps a `BehaviorSubject`, so it will emit the most recent (or initial) value to new subscribers. And `Variable` also maintains current value state. `Variable` will never emit an Error event. However, it will automatically emit a Completed event and terminate on `deinit`.
*/
example("Variable") {
let disposeBag = DisposeBag()
let variable = Variable("🔴")
variable.asObservable().addObserver("1").addDisposableTo(disposeBag)
variable.value = "🐶"
variable.value = "🐱"
variable.asObservable().addObserver("2").addDisposableTo(disposeBag)
variable.value = "🅰️"
variable.value = "🅱️"
}
//: > Call `asObservable()` on a `Variable` instance in order to access its underlying `BehaviorSubject` sequence. `Variable`s do not implement the `on` operator (or, e.g., `onNext(_:)`), but instead expose a `value` property that can be used to get the current value, and also set a new value. Setting a new value will also add that value onto its underlying `BehaviorSubject` sequence.
//: [Next](@next) - [Table of Contents](Table_of_Contents)

View File

@ -0,0 +1,47 @@
import Foundation
/**
Encloses each code example in its own scope. Prints a `description` header and then executes the `action` closure.
- parameter description: example description
- parameter action: `Void` closure
*/
public func example(_ description: String, action: (Void) -> Void) {
printExampleHeader(description)
action()
}
public func printExampleHeader(_ description: String) {
print("\n--- \(description) example ---")
}
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: @escaping (Void) -> Void) {
let delayTime = DispatchTime.now() + DispatchTimeInterval.seconds(Int(delay))
DispatchQueue.main.asyncAfter(deadline: delayTime) {
closure()
}
}
#if NOT_IN_PLAYGROUND
public func playgroundShouldContinueIndefinitely() { }
#else
import PlaygroundSupport
public func playgroundShouldContinueIndefinitely() {
PlaygroundPage.current.needsIndefiniteExecution = true
}
#endif

View File

@ -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 ",
}
]

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='6.0' target-platform='osx' display-mode='raw' last-migration='0800'>
<pages>
<page name='Table_of_Contents'/>
<page name='Introduction'/>
<page name='Creating_and_Subscribing_to_Observables'/>
<page name='Working_with_Subjects'/>
<page name='Combining_Operators'/>
<page name='Transforming_Operators'/>
<page name='Filtering_and_Conditional_Operators'/>
<page name='Mathematical_and_Aggregate_Operators'/>
<page name='Connectable_Operators'/>
<page name='Error_Handling_Operators'/>
<page name='Debugging_Operators'/>
<page name='Enable_RxSwift.resourceCount'/>
</pages>
</playground>

6328
Rx.xcodeproj/project.pbxproj Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:Tests.xcodeproj">
location = "self:Rx.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,56 +14,59 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8CDD7B91B52AF290043F0C5"
BlueprintIdentifier = "C8093BC91B8A71FC0088E94D"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-OSX"
ReferencedContainer = "container:RxBlocking.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8CDD7B91B52AF290043F0C5"
BlueprintIdentifier = "C8093BC91B8A71FC0088E94D"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-OSX"
ReferencedContainer = "container:RxBlocking.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8CDD7B91B52AF290043F0C5"
BlueprintIdentifier = "C8093BC91B8A71FC0088E94D"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-OSX"
ReferencedContainer = "container:RxBlocking.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,79 +14,59 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8CDD7951B52ADC00043F0C5"
BlueprintIdentifier = "C8093B4B1B8A71F00088E94D"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-iOS"
ReferencedContainer = "container:RxBlocking.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8CDD7A01B52ADC00043F0C5"
BuildableName = "RxBlockingTests.xctest"
BlueprintName = "RxBlockingTests"
ReferencedContainer = "container:RxBlocking.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8CDD7951B52ADC00043F0C5"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-iOS"
ReferencedContainer = "container:RxBlocking.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8CDD7951B52ADC00043F0C5"
BlueprintIdentifier = "C8093B4B1B8A71F00088E94D"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-iOS"
ReferencedContainer = "container:RxBlocking.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8CDD7951B52ADC00043F0C5"
BlueprintIdentifier = "C8093B4B1B8A71F00088E94D"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-iOS"
ReferencedContainer = "container:RxBlocking.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,69 +14,61 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8297E2D1B6CF905000589EA"
BuildableName = "RxExample-iOS-no-module.app"
BlueprintName = "RxExample-iOS-no-module"
ReferencedContainer = "container:RxExample.xcodeproj">
BlueprintIdentifier = "D2EBEB801BB9B99D003A27DC"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8297E2D1B6CF905000589EA"
BuildableName = "RxExample-iOS-no-module.app"
BlueprintName = "RxExample-iOS-no-module"
ReferencedContainer = "container:RxExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8297E2D1B6CF905000589EA"
BuildableName = "RxExample-iOS-no-module.app"
BlueprintName = "RxExample-iOS-no-module"
ReferencedContainer = "container:RxExample.xcodeproj">
BlueprintIdentifier = "D2EBEB801BB9B99D003A27DC"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8297E2D1B6CF905000589EA"
BuildableName = "RxExample-iOS-no-module.app"
BlueprintName = "RxExample-iOS-no-module"
ReferencedContainer = "container:RxExample.xcodeproj">
BlueprintIdentifier = "D2EBEB801BB9B99D003A27DC"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8F0C04D1BBBFBCE001B112F"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-watchOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8F0C04D1BBBFBCE001B112F"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-watchOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8F0C04D1BBBFBCE001B112F"
BuildableName = "RxBlocking.framework"
BlueprintName = "RxBlocking-watchOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,56 +14,59 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB8731B07E6130064D411"
BlueprintIdentifier = "C809396F1B8A71840088E94D"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-OSX"
ReferencedContainer = "container:RxCocoa.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB8731B07E6130064D411"
BlueprintIdentifier = "C809396F1B8A71840088E94D"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-OSX"
ReferencedContainer = "container:RxCocoa.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB8731B07E6130064D411"
BlueprintIdentifier = "C809396F1B8A71840088E94D"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-OSX"
ReferencedContainer = "container:RxCocoa.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,56 +14,59 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81553DD1A98AB4A00C63152"
BlueprintIdentifier = "C80938F51B8A71760088E94D"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-iOS"
ReferencedContainer = "container:RxCocoa.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81553DD1A98AB4A00C63152"
BlueprintIdentifier = "C80938F51B8A71760088E94D"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-iOS"
ReferencedContainer = "container:RxCocoa.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81553DD1A98AB4A00C63152"
BlueprintIdentifier = "C80938F51B8A71760088E94D"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-iOS"
ReferencedContainer = "container:RxCocoa.xcodeproj">
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2138C741BB9BE9800339B5C"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2138C741BB9BE9800339B5C"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2138C741BB9BE9800339B5C"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8F0C0041BBBFBB9001B112F"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-watchOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8F0C0041BBBFBB9001B112F"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-watchOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8F0C0041BBBFBB9001B112F"
BuildableName = "RxCocoa.framework"
BlueprintName = "RxCocoa-watchOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.8">
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
@ -9,54 +9,54 @@
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C811081F1AF50E11001C13E4"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-iOS"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C88BB81A1B07E5ED0064D411"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-OSX"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C811081F1AF50E11001C13E4"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-iOS"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C83509931C38742C0027C24C"
BuildableName = "AllTests-OSX.xctest"
BlueprintName = "AllTests-OSX"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C811081F1AF50E11001C13E4"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-iOS"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C88BB81A1B07E5ED0064D411"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-OSX"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release-Tests"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
@ -64,28 +64,28 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C811081F1AF50E11001C13E4"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-iOS"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C88BB81A1B07E5ED0064D411"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-OSX"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C811081F1AF50E11001C13E4"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-iOS"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C88BB81A1B07E5ED0064D411"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-OSX"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -9,80 +9,83 @@
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB88F1B07E64B0064D411"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-OSX"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C8A56AD61AD7424700B4673B"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-iOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Release">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB88F1B07E64B0064D411"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-OSX"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C83508C21C386F6F0027C24C"
BuildableName = "AllTests-iOS.xctest"
BlueprintName = "AllTests-iOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB88F1B07E64B0064D411"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-OSX"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C8A56AD61AD7424700B4673B"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-iOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB88F1B07E64B0064D411"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-OSX"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C8A56AD61AD7424700B4673B"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-iOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB88F1B07E64B0064D411"
BuildableName = "RxTests.xctest"
BlueprintName = "RxTests-OSX"
ReferencedContainer = "container:RxTests.xcodeproj">
BlueprintIdentifier = "C8A56AD61AD7424700B4673B"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-iOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2EA280B1BB9B5A200880ED3"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C83509831C38740E0027C24C"
BuildableName = "AllTests-tvOS.xctest"
BlueprintName = "AllTests-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2EA280B1BB9B5A200880ED3"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2EA280B1BB9B5A200880ED3"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2EA280B1BB9B5A200880ED3"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-tvOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,56 +14,59 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8A56AD61AD7424700B4673B"
BlueprintIdentifier = "C8F0BF901BBBFB8B001B112F"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-iOS"
ReferencedContainer = "container:RxSwift.xcodeproj">
BlueprintName = "RxSwift-watchOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8A56AD61AD7424700B4673B"
BlueprintIdentifier = "C8F0BF901BBBFB8B001B112F"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-iOS"
ReferencedContainer = "container:RxSwift.xcodeproj">
BlueprintName = "RxSwift-watchOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8A56AD61AD7424700B4673B"
BlueprintIdentifier = "C8F0BF901BBBFB8B001B112F"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-iOS"
ReferencedContainer = "container:RxSwift.xcodeproj">
BlueprintName = "RxSwift-watchOS"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,56 +14,59 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB81A1B07E5ED0064D411"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-OSX"
ReferencedContainer = "container:RxSwift.xcodeproj">
BlueprintIdentifier = "C88FA50E1C25C4B500CCFEA4"
BuildableName = "RxTests.framework"
BlueprintName = "RxTests-OSX"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB81A1B07E5ED0064D411"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-OSX"
ReferencedContainer = "container:RxSwift.xcodeproj">
BlueprintIdentifier = "C88FA50E1C25C4B500CCFEA4"
BuildableName = "RxTests.framework"
BlueprintName = "RxTests-OSX"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C88BB81A1B07E5ED0064D411"
BuildableName = "RxSwift.framework"
BlueprintName = "RxSwift-OSX"
ReferencedContainer = "container:RxSwift.xcodeproj">
BlueprintIdentifier = "C88FA50E1C25C4B500CCFEA4"
BuildableName = "RxTests.framework"
BlueprintName = "RxTests-OSX"
ReferencedContainer = "container:Rx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>

Some files were not shown because too many files have changed in this diff Show More