♻️ :: Remove own observable implementation in favour of LightweightObservable

This commit is contained in:
Felix Mau
2019-05-18 11:39:22 +08:00
parent fea10c4b75
commit be4830fdc0
10 changed files with 20 additions and 471 deletions
@@ -13,8 +13,6 @@
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
64E0F5BF2211B7D20066D00D /* GradientLoadingBarViewModelTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64E0F5BB2211B7D20066D00D /* GradientLoadingBarViewModelTestCase.swift */; };
64E0F5C02211B7D20066D00D /* DisposableTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64E0F5BD2211B7D20066D00D /* DisposableTestCase.swift */; };
64E0F5C12211B7D20066D00D /* ObservableTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64E0F5BE2211B7D20066D00D /* ObservableTestCase.swift */; };
77357BD34CFF2778341F80E8 /* Pods_GradientLoadingBar_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03CD5D69D7C3FBBDBF5FABBB /* Pods_GradientLoadingBar_Example.framework */; };
8020C040972E902A8CCAA9E7 /* Pods_GradientLoadingBar_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 434E3C8A6E245A38C2831E73 /* Pods_GradientLoadingBar_Tests.framework */; };
972CFBCC2138849A006F14C9 /* SafeAreaExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 972CFBCB2138849A006F14C9 /* SafeAreaExampleViewController.swift */; };
@@ -52,8 +50,6 @@
607FACE51AFB9204008FA782 /* GradientLoadingBar_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GradientLoadingBar_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
64E0F5BB2211B7D20066D00D /* GradientLoadingBarViewModelTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GradientLoadingBarViewModelTestCase.swift; sourceTree = "<group>"; };
64E0F5BD2211B7D20066D00D /* DisposableTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisposableTestCase.swift; sourceTree = "<group>"; };
64E0F5BE2211B7D20066D00D /* ObservableTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObservableTestCase.swift; sourceTree = "<group>"; };
972CFBCB2138849A006F14C9 /* SafeAreaExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafeAreaExampleViewController.swift; sourceTree = "<group>"; };
97464E6621372BCD0097183A /* AdvancedExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedExampleViewController.swift; sourceTree = "<group>"; };
97464E6821372C010097183A /* NavigationBarExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationBarExampleViewController.swift; sourceTree = "<group>"; };
@@ -164,7 +160,6 @@
isa = PBXGroup;
children = (
64E0F5BA2211B7D20066D00D /* GradientLoadingBar */,
64E0F5BC2211B7D20066D00D /* Observable */,
);
path = Feature;
sourceTree = "<group>";
@@ -177,15 +172,6 @@
path = GradientLoadingBar;
sourceTree = "<group>";
};
64E0F5BC2211B7D20066D00D /* Observable */ = {
isa = PBXGroup;
children = (
64E0F5BD2211B7D20066D00D /* DisposableTestCase.swift */,
64E0F5BE2211B7D20066D00D /* ObservableTestCase.swift */,
);
path = Observable;
sourceTree = "<group>";
};
97B6F5F92143F31F008CFEA5 /* Extensions */ = {
isa = PBXGroup;
children = (
@@ -464,8 +450,6 @@
buildActionMask = 2147483647;
files = (
64E0F5BF2211B7D20066D00D /* GradientLoadingBarViewModelTestCase.swift in Sources */,
64E0F5C02211B7D20066D00D /* DisposableTestCase.swift in Sources */,
64E0F5C12211B7D20066D00D /* ObservableTestCase.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14269.12" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14252.5"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
+12 -36
View File
@@ -15,6 +15,7 @@
dependencies = (
);
name = SwiftFormat;
productName = SwiftFormat;
};
F40CA0216C90A76EEE32F7C25565C0D5 /* SwiftLint */ = {
isa = PBXAggregateTarget;
@@ -24,6 +25,7 @@
dependencies = (
);
name = SwiftLint;
productName = SwiftLint;
};
/* End PBXAggregateTarget section */
@@ -34,8 +36,6 @@
1ADF9BF9E149214C8622227668BD4856 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0DB0084C5FD0BFC8785550E7F61F815 /* Foundation.framework */; };
360D1B066AC4CA12CB138A9A772A987A /* GradientLoadingBar-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD4EB35937102EAFA6B9091548537DC /* GradientLoadingBar-dummy.m */; };
3C1E0F37429ABCFB6696B597AC32409F /* LightweightObservable-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3717A0C2307C679A319FB78F9AF72963 /* LightweightObservable-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
4609ECB7A1E367688E2E10C84A038030 /* Disposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82FEBF300C18E8DEDC03B5E12D6E85A5 /* Disposable.swift */; };
4C0D3A63B9DC0C8F9392A2B3584C0C91 /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9355E756FF7002A283DFC6C0029564B6 /* Observable.swift */; };
4E60DD2293BBDB5908A44CAD852E7009 /* Pods-GradientLoadingBar_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = ECA371741105B3DF85A5C4ABAFAF4435 /* Pods-GradientLoadingBar_Example-dummy.m */; };
501C177FFA848D777CAD832A6A3E349D /* GradientLoadingBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A1D3951B2127985CDF98E59E9C4249 /* GradientLoadingBarController.swift */; };
5FEC5A06D9091E64329E8AFFCB50BA78 /* LightweightObservable-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C9503A92D75F057290500525EA8329E /* LightweightObservable-dummy.m */; };
@@ -114,37 +114,35 @@
4538483088F4844FB0F10A96586FB8A9 /* UIView+AnimateIsHidden.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIView+AnimateIsHidden.swift"; sourceTree = "<group>"; };
49794D1BDE47A0E99D52332216BC65E9 /* Pods-GradientLoadingBar_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-GradientLoadingBar_Tests-acknowledgements.markdown"; sourceTree = "<group>"; };
4F283E5444407F5E73EF6B43999A1BC0 /* UIColor+CustomColors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+CustomColors.swift"; sourceTree = "<group>"; };
59019813B7B7C20236A6AA1D2846F2E5 /* Pods_GradientLoadingBar_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_GradientLoadingBar_Example.framework; path = "Pods-GradientLoadingBar_Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; };
59019813B7B7C20236A6AA1D2846F2E5 /* Pods_GradientLoadingBar_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GradientLoadingBar_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5BD7474DAFACDB8CAABDE74687B2B2FB /* GradientLoadingBarViewModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GradientLoadingBarViewModel.swift; sourceTree = "<group>"; };
670D1598351BCDDA2ACA6F3ECB0434BB /* SwiftFormat.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SwiftFormat.xcconfig; sourceTree = "<group>"; };
67825F7600B8C1C05F1A3AF6CBF0145A /* LightweightObservable.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = LightweightObservable.framework; path = LightweightObservable.framework; sourceTree = BUILT_PRODUCTS_DIR; };
67825F7600B8C1C05F1A3AF6CBF0145A /* LightweightObservable.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LightweightObservable.framework; sourceTree = BUILT_PRODUCTS_DIR; };
71239BEF34D3EF1C8CA98006CEEAFE38 /* UIColor+DefaultValues.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+DefaultValues.swift"; sourceTree = "<group>"; };
71CD0D37F86BED1B0F9C734FA9A5C426 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposable.swift; path = LightweightObservable/Classes/Disposable.swift; sourceTree = "<group>"; };
71CF5971041D02929C8C1F6EC220C89B /* GradientLoadingBar.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GradientLoadingBar.xcconfig; sourceTree = "<group>"; };
7A9B6229649B0A1BAF9A95B2ED86470E /* Pods-GradientLoadingBar_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-GradientLoadingBar_Tests.modulemap"; sourceTree = "<group>"; };
7B12423F4DBB8DF2A1FA43453E5D2897 /* Pods_GradientLoadingBar_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_GradientLoadingBar_Tests.framework; path = "Pods-GradientLoadingBar_Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; };
7B12423F4DBB8DF2A1FA43453E5D2897 /* Pods_GradientLoadingBar_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GradientLoadingBar_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
803963C181096CF6990AE4FD5D149497 /* GradientLoadingBar-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "GradientLoadingBar-Info.plist"; sourceTree = "<group>"; };
82FEBF300C18E8DEDC03B5E12D6E85A5 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Disposable.swift; sourceTree = "<group>"; };
8629223D3BAF7EC8616AE093F171C3FD /* GradientLoadingBar.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = GradientLoadingBar.podspec; sourceTree = "<group>"; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
8629223D3BAF7EC8616AE093F171C3FD /* GradientLoadingBar.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; path = GradientLoadingBar.podspec; sourceTree = "<group>"; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
884681EFBBB3C36C126C72381E290899 /* Pods-GradientLoadingBar_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-GradientLoadingBar_Tests-umbrella.h"; sourceTree = "<group>"; };
8BD4EB35937102EAFA6B9091548537DC /* GradientLoadingBar-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "GradientLoadingBar-dummy.m"; sourceTree = "<group>"; };
8BFC221633B8EEC479EE5CBC733737A0 /* LightweightObservable.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = LightweightObservable.modulemap; sourceTree = "<group>"; };
8F250286A5229A56B46FC13B1262852B /* SwiftLint.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SwiftLint.xcconfig; sourceTree = "<group>"; };
9355E756FF7002A283DFC6C0029564B6 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Observable.swift; sourceTree = "<group>"; };
936A0597BA17B55F59A346D331306B5F /* BottomGradientLoadingBarController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BottomGradientLoadingBarController.swift; sourceTree = "<group>"; };
9CAA017B1769B508492A30175B3B3267 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Observable.swift; path = LightweightObservable/Classes/Observable/Observable.swift; sourceTree = "<group>"; };
9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
A905AC0A36502ED362745E3D73467B01 /* Observable+Equatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Equatable.swift"; path = "LightweightObservable/Classes/Observable/Observable+Equatable.swift"; sourceTree = "<group>"; };
A91D41367DB29791E5EBDEE0357C605E /* GradientLoadingBar-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GradientLoadingBar-umbrella.h"; sourceTree = "<group>"; };
AA595FD47218C87012335E8C73E53199 /* Pods-GradientLoadingBar_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-GradientLoadingBar_Tests.release.xcconfig"; sourceTree = "<group>"; };
B4BAB5AD5983771499462BBE1F238F29 /* GradientLoadingBar-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GradientLoadingBar-prefix.pch"; sourceTree = "<group>"; };
B7110D1E070583E64F9E9A6B741851EB /* Pods-GradientLoadingBar_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-GradientLoadingBar_Example.release.xcconfig"; sourceTree = "<group>"; };
BFE723A0C5579F6C005375100ABF5F14 /* GradientLoadingBar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = GradientLoadingBar.framework; path = GradientLoadingBar.framework; sourceTree = BUILT_PRODUCTS_DIR; };
BFE723A0C5579F6C005375100ABF5F14 /* GradientLoadingBar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GradientLoadingBar.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C146990211AC0E37378C96105C834611 /* Pods-GradientLoadingBar_Tests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-GradientLoadingBar_Tests-Info.plist"; sourceTree = "<group>"; };
C80083841EFE765A5D0AD2D5538A7BF1 /* Pods-GradientLoadingBar_Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-GradientLoadingBar_Example-Info.plist"; sourceTree = "<group>"; };
CE0D98C8EAB658D7185CDEFA1FF71C9A /* LightweightObservable-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "LightweightObservable-prefix.pch"; sourceTree = "<group>"; };
D73E699F3F9F1EE84B5F23BF03FDC2D8 /* Durations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Durations.swift; sourceTree = "<group>"; };
D83AD160BCDC2F3E1A0648CB9A8C25F9 /* readme.md */ = {isa = PBXFileReference; includeInIndex = 1; path = readme.md; sourceTree = "<group>"; };
D83AD160BCDC2F3E1A0648CB9A8C25F9 /* readme.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = readme.md; sourceTree = "<group>"; };
DA560EE447F3A7C6E598FE3F43C8666E /* LightweightObservable.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LightweightObservable.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E01C418F97C14B0483B5AFFB79046F56 /* GradientLoadingBar.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = GradientLoadingBar.modulemap; sourceTree = "<group>"; };
EA9E55EC3CE832503856FF3A375CB805 /* Pods-GradientLoadingBar_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-GradientLoadingBar_Example-acknowledgements.plist"; sourceTree = "<group>"; };
@@ -153,7 +151,7 @@
F0AC3E41A31439D7062CB197FB5DF77F /* LightweightObservable-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "LightweightObservable-Info.plist"; sourceTree = "<group>"; };
F0DB0084C5FD0BFC8785550E7F61F815 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
F314842C21CEE21917919A7F13907086 /* Pods-GradientLoadingBar_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-GradientLoadingBar_Example-acknowledgements.markdown"; sourceTree = "<group>"; };
F47C9DA0C744E86330DFFAFA12DAB6EC /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = "<group>"; };
F47C9DA0C744E86330DFFAFA12DAB6EC /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
F68118DF2CFF8BC6DA8503B6DF614A72 /* Pods-GradientLoadingBar_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-GradientLoadingBar_Example.modulemap"; sourceTree = "<group>"; };
FAE6912920A10496B8570441927F50A1 /* Pods-GradientLoadingBar_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-GradientLoadingBar_Tests.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -200,7 +198,6 @@
children = (
2B1C5D8984DE17B536E3AA18AD9A36AD /* Support Files */,
);
name = SwiftLint;
path = SwiftLint;
sourceTree = "<group>";
};
@@ -218,7 +215,6 @@
isa = PBXGroup;
children = (
34C528DC56BB3D7E2CDAF5D306731873 /* GradientLoadingBar */,
431E98257DFD585D6ABB3ADAF0352A6A /* Observable */,
);
name = Features;
path = GradientLoadingBar/Classes/Features;
@@ -242,7 +238,6 @@
E277A29DE5354A44B588A6638083AD37 /* ViewModel */,
4DE913A9C7DEC50EB57C3CF243C37944 /* Views */,
);
name = GradientLoadingBar;
path = GradientLoadingBar;
sourceTree = "<group>";
};
@@ -254,16 +249,6 @@
name = iOS;
sourceTree = "<group>";
};
431E98257DFD585D6ABB3ADAF0352A6A /* Observable */ = {
isa = PBXGroup;
children = (
82FEBF300C18E8DEDC03B5E12D6E85A5 /* Disposable.swift */,
9355E756FF7002A283DFC6C0029564B6 /* Observable.swift */,
);
name = Observable;
path = Observable;
sourceTree = "<group>";
};
463571F3E12C17A372C16E820C609F36 /* Extensions */ = {
isa = PBXGroup;
children = (
@@ -280,7 +265,6 @@
4F283E5444407F5E73EF6B43999A1BC0 /* UIColor+CustomColors.swift */,
71239BEF34D3EF1C8CA98006CEEAFE38 /* UIColor+DefaultValues.swift */,
);
name = UIColor;
path = UIColor;
sourceTree = "<group>";
};
@@ -289,7 +273,6 @@
children = (
011D7697512BC073D570D65912E05FE6 /* GradientView.swift */,
);
name = Views;
path = Views;
sourceTree = "<group>";
};
@@ -347,7 +330,6 @@
A905AC0A36502ED362745E3D73467B01 /* Observable+Equatable.swift */,
CA369EB846547AE3200999F324A20EF1 /* Support Files */,
);
name = LightweightObservable;
path = LightweightObservable;
sourceTree = "<group>";
};
@@ -365,7 +347,6 @@
children = (
DD0982CE766FEDDC6A9FF49DFB59184D /* Support Files */,
);
name = SwiftFormat;
path = SwiftFormat;
sourceTree = "<group>";
};
@@ -374,7 +355,6 @@
children = (
4538483088F4844FB0F10A96586FB8A9 /* UIView+AnimateIsHidden.swift */,
);
name = UIView;
path = UIView;
sourceTree = "<group>";
};
@@ -421,7 +401,6 @@
children = (
D73E699F3F9F1EE84B5F23BF03FDC2D8 /* Durations.swift */,
);
name = Helpers;
path = Helpers;
sourceTree = "<group>";
};
@@ -451,7 +430,6 @@
children = (
5BD7474DAFACDB8CAABDE74687B2B2FB /* GradientLoadingBarViewModel.swift */,
);
name = ViewModel;
path = ViewModel;
sourceTree = "<group>";
};
@@ -612,6 +590,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = CF1408CF629C7361332E53B88F7BD30C;
@@ -685,13 +664,11 @@
buildActionMask = 2147483647;
files = (
E9F30527419039B0BAE29D3EDB33591A /* BottomGradientLoadingBarController.swift in Sources */,
4609ECB7A1E367688E2E10C84A038030 /* Disposable.swift in Sources */,
A867BB75AA50B9A5CE2CF21BDAEA04EB /* Durations.swift in Sources */,
360D1B066AC4CA12CB138A9A772A987A /* GradientLoadingBar-dummy.m in Sources */,
501C177FFA848D777CAD832A6A3E349D /* GradientLoadingBarController.swift in Sources */,
89D736E7200BAA9A053BC6DACB5271CC /* GradientLoadingBarViewModel.swift in Sources */,
1AD7D49AFCB722E38C20BADB5E78FBA4 /* GradientView.swift in Sources */,
4C0D3A63B9DC0C8F9392A2B3584C0C91 /* Observable.swift in Sources */,
CDC489EB80754DD1952CB8302ADC63C1 /* UIColor+CustomColors.swift in Sources */,
93D6F56A7F21CBAEACD2C1FA4A5F71C3 /* UIColor+DefaultValues.swift in Sources */,
DFA66F2EA78BC547EDBD940AD11A6B7F /* UIView+AnimateIsHidden.swift in Sources */,
@@ -1134,8 +1111,7 @@
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SYMROOT = "${SRCROOT}/../build";
};
@@ -8,6 +8,7 @@
import XCTest
@testable import LightweightObservable
@testable import GradientLoadingBar
class GradientLoadingBarViewModelTestCase: XCTestCase {
@@ -111,7 +112,7 @@ class GradientLoadingBarViewModelTestCase: XCTestCase {
}
expectation.fulfill()
}.add(to: &disposeBag)
}.disposed(by: &disposeBag)
// When
for _ in 1 ... 3 {
@@ -1,52 +0,0 @@
//
// DisposableTestCase.swift
// GradientLoadingBar_Tests
//
// Created by Felix Mau on 11/02/19.
// Copyright © 2019 Felix Mau. All rights reserved.
//
import XCTest
@testable import GradientLoadingBar
class DisposableTestCase: XCTestCase {
func testDisposeClosureShouldNotBeCalledBeforeDeinit() {
// Given
let expectation = self.expectation(description: "Expect dispose closure not to be called.")
expectation.isInverted = true
var disposable: Disposable?
disposable = Disposable {
expectation.fulfill()
}
// Workaround to fix warning `Variable 'disposable' was written to, but never read`
XCTAssertNotNil(disposable, "Precondition failed - Expected to have a valid instance at this point.")
// When
// ...
// Then
wait(for: [expectation], timeout: 1.0)
}
func testDisposeClosureShouldBeCalledOnDeinit() {
// Given
let expectation = self.expectation(description: "Expect dispose closure to be called on deinit.")
var disposable: Disposable?
disposable = Disposable {
expectation.fulfill()
}
// Workaround to fix warning `Variable 'disposable' was written to, but never read`
XCTAssertNotNil(disposable, "Precondition failed - Expected to have a valid instance at this point.")
// When
disposable = nil
// Then
wait(for: [expectation], timeout: 0.1)
}
}
@@ -1,192 +0,0 @@
//
// ObservableTestCase.swift
// GradientLoadingBar_Tests
//
// Created by Felix Mau on 11/02/19.
// Copyright © 2019 Felix Mau. All rights reserved.
//
import XCTest
@testable import GradientLoadingBar
class ObservableTestCase: XCTestCase {
// MARK: - Private properties
private var disposeBag: DisposeBag!
private var oldValue: Int?
private var newValue: Int?
// MARK: - Public methods
override func setUp() {
super.setUp()
disposeBag = DisposeBag()
oldValue = nil
newValue = nil
}
override func tearDown() {
disposeBag = nil
super.tearDown()
}
// MARK: - Test method `observe(:)`
func testObservableShouldInformObserverWithCorrectValues() {
// Given
let variable = Variable(0)
// When
variable.asObservable.subscribe { newValue, oldValue in
self.newValue = newValue
self.oldValue = oldValue
}.add(to: &disposeBag)
// Then
XCTAssertEqual(newValue, 0)
XCTAssertNil(oldValue)
}
func testObservableShouldUpdateObserverWithCorrectValues() {
// Given
let variable = Variable(0)
variable.asObservable.subscribe { newValue, oldValue in
self.newValue = newValue
self.oldValue = oldValue
}.add(to: &disposeBag)
// When
for value in 1 ..< 10 {
variable.value = value
// Then
XCTAssertEqual(newValue, value)
XCTAssertEqual(oldValue, value - 1)
}
}
// MARK: - Test method `observe(filter:)`
func testObservableShouldUpdateObserverOnlyIfFilterMatches() {
// Given
let assertNewValueIsEven: (Int, Int?) -> Bool = { newValue, _ in
newValue.isEven
}
let expectation = self.expectation(description: "Expected five even numbers between `0` and `9`.")
expectation.expectedFulfillmentCount = 5
let variable = Variable(0)
variable.asObservable.subscribe(filter: assertNewValueIsEven, observer: { newValue, _ in
guard newValue.isEven else {
XCTFail("The received value `\(newValue)` is odd!")
return
}
expectation.fulfill()
}).add(to: &disposeBag)
// When
for value in 1 ..< 10 {
variable.value = value
}
// Then
waitForExpectations(timeout: 0.1, handler: nil)
}
// MARK: - Test method `observeDistinct(:)`
func testObservableShouldInformDistinctObserverWithCorrectValues() {
// Given
let variable = Variable(0)
// When
variable.asObservable.subscribeDistinct { newValue, oldValue in
self.newValue = newValue
self.oldValue = oldValue
}.add(to: &disposeBag)
// Then
XCTAssertEqual(newValue, 0)
XCTAssertNil(oldValue)
}
func testObservableShouldUpdateDistinctObserverWithCorrectValues() {
// Given
let variable = Variable(0)
variable.asObservable.subscribeDistinct { newValue, oldValue in
self.newValue = newValue
self.oldValue = oldValue
}.add(to: &disposeBag)
// When
for value in 1 ..< 10 {
variable.value = value
// Then
XCTAssertEqual(newValue, value)
XCTAssertEqual(oldValue, value - 1)
}
}
func testObservableShouldUpdateDistinctObserverJustOnceForSameValue() {
// Given
let expectation = self.expectation(description: "Expected distinct observer to be informed two times: The inital call and the new value.")
expectation.expectedFulfillmentCount = 2
let variable = Variable(0)
variable.asObservable.subscribeDistinct { newValue, oldValue in
self.newValue = newValue
self.oldValue = oldValue
expectation.fulfill()
}.add(to: &disposeBag)
// When
for _ in 1 ..< 10 {
variable.value = 1
// Then
XCTAssertEqual(newValue, 1)
XCTAssertEqual(oldValue, 0)
}
waitForExpectations(timeout: 0.1, handler: nil)
}
// MARK: - Test deallocated dispose bag
func testObservableShouldNotInformObserverAfterDeallocatedDisposeBag() {
// Given
let variable = Variable(0)
variable.asObservable.subscribe { newValue, oldValue in
self.newValue = newValue
self.oldValue = oldValue
}.add(to: &disposeBag)
// When
disposeBag = nil
variable.value = 1
// Then
XCTAssertEqual(newValue, 0)
XCTAssertNil(oldValue)
}
}
// MARK: - Helpers
private extension Int {
var isEven: Bool {
return self % 2 == 0
}
}