Skip to content

Commit 4ab27a7

Browse files
committed
Moves from RxCocoa to example project. ReactiveX#874
1 parent f402256 commit 4ab27a7

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

Rx.xcodeproj/project.pbxproj

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@
5050
846436E31C9AF65B0035B40D /* RxSearchControllerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */; };
5151
846436E51C9AF65E0035B40D /* RxSearchControllerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */; };
5252
846436E61C9AF6670035B40D /* RxSearchControllerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */; };
53-
8476A0211C3D5DC60040BA22 /* UIImagePickerController+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8476A01F1C3D5D580040BA22 /* UIImagePickerController+RxTests.swift */; };
54-
8476A0221C3D5DC60040BA22 /* UIImagePickerController+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8476A01F1C3D5D580040BA22 /* UIImagePickerController+RxTests.swift */; };
55-
8476A0231C3D5DC80040BA22 /* UIImagePickerController+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8476A01F1C3D5D580040BA22 /* UIImagePickerController+RxTests.swift */; };
56-
8479BC461C3ACDF100FB8B54 /* RxImagePickerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8479BC441C3ACDA400FB8B54 /* RxImagePickerDelegateProxy.swift */; };
57-
8479BC481C3ACDF700FB8B54 /* RxImagePickerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8479BC441C3ACDA400FB8B54 /* RxImagePickerDelegateProxy.swift */; };
58-
8479BC491C3ACDFD00FB8B54 /* RxImagePickerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8479BC441C3ACDA400FB8B54 /* RxImagePickerDelegateProxy.swift */; };
5953
84C225A31C33F00B008724EC /* RxTextStorageDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C225A21C33F00B008724EC /* RxTextStorageDelegateProxy.swift */; };
6054
84C225A41C33F00B008724EC /* RxTextStorageDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C225A21C33F00B008724EC /* RxTextStorageDelegateProxy.swift */; };
6155
84C225A51C33F00B008724EC /* RxTextStorageDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C225A21C33F00B008724EC /* RxTextStorageDelegateProxy.swift */; };
@@ -1388,8 +1382,6 @@
13881382
844BC8B31CE4FD7500F5C7CB /* UIPickerView+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIPickerView+Rx.swift"; sourceTree = "<group>"; };
13891383
844BC8B71CE5023200F5C7CB /* UIPickerView+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIPickerView+RxTests.swift"; sourceTree = "<group>"; };
13901384
846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxSearchControllerDelegateProxy.swift; sourceTree = "<group>"; };
1391-
8476A01F1C3D5D580040BA22 /* UIImagePickerController+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImagePickerController+RxTests.swift"; sourceTree = "<group>"; };
1392-
8479BC441C3ACDA400FB8B54 /* RxImagePickerDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxImagePickerDelegateProxy.swift; sourceTree = "<group>"; };
13931385
84C225A21C33F00B008724EC /* RxTextStorageDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTextStorageDelegateProxy.swift; sourceTree = "<group>"; };
13941386
84E4D3901C9AFCD500ADFDC9 /* UISearchController+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISearchController+Rx.swift"; sourceTree = "<group>"; };
13951387
84E4D3951C9B011000ADFDC9 /* UISearchController+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISearchController+RxTests.swift"; sourceTree = "<group>"; };
@@ -2258,7 +2250,6 @@
22582250
children = (
22592251
C8D132511C42DA7F00B59FFF /* TestImplementations */,
22602252
C83508D91C38706D0027C24C /* CLLocationManager+RxTests.swift */,
2261-
8476A01F1C3D5D580040BA22 /* UIImagePickerController+RxTests.swift */,
22622253
C8B290841C94D55600E923D0 /* RxTest+Controls.swift */,
22632254
C83508DA1C38706D0027C24C /* Control+RxTests+Cocoa.swift */,
22642255
C83508DB1C38706D0027C24C /* Control+RxTests+UIKit.swift */,
@@ -2487,7 +2478,6 @@
24872478
C88254011B8A752B00B02D69 /* RxTableViewDelegateProxy.swift */,
24882479
C88254021B8A752B00B02D69 /* RxTextViewDelegateProxy.swift */,
24892480
84C225A21C33F00B008724EC /* RxTextStorageDelegateProxy.swift */,
2490-
8479BC441C3ACDA400FB8B54 /* RxImagePickerDelegateProxy.swift */,
24912481
846436E11C9AF64C0035B40D /* RxSearchControllerDelegateProxy.swift */,
24922482
844BC8AA1CE4FA5600F5C7CB /* RxPickerViewDelegateProxy.swift */,
24932483
);
@@ -3329,7 +3319,6 @@
33293319
C80DDE9B1BCE69BA006A1832 /* Driver+Operators.swift in Sources */,
33303320
C8093EE31B8A732E0088E94D /* DelegateProxyType.swift in Sources */,
33313321
C8093EFD1B8A732E0088E94D /* RxTarget.swift in Sources */,
3332-
8479BC461C3ACDF100FB8B54 /* RxImagePickerDelegateProxy.swift in Sources */,
33333322
C88254361B8A752B00B02D69 /* UITextView+Rx.swift in Sources */,
33343323
C88254171B8A752B00B02D69 /* RxTableViewReactiveArrayDataSource.swift in Sources */,
33353324
C882541E1B8A752B00B02D69 /* RxCollectionViewDataSourceProxy.swift in Sources */,
@@ -3534,7 +3523,6 @@
35343523
C8379EF41D1DD326003EF8FC /* UIButton+RxTests.swift in Sources */,
35353524
C83509581C38706E0027C24C /* Observable+MultipleTest+CombineLatest.swift in Sources */,
35363525
C83509651C38706E0027C24C /* VirtualSchedulerTest.swift in Sources */,
3537-
8476A0211C3D5DC60040BA22 /* UIImagePickerController+RxTests.swift in Sources */,
35383526
C83509361C38706E0027C24C /* NSLayoutConstraint+RxTests.swift in Sources */,
35393527
C835095E1C38706E0027C24C /* Observable+StandardSequenceOperatorsTest.swift in Sources */,
35403528
C83509691C38706E0027C24C /* Recorded+Timeless.swift in Sources */,
@@ -3616,7 +3604,6 @@
36163604
C83509C21C3875220027C24C /* Driver+Test.swift in Sources */,
36173605
C83509FE1C38755D0027C24C /* Observable+CreationTest.swift in Sources */,
36183606
C83509FC1C38755D0027C24C /* Observable+BlockingTest.swift in Sources */,
3619-
8476A0221C3D5DC60040BA22 /* UIImagePickerController+RxTests.swift in Sources */,
36203607
C8350A161C38756A0027C24C /* QueueTests.swift in Sources */,
36213608
C83509C51C3875220027C24C /* NSNotificationCenterTests.swift in Sources */,
36223609
C8F27DC31CE68DAC00D5FB4F /* UITextField+RxTests.swift in Sources */,
@@ -3695,7 +3682,6 @@
36953682
C8350A061C38755E0027C24C /* HistoricalSchedulerTest.swift in Sources */,
36963683
C83509D11C38752E0027C24C /* RuntimeStateSnapshot.swift in Sources */,
36973684
C83509B31C3875010027C24C /* CLLocationManager+RxTests.swift in Sources */,
3698-
8476A0231C3D5DC80040BA22 /* UIImagePickerController+RxTests.swift in Sources */,
36993685
C8350A221C38756B0027C24C /* VariableTest.swift in Sources */,
37003686
C83509D21C3875380027C24C /* RXObjCRuntime+Testing.m in Sources */,
37013687
C83509CC1C3875230027C24C /* NSLayoutConstraint+RxTests.swift in Sources */,
@@ -4261,7 +4247,6 @@
42614247
C80DDE9E1BCE69BA006A1832 /* Driver+Operators.swift in Sources */,
42624248
C8F0C0091BBBFBB9001B112F /* DelegateProxyType.swift in Sources */,
42634249
C8F0C00A1BBBFBB9001B112F /* RxTarget.swift in Sources */,
4264-
8479BC491C3ACDFD00FB8B54 /* RxImagePickerDelegateProxy.swift in Sources */,
42654250
C8F0C00B1BBBFBB9001B112F /* UITextView+Rx.swift in Sources */,
42664251
C8F0C00C1BBBFBB9001B112F /* RxTableViewReactiveArrayDataSource.swift in Sources */,
42674252
C8F0C00D1BBBFBB9001B112F /* RxCollectionViewDataSourceProxy.swift in Sources */,
@@ -4358,7 +4343,6 @@
43584343
D2138C8C1BB9BECA00339B5C /* ControlEvent.swift in Sources */,
43594344
D2138C981BB9BEEE00339B5C /* RxCocoa.swift in Sources */,
43604345
D2138C991BB9BEEE00339B5C /* RxTarget.swift in Sources */,
4361-
8479BC481C3ACDF700FB8B54 /* RxImagePickerDelegateProxy.swift in Sources */,
43624346
D203C5081BB9C53E00D02D00 /* UIGestureRecognizer+Rx.swift in Sources */,
43634347
D2138C931BB9BEDA00339B5C /* NSNotificationCenter+Rx.swift in Sources */,
43644348
88D98F2F1CE7549A00D50457 /* RxTabBarDelegateProxy.swift in Sources */,

RxCocoa/iOS/Proxies/RxImagePickerDelegateProxy.swift renamed to RxExample/Extensions/RxImagePickerDelegateProxy.swift

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
import Foundation
1212
#if !RX_NO_MODULE
13-
import RxSwift
13+
import RxSwift
14+
import RxCocoa
1415
#endif
1516
import UIKit
1617

@@ -37,5 +38,27 @@ public class RxImagePickerDelegateProxy
3738
}
3839

3940
}
40-
41+
42+
private func castOrFatalError<T>(value: Any!) -> T {
43+
let maybeResult: T? = value as? T
44+
guard let result = maybeResult else {
45+
rxFatalError("Failure converting from \(value) to \(T.self)")
46+
}
47+
48+
return result
49+
}
50+
51+
private func castOptionalOrFatalError<T>(value: AnyObject?) -> T? {
52+
if value == nil {
53+
return nil
54+
}
55+
let v: T = castOrFatalError(value)
56+
return v
57+
}
58+
59+
@noreturn private func rxFatalError(lastMessage: String) {
60+
// The temptation to comment this line is great, but please don't, it's for your own good. The choice is yours.
61+
fatalError(lastMessage)
62+
}
63+
4164
#endif

RxExample/RxExample.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
C88CB71C1D8F11DB0021D83F /* CLLocationManager+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88CB6FC1D8F10830021D83F /* CLLocationManager+Rx.swift */; };
106106
C88CB71D1D8F11DB0021D83F /* RxCLLocationManagerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88CB6FD1D8F10830021D83F /* RxCLLocationManagerDelegateProxy.swift */; };
107107
C88CB71E1D8F11DB0021D83F /* UIImagePickerController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88CB6FE1D8F10830021D83F /* UIImagePickerController+Rx.swift */; };
108+
C88CB7201D8F125D0021D83F /* RxImagePickerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88CB71F1D8F125D0021D83F /* RxImagePickerDelegateProxy.swift */; };
109+
C88CB7211D8F12600021D83F /* RxImagePickerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88CB71F1D8F125D0021D83F /* RxImagePickerDelegateProxy.swift */; };
108110
C890A65D1AEC084100AFF7E6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C890A65C1AEC084100AFF7E6 /* ViewController.swift */; };
109111
C89634081B95BE50002AE38C /* RxBlocking.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C8A468EF1B8A8BD000BF917B /* RxBlocking.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
110112
C89634091B95BE50002AE38C /* RxCocoa.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C8A468ED1B8A8BCC00BF917B /* RxCocoa.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -401,6 +403,7 @@
401403
C88CB7161D8F109A0021D83F /* CLLocationManager+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CLLocationManager+RxTests.swift"; sourceTree = "<group>"; };
402404
C88CB7171D8F109A0021D83F /* RxTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTest.swift; sourceTree = "<group>"; };
403405
C88CB7181D8F109A0021D83F /* UIImagePickerController+RxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImagePickerController+RxTests.swift"; sourceTree = "<group>"; };
406+
C88CB71F1D8F125D0021D83F /* RxImagePickerDelegateProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxImagePickerDelegateProxy.swift; sourceTree = "<group>"; };
404407
C890A65C1AEC084100AFF7E6 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
405408
C8984CCE1C36BC3E001E4272 /* NumberCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberCell.swift; sourceTree = "<group>"; };
406409
C8984CCF1C36BC3E001E4272 /* NumberSectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberSectionView.swift; sourceTree = "<group>"; };
@@ -795,6 +798,7 @@
795798
C88CB6FB1D8F10830021D83F /* Extensions */ = {
796799
isa = PBXGroup;
797800
children = (
801+
C88CB71F1D8F125D0021D83F /* RxImagePickerDelegateProxy.swift */,
798802
C88CB6FC1D8F10830021D83F /* CLLocationManager+Rx.swift */,
799803
C88CB6FD1D8F10830021D83F /* RxCLLocationManagerDelegateProxy.swift */,
800804
C88CB6FE1D8F10830021D83F /* UIImagePickerController+Rx.swift */,
@@ -1209,6 +1213,7 @@
12091213
C843A0931C1CE58700CBA4BD /* UINavigationController+Extensions.swift in Sources */,
12101214
C822B1E71C14E7250088A01A /* SimpleTableViewExampleSectionedViewController.swift in Sources */,
12111215
C83367251AD029AE00C668A7 /* ImageService.swift in Sources */,
1216+
C88CB7211D8F12600021D83F /* RxImagePickerDelegateProxy.swift in Sources */,
12121217
C84780001D29DE8C0074454A /* String+IdentifiableType.swift in Sources */,
12131218
C86E2F471AE5A0CA00C31024 /* WikipediaSearchResult.swift in Sources */,
12141219
C8984CD11C36BC3E001E4272 /* NumberCell.swift in Sources */,
@@ -1255,6 +1260,7 @@
12551260
C849EF641C3190360048AC4A /* RxExample_iOSTests.swift in Sources */,
12561261
C88CB7191D8F109A0021D83F /* CLLocationManager+RxTests.swift in Sources */,
12571262
C88CB71E1D8F11DB0021D83F /* UIImagePickerController+Rx.swift in Sources */,
1263+
C88CB7201D8F125D0021D83F /* RxImagePickerDelegateProxy.swift in Sources */,
12581264
C88CB71A1D8F109A0021D83F /* RxTest.swift in Sources */,
12591265
C849EF921C319E9A0048AC4A /* DefaultImplementations.swift in Sources */,
12601266
C849EF991C31A63C0048AC4A /* Wireframe.swift in Sources */,

0 commit comments

Comments
 (0)