Skip to content

Commit 4f2af71

Browse files
author
Tigran Hambardzumyan
committed
Merge branch 'release/0.1.2'
2 parents 0b3c091 + 4c6c2ff commit 4f2af71

File tree

7 files changed

+70
-43
lines changed

7 files changed

+70
-43
lines changed

Example/Example.playground/Contents.swift

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ example("allowTrue") {
2323

2424
Observable.of(true, false, false, true, true)
2525
.allowTrue()
26-
.subscribe(onNext: { print($0) })
26+
.subscribe(onNext: { dump($0) })
2727
.disposed(by: disposeBag)
2828

2929
}
@@ -34,7 +34,7 @@ example("allowTrue Optional") {
3434

3535
Observable.of(true, false, nil, true, nil, true)
3636
.allowTrue()
37-
.subscribe(onNext: { print($0) })
37+
.subscribe(onNext: { dump($0) })
3838
.disposed(by: disposeBag)
3939

4040
}
@@ -45,7 +45,7 @@ example("allowFalse") {
4545

4646
Observable.of(true, false, false, true, false)
4747
.allowFalse()
48-
.subscribe(onNext: { print($0) })
48+
.subscribe(onNext: { dump($0) })
4949
.disposed(by: disposeBag)
5050

5151
}
@@ -56,7 +56,7 @@ example("allowFalse Optional") {
5656

5757
Observable.of(true, false, nil, true, nil, true, false)
5858
.allowFalse()
59-
.subscribe(onNext: { print($0) })
59+
.subscribe(onNext: { dump($0) })
6060
.disposed(by: disposeBag)
6161

6262
}
@@ -66,7 +66,7 @@ example("allowTrueOrNil") {
6666

6767
Observable.of(true, false, nil, true, nil, true, false)
6868
.allowTrueOrNil()
69-
.subscribe(onNext: { print($0) })
69+
.subscribe(onNext: { dump($0) })
7070
.disposed(by: disposeBag)
7171

7272
}
@@ -76,9 +76,9 @@ example("allowFalseOrNil") {
7676

7777
Observable.of(true, false, nil, true, nil, true, false)
7878
.allowFalseOrNil()
79-
.subscribe(onNext: { print($0) })
79+
.subscribe(onNext: { dump($0) })
8080
.disposed(by: disposeBag)
81-
81+
8282
}
8383

8484
example("filterIfNil") {
@@ -91,14 +91,14 @@ example("filterIfNil") {
9191

9292
subject
9393
.filterIfNil(optional)
94-
.subscribe(onNext: { print("Subscription1 --> \($0)") })
94+
.subscribe(onNext: { dump($0, name: "Subscription1") })
9595
.disposed(by: disposeBag)
9696

9797
optional = "enable"
9898

9999
subject
100100
.filterIfNil(optional)
101-
.subscribe(onNext: { print("Subscription2 --> \($0)") })
101+
.subscribe(onNext: { dump($0, name: "Subscription2") })
102102
.disposed(by: disposeBag)
103103

104104
subject.onNext("🐹")
@@ -116,32 +116,41 @@ example("filterIfNotNil") {
116116

117117
subject
118118
.filterIfNotNil(optional)
119-
.subscribe(onNext: { print("Subscription1 --> \($0)") })
119+
.subscribe(onNext: { dump($0, name: "Subscription1") })
120120
.disposed(by: disposeBag)
121121

122122
optional = "enable"
123123

124124
subject
125125
.filterIfNotNil(optional)
126-
.subscribe(onNext: { print("Subscription2 --> \($0)") })
126+
.subscribe(onNext: { dump($0, name: "Subscription2") })
127127
.disposed(by: disposeBag)
128128

129129
subject.onNext("🐹")
130130

131131
subject.onNext("🐭")
132132
}
133133

134+
example("Allow nil") {
135+
let disposeBag = DisposeBag()
136+
137+
Observable.of(true, false, nil, true, nil, true, false)
138+
.allowNil()
139+
.subscribe(onNext: { dump($0) })
140+
.disposed(by: disposeBag)
141+
}
142+
134143
/*:
135144
## Map Extensions
136-
*/
145+
*/
137146

138147
example("map(to:)") {
139148

140149
let disposeBag = DisposeBag()
141150

142151
Observable.of(1, 5, 7, 8)
143152
.map(to: "ping")
144-
.subscribe(onNext: { print($0) })
153+
.subscribe(onNext: { dump($0 as String) })
145154
.disposed(by: disposeBag)
146155

147156
}
@@ -158,26 +167,26 @@ example("map(at:)") {
158167

159168
observable
160169
.map(at: \.title)
161-
.subscribe(onNext: { print($0) })
170+
.subscribe(onNext: { dump($0) })
162171
.disposed(by: disposeBag)
163172

164173
observable
165174
.map(at: \.author.firstName)
166-
.subscribe(onNext: { print($0) })
175+
.subscribe(onNext: { dump($0) })
167176
.disposed(by: disposeBag)
168177

169178
}
170179

171180
/*:
172181
## Cast Extensions
173-
*/
182+
*/
174183

175184
example("cast(to:)") {
176185
let disposeBag = DisposeBag()
177186

178187
Observable<CustomStringConvertible>.of("1", "5", "7", "8")
179188
.cast(to: String.self)
180-
.subscribe(onNext: { print($0) })
189+
.subscribe(onNext: { dump($0) })
181190
.disposed(by: disposeBag)
182191

183192
}
@@ -187,7 +196,7 @@ example("forceCast(to:)") {
187196

188197
Observable<CustomStringConvertible>.of("1", "5", "7", "8")
189198
.forceCast(to: String.self)
190-
.subscribe(onNext: { print($0) })
199+
.subscribe(onNext: { dump($0) })
191200
.disposed(by: disposeBag)
192201

193202
}

Example/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PODS:
22
- RxCocoa (4.1.2):
33
- RxSwift (~> 4.0)
44
- RxSwift (4.1.2)
5-
- STDevRxExt (0.1.0):
5+
- STDevRxExt (0.1.1):
66
- RxCocoa (~> 4.1.2)
77
- RxSwift (~> 4.1.2)
88

@@ -16,8 +16,8 @@ EXTERNAL SOURCES:
1616
SPEC CHECKSUMS:
1717
RxCocoa: d88ba0f1f6abf040011a9eb4b539324fc426843a
1818
RxSwift: e49536837d9901277638493ea537394d4b55f570
19-
STDevRxExt: 523757c19d070f1183ed46f3c262671e3f549467
19+
STDevRxExt: db625d87a2f2f74ce2f9efb869b020e944781851
2020

21-
PODFILE CHECKSUM: f42840d4bfdb7c3c06cec77f4e686adfdc3604f1
21+
PODFILE CHECKSUM: 03f0d9ab6a3ddca86ac78ea53d2cfc1bef03c8f8
2222

23-
COCOAPODS: 1.4.0
23+
COCOAPODS: 1.3.1

Example/STDevRxExt.xcodeproj/project.pbxproj

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
607FACE21AFB9204008FA782 /* Frameworks */,
113113
607FACE31AFB9204008FA782 /* Resources */,
114114
ABFFA786528145F941134D7B /* [CP] Embed Pods Frameworks */,
115-
CCB8043419D447B3CFB8B185 /* [CP] Copy Pods Resources */,
115+
1314E7A7F724A441011AC3F2 /* [CP] Copy Pods Resources */,
116116
);
117117
buildRules = (
118118
);
@@ -130,7 +130,7 @@
130130
isa = PBXProject;
131131
attributes = {
132132
LastSwiftUpdateCheck = 0830;
133-
LastUpgradeCheck = 0830;
133+
LastUpgradeCheck = 0930;
134134
ORGANIZATIONNAME = CocoaPods;
135135
TargetAttributes = {
136136
607FACE41AFB9204008FA782 = {
@@ -169,6 +169,21 @@
169169
/* End PBXResourcesBuildPhase section */
170170

171171
/* Begin PBXShellScriptBuildPhase section */
172+
1314E7A7F724A441011AC3F2 /* [CP] Copy Pods Resources */ = {
173+
isa = PBXShellScriptBuildPhase;
174+
buildActionMask = 2147483647;
175+
files = (
176+
);
177+
inputPaths = (
178+
);
179+
name = "[CP] Copy Pods Resources";
180+
outputPaths = (
181+
);
182+
runOnlyForDeploymentPostprocessing = 0;
183+
shellPath = /bin/sh;
184+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-STDevRxExt_Tests/Pods-STDevRxExt_Tests-resources.sh\"\n";
185+
showEnvVarsInLog = 0;
186+
};
172187
A3707137EA0E0FF550D3D5D1 /* [CP] Check Pods Manifest.lock */ = {
173188
isa = PBXShellScriptBuildPhase;
174189
buildActionMask = 2147483647;
@@ -209,21 +224,6 @@
209224
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-STDevRxExt_Tests/Pods-STDevRxExt_Tests-frameworks.sh\"\n";
210225
showEnvVarsInLog = 0;
211226
};
212-
CCB8043419D447B3CFB8B185 /* [CP] Copy Pods Resources */ = {
213-
isa = PBXShellScriptBuildPhase;
214-
buildActionMask = 2147483647;
215-
files = (
216-
);
217-
inputPaths = (
218-
);
219-
name = "[CP] Copy Pods Resources";
220-
outputPaths = (
221-
);
222-
runOnlyForDeploymentPostprocessing = 0;
223-
shellPath = /bin/sh;
224-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-STDevRxExt_Tests/Pods-STDevRxExt_Tests-resources.sh\"\n";
225-
showEnvVarsInLog = 0;
226-
};
227227
/* End PBXShellScriptBuildPhase section */
228228

229229
/* Begin PBXSourcesBuildPhase section */
@@ -250,12 +250,14 @@
250250
CLANG_WARN_BOOL_CONVERSION = YES;
251251
CLANG_WARN_COMMA = YES;
252252
CLANG_WARN_CONSTANT_CONVERSION = YES;
253+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
253254
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
254255
CLANG_WARN_EMPTY_BODY = YES;
255256
CLANG_WARN_ENUM_CONVERSION = YES;
256257
CLANG_WARN_INFINITE_RECURSION = YES;
257258
CLANG_WARN_INT_CONVERSION = YES;
258259
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
260+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
259261
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
260262
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
261263
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -303,12 +305,14 @@
303305
CLANG_WARN_BOOL_CONVERSION = YES;
304306
CLANG_WARN_COMMA = YES;
305307
CLANG_WARN_CONSTANT_CONVERSION = YES;
308+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
306309
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
307310
CLANG_WARN_EMPTY_BODY = YES;
308311
CLANG_WARN_ENUM_CONVERSION = YES;
309312
CLANG_WARN_INFINITE_RECURSION = YES;
310313
CLANG_WARN_INT_CONVERSION = YES;
311314
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
315+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
312316
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
313317
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
314318
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;

Example/STDevRxExt.xcodeproj/xcshareddata/xcschemes/STDevRxExt-Example.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43-
language = ""
4443
shouldUseLaunchSchemeArgsEnv = "YES">
4544
<Testables>
4645
<TestableReference
@@ -70,7 +69,6 @@
7069
buildConfiguration = "Debug"
7170
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7271
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73-
language = ""
7472
launchStyle = "0"
7573
useCustomWorkingDirectory = "NO"
7674
ignoresPersistentStateOnLaunch = "NO"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

STDevRxExt.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'STDevRxExt'
3-
s.version = '0.1.1'
3+
s.version = '0.1.2'
44
s.summary = 'STDevRxExt contains some extension functions for RxSwift and RxCoca which makes our live easy.'
55

66
s.description = <<-DESC

STDevRxExt/Classes/FilterExtensions.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ public extension ObservableType {
5757

5858
}
5959

60+
public extension ObservableType where E == Optional<Any> {
61+
62+
public func allowNil() -> Observable<E> {
63+
return filter { $0 == nil }
64+
}
65+
66+
}
67+
6068
public extension SharedSequenceConvertibleType where SharingStrategy == DriverSharingStrategy, E == Bool {
6169

6270
public func allowTrue() -> Driver<Bool> {

0 commit comments

Comments
 (0)