From 8b2138d1a3a00bc7fec3a699e14cd7040dc6dd57 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Fri, 2 Oct 2015 23:32:39 +0200 Subject: [PATCH 01/34] Adds alpha.4 changes. --- CHANGELOG.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d686d7e8..77320a5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,32 @@ All notable changes to this project will be documented in this file. --- +## [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` From cf90d2f48640fcdd763bc625d299ca0ccb2d1f94 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Fri, 2 Oct 2015 23:35:28 +0200 Subject: [PATCH 02/34] Release 2.0.0-alpha.4 --- README.md | 2 +- RxBlocking.podspec | 2 +- RxCocoa.podspec | 2 +- RxSwift.podspec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3c89325b..af16a0bf 100644 --- a/README.md +++ b/README.md @@ -474,7 +474,7 @@ $ pod install Add this to `Cartfile` ``` -git "git@github.com:ReactiveX/RxSwift.git" "2.0.0-alpha.3" +git "git@github.com:ReactiveX/RxSwift.git" "2.0.0-alpha.4" ``` ``` diff --git a/RxBlocking.podspec b/RxBlocking.podspec index fdfb7aa5..f7d811f2 100644 --- a/RxBlocking.podspec +++ b/RxBlocking.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxBlocking" - s.version = "2.0.0-alpha.3" + s.version = "2.0.0-alpha.4" s.summary = "RxSwift Blocking operatos" s.description = <<-DESC Set of blocking operators for unit testing diff --git a/RxCocoa.podspec b/RxCocoa.podspec index c2360877..35bd3042 100644 --- a/RxCocoa.podspec +++ b/RxCocoa.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxCocoa" - s.version = "2.0.0-alpha.3" + s.version = "2.0.0-alpha.4" s.summary = "RxSwift Cocoa extensions" s.description = <<-DESC * UI extensions diff --git a/RxSwift.podspec b/RxSwift.podspec index f2c47df8..9a8198ac 100644 --- a/RxSwift.podspec +++ b/RxSwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxSwift" - s.version = "2.0.0-alpha.3" + s.version = "2.0.0-alpha.4" s.summary = "Microsoft Reactive Extensions (Rx) for Swift and iOS/OSX platform" s.description = <<-DESC This is a Swift port of Reactive extensions. From 1a798ddb3131759bdca6e907022f5c6d2491c437 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Sat, 3 Oct 2015 15:55:57 +0200 Subject: [PATCH 03/34] Fixes automation tests, unit tests warnings and example app warnings. --- RxBlocking/Observable+Blocking.swift | 2 +- RxExample/RxExample.xcodeproj/project.pbxproj | 34 +---- RxExample/RxExample/Example.swift | 1 - .../APIWrappersViewController.swift | 8 +- .../Random.xcdatamodel/contents | 10 -- .../RxExample/Examples/Dependencies.swift | 8 +- RxExample/RxExample/OSX/Main.storyboard | 28 +++-- RxExample/RxExample/iOS/Main.storyboard | 119 ++++++++++++++++-- RxTests/RxCocoaTests/KVOObservableTests.swift | 117 ++++++++++------- RxTests/RxCocoaTests/NSObject+RxTests.swift | 18 ++- .../Tests/AnonymousObservable+Test.swift | 6 +- .../RxSwiftTests/Tests/AssumptionsTest.swift | 4 +- .../Tests/DelegateProxyTest.swift | 4 +- .../Tests/Observable+BindingTest.swift | 20 +-- .../Tests/Observable+CreationTest.swift | 2 +- .../Tests/Observable+MultipleTest.swift | 30 ++--- ...rvable+StandardSequenceOperatorsTest.swift | 6 +- .../RxSwiftTests/Tests/ObserverTests.swift | 6 +- scripts/automation-tests.sh | 16 +-- scripts/automation-tests/01_githubSignUp.js | 34 ++--- .../automation-tests/02_searchWikipedia.js | 45 ++++--- scripts/automation-tests/03_masterDetail.js | 18 +-- scripts/automation-tests/04_controlsTests.js | 52 ++++---- .../05_reactivePartialUpdates.js | 14 +-- scripts/automation-tests/common.js | 11 +- scripts/common.sh | 102 +++++---------- scripts/pre-release-tests.sh | 65 +++------- 27 files changed, 377 insertions(+), 403 deletions(-) delete mode 100644 RxExample/RxExample/Examples/CoreData/Random.xcdatamodeld/Random.xcdatamodel/contents diff --git a/RxBlocking/Observable+Blocking.swift b/RxBlocking/Observable+Blocking.swift index 8b5c56cc..799cbf98 100644 --- a/RxBlocking/Observable+Blocking.swift +++ b/RxBlocking/Observable+Blocking.swift @@ -28,7 +28,7 @@ extension ObservableType { var ended = false - self.subscribe { e in + _ = self.subscribe { e in switch e { case .Next(let element): elements.append(element) diff --git a/RxExample/RxExample.xcodeproj/project.pbxproj b/RxExample/RxExample.xcodeproj/project.pbxproj index 7c493ad7..4db198d0 100644 --- a/RxExample/RxExample.xcodeproj/project.pbxproj +++ b/RxExample/RxExample.xcodeproj/project.pbxproj @@ -45,7 +45,6 @@ C8297E481B6CF905000589EA /* Differentiator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88C78941B3F20DB0061C5AB /* Differentiator.swift */; }; C8297E491B6CF905000589EA /* WikipediaSearchCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C46DA51B47F7110020D71E /* WikipediaSearchCell.swift */; }; C8297E4A1B6CF905000589EA /* GitHubSignupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C890A6571AEBD26B00AFF7E6 /* GitHubSignupViewController.swift */; }; - C8297E4B1B6CF905000589EA /* Random.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = C8A57F721B40AF7C00D5570A /* Random.xcdatamodeld */; }; C8297E4C1B6CF905000589EA /* APIWrappersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 075F130F1B4E9D5A000D7861 /* APIWrappersViewController.swift */; }; C8297E4D1B6CF905000589EA /* RxTableViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88C78651B3EB0A00061C5AB /* RxTableViewSectionedReloadDataSource.swift */; }; C8297E4E1B6CF905000589EA /* RxCollectionViewSectionedAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C859B9A91B45CB0900D012D7 /* RxCollectionViewSectionedAnimatedDataSource.swift */; }; @@ -277,7 +276,6 @@ C8A468F11B8A8C2600BF917B /* RxBlocking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8A468EF1B8A8BD000BF917B /* RxBlocking.framework */; }; C8A468F21B8A8C2600BF917B /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8A468ED1B8A8BCC00BF917B /* RxCocoa.framework */; }; C8A468F31B8A8C2600BF917B /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8A468EB1B8A8BC900BF917B /* RxSwift.framework */; }; - C8A57F741B40AF7C00D5570A /* Random.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = C8A57F721B40AF7C00D5570A /* Random.xcdatamodeld */; }; C8A7501F1B94E77C00D8D046 /* RxDataSourceStarterKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A7501E1B94E77C00D8D046 /* RxDataSourceStarterKit.swift */; }; C8A750201B94E78200D8D046 /* RxDataSourceStarterKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A7501E1B94E77C00D8D046 /* RxDataSourceStarterKit.swift */; }; C8C46DA81B47F7110020D71E /* CollectionViewImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C46DA31B47F7110020D71E /* CollectionViewImageCell.swift */; }; @@ -547,7 +545,6 @@ C8A468EB1B8A8BC900BF917B /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C8A468ED1B8A8BCC00BF917B /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C8A468EF1B8A8BD000BF917B /* RxBlocking.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RxBlocking.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C8A57F731B40AF7C00D5570A /* Random.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Random.xcdatamodel; sourceTree = ""; }; C8A7501E1B94E77C00D8D046 /* RxDataSourceStarterKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxDataSourceStarterKit.swift; sourceTree = ""; }; C8AF26F11B49ABD300131C03 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; C8C46DA31B47F7110020D71E /* CollectionViewImageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewImageCell.swift; sourceTree = ""; }; @@ -1075,8 +1072,7 @@ 07E300051B14994500F00100 /* 05 TableView */, 07A5C3D91B70B6B8001EFE5C /* 06 Calculator */, C859B9A21B45C5D900D012D7 /* 07 PartialUpdates */, - C8A57F711B40AF4E00D5570A /* 08 CoreData */, - EC91FB931BBA12E800973245 /* 09 AutoLoading */, + EC91FB931BBA12E800973245 /* 08 AutoLoading */, ); path = Examples; sourceTree = ""; @@ -1162,15 +1158,6 @@ path = DataSources; sourceTree = ""; }; - C8A57F711B40AF4E00D5570A /* 08 CoreData */ = { - isa = PBXGroup; - children = ( - C8A57F721B40AF7C00D5570A /* Random.xcdatamodeld */, - ); - name = "08 CoreData"; - path = CoreData; - sourceTree = ""; - }; C8DF92C71B0B2F84009BCF9A /* iOS */ = { isa = PBXGroup; children = ( @@ -1200,12 +1187,12 @@ path = Introduction; sourceTree = ""; }; - EC91FB931BBA12E800973245 /* 09 AutoLoading */ = { + EC91FB931BBA12E800973245 /* 08 AutoLoading */ = { isa = PBXGroup; children = ( EC91FB941BBA144400973245 /* GitHubSearchRepositoriesViewController.swift */, ); - name = "09 AutoLoading"; + name = "08 AutoLoading"; path = AutoLoading; sourceTree = ""; }; @@ -1489,7 +1476,6 @@ C864099C1BA5909000D3C4E8 /* DisposeBase.swift in Sources */, C8297E4A1B6CF905000589EA /* GitHubSignupViewController.swift in Sources */, C86409F51BA5909000D3C4E8 /* SchedulerType.swift in Sources */, - C8297E4B1B6CF905000589EA /* Random.xcdatamodeld in Sources */, C86409B81BA5909000D3C4E8 /* DelaySubscription.swift in Sources */, C84B3A641BA4345A001B7D88 /* UITextView+Rx.swift in Sources */, C86409AF1BA5909000D3C4E8 /* Catch.swift in Sources */, @@ -1591,7 +1577,6 @@ C88C78951B3F20DB0061C5AB /* Differentiator.swift in Sources */, C8C46DAA1B47F7110020D71E /* WikipediaSearchCell.swift in Sources */, C890A6581AEBD26B00AFF7E6 /* GitHubSignupViewController.swift in Sources */, - C8A57F741B40AF7C00D5570A /* Random.xcdatamodeld in Sources */, 075F13101B4E9D5A000D7861 /* APIWrappersViewController.swift in Sources */, C83367311AD029AE00C668A7 /* Wireframe.swift in Sources */, 07E300071B14995F00F00100 /* TableViewController.swift in Sources */, @@ -1928,19 +1913,6 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ - -/* Begin XCVersionGroup section */ - C8A57F721B40AF7C00D5570A /* Random.xcdatamodeld */ = { - isa = XCVersionGroup; - children = ( - C8A57F731B40AF7C00D5570A /* Random.xcdatamodel */, - ); - currentVersion = C8A57F731B40AF7C00D5570A /* Random.xcdatamodel */; - path = Random.xcdatamodeld; - sourceTree = ""; - versionGroupType = wrapper.xcdatamodel; - }; -/* End XCVersionGroup section */ }; rootObject = C83366D51AD0293800C668A7 /* Project object */; } diff --git a/RxExample/RxExample/Example.swift b/RxExample/RxExample/Example.swift index 4cd910f1..217b107b 100644 --- a/RxExample/RxExample/Example.swift +++ b/RxExample/RxExample/Example.swift @@ -35,7 +35,6 @@ extension String { } } - func showAlert(message: String) { #if os(iOS) UIAlertView(title: "RxExample", message: message, delegate: nil, cancelButtonTitle: "OK").show() diff --git a/RxExample/RxExample/Examples/APIWrappers/APIWrappersViewController.swift b/RxExample/RxExample/Examples/APIWrappers/APIWrappersViewController.swift index 3cfa0b22..4e81e939 100644 --- a/RxExample/RxExample/Examples/APIWrappers/APIWrappersViewController.swift +++ b/RxExample/RxExample/Examples/APIWrappers/APIWrappersViewController.swift @@ -194,11 +194,9 @@ class APIWrappersViewController: ViewController { // MARK: CLLocationManager - if #available(iOS 8.0, *) { - manager.requestWhenInUseAuthorization() - } else { - // Fallback on earlier versions - } + #if !RX_NO_MODULE + manager.requestWhenInUseAuthorization() + #endif manager.rx_didUpdateLocations .subscribeNext { [weak self] x in diff --git a/RxExample/RxExample/Examples/CoreData/Random.xcdatamodeld/Random.xcdatamodel/contents b/RxExample/RxExample/Examples/CoreData/Random.xcdatamodeld/Random.xcdatamodel/contents deleted file mode 100644 index 6b481e21..00000000 --- a/RxExample/RxExample/Examples/CoreData/Random.xcdatamodeld/Random.xcdatamodel/contents +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/RxExample/RxExample/Examples/Dependencies.swift b/RxExample/RxExample/Examples/Dependencies.swift index 8e0bef9b..ef0f02e2 100644 --- a/RxExample/RxExample/Examples/Dependencies.swift +++ b/RxExample/RxExample/Examples/Dependencies.swift @@ -25,11 +25,9 @@ class Dependencies { let operationQueue = NSOperationQueue() operationQueue.maxConcurrentOperationCount = 2 - if #available(iOS 8.0, *) { - operationQueue.qualityOfService = NSQualityOfService.UserInitiated - } else { - // Fallback on earlier versions - } + #if !RX_NO_MODULE + operationQueue.qualityOfService = NSQualityOfService.UserInitiated + #endif backgroundWorkScheduler = OperationQueueScheduler(operationQueue: operationQueue) mainScheduler = MainScheduler.sharedInstance diff --git a/RxExample/RxExample/OSX/Main.storyboard b/RxExample/RxExample/OSX/Main.storyboard index d082dd26..06e65af4 100644 --- a/RxExample/RxExample/OSX/Main.storyboard +++ b/RxExample/RxExample/OSX/Main.storyboard @@ -1,7 +1,7 @@ - + - + @@ -52,6 +52,7 @@ + @@ -66,6 +67,7 @@ + @@ -74,6 +76,7 @@ + @@ -82,25 +85,28 @@ + - + + - + @@ -294,14 +318,17 @@ + - - + + + - - + + + @@ -311,21 +338,24 @@ - + + + @@ -336,16 +366,18 @@ - + + @@ -358,6 +390,7 @@ + @@ -398,6 +431,7 @@ + @@ -412,6 +446,7 @@