diff --git a/Example/GradientLoadingBar.xcodeproj/project.pbxproj b/Example/GradientLoadingBar.xcodeproj/project.pbxproj index d365084..170948e 100644 --- a/Example/GradientLoadingBar.xcodeproj/project.pbxproj +++ b/Example/GradientLoadingBar.xcodeproj/project.pbxproj @@ -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 = ""; }; 64E0F5BB2211B7D20066D00D /* GradientLoadingBarViewModelTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GradientLoadingBarViewModelTestCase.swift; sourceTree = ""; }; - 64E0F5BD2211B7D20066D00D /* DisposableTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisposableTestCase.swift; sourceTree = ""; }; - 64E0F5BE2211B7D20066D00D /* ObservableTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObservableTestCase.swift; sourceTree = ""; }; 972CFBCB2138849A006F14C9 /* SafeAreaExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafeAreaExampleViewController.swift; sourceTree = ""; }; 97464E6621372BCD0097183A /* AdvancedExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedExampleViewController.swift; sourceTree = ""; }; 97464E6821372C010097183A /* NavigationBarExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationBarExampleViewController.swift; sourceTree = ""; }; @@ -164,7 +160,6 @@ isa = PBXGroup; children = ( 64E0F5BA2211B7D20066D00D /* GradientLoadingBar */, - 64E0F5BC2211B7D20066D00D /* Observable */, ); path = Feature; sourceTree = ""; @@ -177,15 +172,6 @@ path = GradientLoadingBar; sourceTree = ""; }; - 64E0F5BC2211B7D20066D00D /* Observable */ = { - isa = PBXGroup; - children = ( - 64E0F5BD2211B7D20066D00D /* DisposableTestCase.swift */, - 64E0F5BE2211B7D20066D00D /* ObservableTestCase.swift */, - ); - path = Observable; - sourceTree = ""; - }; 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; }; diff --git a/Example/GradientLoadingBar/Base.lproj/LaunchScreen.xib b/Example/GradientLoadingBar/Base.lproj/LaunchScreen.xib index 471bf97..1fd98aa 100644 --- a/Example/GradientLoadingBar/Base.lproj/LaunchScreen.xib +++ b/Example/GradientLoadingBar/Base.lproj/LaunchScreen.xib @@ -1,11 +1,11 @@ - + - + diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 25cdee7..07bcd5f 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -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 = ""; }; 49794D1BDE47A0E99D52332216BC65E9 /* Pods-GradientLoadingBar_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-GradientLoadingBar_Tests-acknowledgements.markdown"; sourceTree = ""; }; 4F283E5444407F5E73EF6B43999A1BC0 /* UIColor+CustomColors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+CustomColors.swift"; sourceTree = ""; }; - 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 = ""; }; 670D1598351BCDDA2ACA6F3ECB0434BB /* SwiftFormat.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SwiftFormat.xcconfig; sourceTree = ""; }; - 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 = ""; }; 71CD0D37F86BED1B0F9C734FA9A5C426 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposable.swift; path = LightweightObservable/Classes/Disposable.swift; sourceTree = ""; }; 71CF5971041D02929C8C1F6EC220C89B /* GradientLoadingBar.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GradientLoadingBar.xcconfig; sourceTree = ""; }; 7A9B6229649B0A1BAF9A95B2ED86470E /* Pods-GradientLoadingBar_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-GradientLoadingBar_Tests.modulemap"; sourceTree = ""; }; - 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 = ""; }; - 82FEBF300C18E8DEDC03B5E12D6E85A5 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Disposable.swift; sourceTree = ""; }; - 8629223D3BAF7EC8616AE093F171C3FD /* GradientLoadingBar.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = GradientLoadingBar.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 8629223D3BAF7EC8616AE093F171C3FD /* GradientLoadingBar.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; path = GradientLoadingBar.podspec; sourceTree = ""; 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 = ""; }; 8BD4EB35937102EAFA6B9091548537DC /* GradientLoadingBar-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "GradientLoadingBar-dummy.m"; sourceTree = ""; }; 8BFC221633B8EEC479EE5CBC733737A0 /* LightweightObservable.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = LightweightObservable.modulemap; sourceTree = ""; }; 8F250286A5229A56B46FC13B1262852B /* SwiftLint.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SwiftLint.xcconfig; sourceTree = ""; }; - 9355E756FF7002A283DFC6C0029564B6 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Observable.swift; sourceTree = ""; }; 936A0597BA17B55F59A346D331306B5F /* BottomGradientLoadingBarController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BottomGradientLoadingBarController.swift; sourceTree = ""; }; 9CAA017B1769B508492A30175B3B3267 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Observable.swift; path = LightweightObservable/Classes/Observable/Observable.swift; sourceTree = ""; }; - 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 = ""; }; A91D41367DB29791E5EBDEE0357C605E /* GradientLoadingBar-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GradientLoadingBar-umbrella.h"; sourceTree = ""; }; AA595FD47218C87012335E8C73E53199 /* Pods-GradientLoadingBar_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-GradientLoadingBar_Tests.release.xcconfig"; sourceTree = ""; }; B4BAB5AD5983771499462BBE1F238F29 /* GradientLoadingBar-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GradientLoadingBar-prefix.pch"; sourceTree = ""; }; B7110D1E070583E64F9E9A6B741851EB /* Pods-GradientLoadingBar_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-GradientLoadingBar_Example.release.xcconfig"; sourceTree = ""; }; - 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 = ""; }; C80083841EFE765A5D0AD2D5538A7BF1 /* Pods-GradientLoadingBar_Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-GradientLoadingBar_Example-Info.plist"; sourceTree = ""; }; CE0D98C8EAB658D7185CDEFA1FF71C9A /* LightweightObservable-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "LightweightObservable-prefix.pch"; sourceTree = ""; }; D73E699F3F9F1EE84B5F23BF03FDC2D8 /* Durations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Durations.swift; sourceTree = ""; }; - D83AD160BCDC2F3E1A0648CB9A8C25F9 /* readme.md */ = {isa = PBXFileReference; includeInIndex = 1; path = readme.md; sourceTree = ""; }; + D83AD160BCDC2F3E1A0648CB9A8C25F9 /* readme.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = readme.md; sourceTree = ""; }; 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 = ""; }; EA9E55EC3CE832503856FF3A375CB805 /* Pods-GradientLoadingBar_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-GradientLoadingBar_Example-acknowledgements.plist"; sourceTree = ""; }; @@ -153,7 +151,7 @@ F0AC3E41A31439D7062CB197FB5DF77F /* LightweightObservable-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "LightweightObservable-Info.plist"; sourceTree = ""; }; 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 = ""; }; - F47C9DA0C744E86330DFFAFA12DAB6EC /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; + F47C9DA0C744E86330DFFAFA12DAB6EC /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; F68118DF2CFF8BC6DA8503B6DF614A72 /* Pods-GradientLoadingBar_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-GradientLoadingBar_Example.modulemap"; sourceTree = ""; }; FAE6912920A10496B8570441927F50A1 /* Pods-GradientLoadingBar_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-GradientLoadingBar_Tests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -200,7 +198,6 @@ children = ( 2B1C5D8984DE17B536E3AA18AD9A36AD /* Support Files */, ); - name = SwiftLint; path = SwiftLint; sourceTree = ""; }; @@ -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 = ""; }; @@ -254,16 +249,6 @@ name = iOS; sourceTree = ""; }; - 431E98257DFD585D6ABB3ADAF0352A6A /* Observable */ = { - isa = PBXGroup; - children = ( - 82FEBF300C18E8DEDC03B5E12D6E85A5 /* Disposable.swift */, - 9355E756FF7002A283DFC6C0029564B6 /* Observable.swift */, - ); - name = Observable; - path = Observable; - sourceTree = ""; - }; 463571F3E12C17A372C16E820C609F36 /* Extensions */ = { isa = PBXGroup; children = ( @@ -280,7 +265,6 @@ 4F283E5444407F5E73EF6B43999A1BC0 /* UIColor+CustomColors.swift */, 71239BEF34D3EF1C8CA98006CEEAFE38 /* UIColor+DefaultValues.swift */, ); - name = UIColor; path = UIColor; sourceTree = ""; }; @@ -289,7 +273,6 @@ children = ( 011D7697512BC073D570D65912E05FE6 /* GradientView.swift */, ); - name = Views; path = Views; sourceTree = ""; }; @@ -347,7 +330,6 @@ A905AC0A36502ED362745E3D73467B01 /* Observable+Equatable.swift */, CA369EB846547AE3200999F324A20EF1 /* Support Files */, ); - name = LightweightObservable; path = LightweightObservable; sourceTree = ""; }; @@ -365,7 +347,6 @@ children = ( DD0982CE766FEDDC6A9FF49DFB59184D /* Support Files */, ); - name = SwiftFormat; path = SwiftFormat; sourceTree = ""; }; @@ -374,7 +355,6 @@ children = ( 4538483088F4844FB0F10A96586FB8A9 /* UIView+AnimateIsHidden.swift */, ); - name = UIView; path = UIView; sourceTree = ""; }; @@ -421,7 +401,6 @@ children = ( D73E699F3F9F1EE84B5F23BF03FDC2D8 /* Durations.swift */, ); - name = Helpers; path = Helpers; sourceTree = ""; }; @@ -451,7 +430,6 @@ children = ( 5BD7474DAFACDB8CAABDE74687B2B2FB /* GradientLoadingBarViewModel.swift */, ); - name = ViewModel; path = ViewModel; sourceTree = ""; }; @@ -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"; }; diff --git a/Example/Tests/Feature/GradientLoadingBar/GradientLoadingBarViewModelTestCase.swift b/Example/Tests/Feature/GradientLoadingBar/GradientLoadingBarViewModelTestCase.swift index 6b6d3f5..f592373 100644 --- a/Example/Tests/Feature/GradientLoadingBar/GradientLoadingBarViewModelTestCase.swift +++ b/Example/Tests/Feature/GradientLoadingBar/GradientLoadingBarViewModelTestCase.swift @@ -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 { diff --git a/Example/Tests/Feature/Observable/DisposableTestCase.swift b/Example/Tests/Feature/Observable/DisposableTestCase.swift deleted file mode 100644 index 4c1b84a..0000000 --- a/Example/Tests/Feature/Observable/DisposableTestCase.swift +++ /dev/null @@ -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) - } -} diff --git a/Example/Tests/Feature/Observable/ObservableTestCase.swift b/Example/Tests/Feature/Observable/ObservableTestCase.swift deleted file mode 100644 index 3ac3b2c..0000000 --- a/Example/Tests/Feature/Observable/ObservableTestCase.swift +++ /dev/null @@ -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 - } -} diff --git a/GradientLoadingBar/Classes/Features/GradientLoadingBar/GradientLoadingBarController.swift b/GradientLoadingBar/Classes/Features/GradientLoadingBar/GradientLoadingBarController.swift index a212325..c23984e 100644 --- a/GradientLoadingBar/Classes/Features/GradientLoadingBar/GradientLoadingBarController.swift +++ b/GradientLoadingBar/Classes/Features/GradientLoadingBar/GradientLoadingBarController.swift @@ -7,6 +7,7 @@ // import UIKit +import LightweightObservable /// Typealias for controller to match pod name. public typealias GradientLoadingBar = GradientLoadingBarController @@ -85,11 +86,11 @@ open class GradientLoadingBarController { viewModel.animatedVisibilityUpdate.subscribeDistinct { [weak self] newAnimatedVisibilityUpdate, _ in self?.gradientView.animate(isHidden: newAnimatedVisibilityUpdate.isHidden, duration: newAnimatedVisibilityUpdate.duration) - }.add(to: &disposeBag) + }.disposed(by: &disposeBag) viewModel.superview.subscribeDistinct { [weak self] newSuperview, _ in self?.addGradientView(to: newSuperview) - }.add(to: &disposeBag) + }.disposed(by: &disposeBag) } private func addGradientView(to superview: UIView?) { diff --git a/GradientLoadingBar/Classes/Features/GradientLoadingBar/ViewModel/GradientLoadingBarViewModel.swift b/GradientLoadingBar/Classes/Features/GradientLoadingBar/ViewModel/GradientLoadingBarViewModel.swift index e56e441..9d86d43 100644 --- a/GradientLoadingBar/Classes/Features/GradientLoadingBar/ViewModel/GradientLoadingBarViewModel.swift +++ b/GradientLoadingBar/Classes/Features/GradientLoadingBar/ViewModel/GradientLoadingBarViewModel.swift @@ -7,6 +7,7 @@ // import Foundation +import LightweightObservable /// The `GradientLoadingBarViewModel` class is responsible for the visibility state of the gradient view. class GradientLoadingBarViewModel { diff --git a/GradientLoadingBar/Classes/Features/Observable/Disposable.swift b/GradientLoadingBar/Classes/Features/Observable/Disposable.swift deleted file mode 100644 index 6a8a9bc..0000000 --- a/GradientLoadingBar/Classes/Features/Observable/Disposable.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// Disposable.swift -// GradientLoadingBar -// -// Created by Felix Mau on 11/02/19. -// Copyright © 2019 Felix Mau. All rights reserved. -// - -import Foundation - -// Source -// https://gist.github.com/fxm90/26357043cfe174fabdeedd07d0f25314 - -/// Helper to allow storing multiple disposables (and matching name from RxSwift). -typealias DisposeBag = [Disposable] - -final class Disposable { - // MARK: - Types - - typealias Dispose = () -> Void - - // MARK: - Private properties - - private let dispose: Dispose - - // MARK: - Initializer - - init(_ dispose: @escaping Dispose) { - self.dispose = dispose - } - - deinit { - dispose() - } - - // MARK: - Public methods - - func add(to disposeBag: inout DisposeBag) { - disposeBag.append(self) - } -} diff --git a/GradientLoadingBar/Classes/Features/Observable/Observable.swift b/GradientLoadingBar/Classes/Features/Observable/Observable.swift deleted file mode 100644 index ef06042..0000000 --- a/GradientLoadingBar/Classes/Features/Observable/Observable.swift +++ /dev/null @@ -1,129 +0,0 @@ -// -// Observable.swift -// GradientLoadingBar -// -// Created by Felix Mau on 11/02/19. -// Copyright © 2019 Felix Mau. All rights reserved. -// - -import Foundation - -// Source -// https://gist.github.com/fxm90/26357043cfe174fabdeedd07d0f25314 - -class Observable { - // MARK: - Types - - typealias Index = UInt - - typealias NewValue = T - - typealias OldValue = T? - - typealias Observer = (NewValue, OldValue) -> Void - - // MARK: - Public properties - - /// The current (readonly) value of the observable. - fileprivate(set) var value: T { - didSet { - for (_, observer) in observers { - observer(value, oldValue) - } - } - } - - // MARK: - Private properties - - /// The index of the last inserted observer. - private var lastIndex: Index = 0 - - /// Map with all active observers. - private var observers = [Index: Observer]() - - // MARK: - Initalizer - - /// Initializes a new observable with the given value. - /// - /// - Note: Declared `fileprivate` in order to prevent directly initializing an observable, which can not be updated. - fileprivate init(_ value: T) { - self.value = value - } - - // MARK: - Public methods - - /// Informs the given observer on changes to our `value`. - /// - /// - Parameter observer: The observer-closure that is notified on changes. - func subscribe(_ observer: @escaping Observer) -> Disposable { - let currentIndex = lastIndex + 1 - observers[currentIndex] = observer - - lastIndex = currentIndex - - // Inform observer with initial value. - observer(value, nil) - - // Return a disposable, that removes the entry for this observer when it's deallocated. - return Disposable { [weak self] in - self?.observers[currentIndex] = nil - } - } -} - -extension Observable where T: Equatable { - // MARK: - Types - - typealias Filter = (NewValue, OldValue) -> Bool - - // MARK: - Public methods - - /// Informs the given observer on changes to our `value`, only if the given filter matches. - /// - /// - Parameters: - /// - filter: The filer-closure, that must return `true` in order for the observer to be notified. - /// - observer: The observer-closure that is notified on changes. - func subscribe(filter: @escaping Filter, observer: @escaping Observer) -> Disposable { - return subscribe { nextValue, prevValue in - guard filter(nextValue, prevValue) else { return } - - observer(nextValue, prevValue) - } - } - - /// Informs the given observer on **distinct** changes to our `value`. - /// - /// - Parameter observer: The observer-closure that is notified on changes. - func subscribeDistinct(_ observer: @escaping Observer) -> Disposable { - return subscribe(filter: { $0 != $1 }, - observer: observer) - } -} - -final class Variable: Observable { - // MARK: - Public properties - - /// The current variable converted to an (readonly) `Observable`. - var asObservable: Observable { - return self as Observable - } - - /// The current value of the observable. - override var value: T { - get { - return super.value - } - set { - super.value = newValue - } - } - - // MARK: - Initializer - - /// Initializes a new variable with the given value. - /// - /// - Note: As we've made the initializer to the super class `Observable` fileprivate, we must override it here with public access. - override init(_ value: T) { - super.init(value) - } -}