diff --git a/.gitignore b/.gitignore index dbd306c..ae251e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ -## Build generated -build/ -DerivedData/ +# OS X +.DS_Store -## Various settings +# Xcode +build/ *.pbxuser !default.pbxuser *.mode1v3 @@ -12,53 +12,44 @@ DerivedData/ *.perspectivev3 !default.perspectivev3 xcuserdata/ - -## Other -*.moved-aside *.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific +profile +*.moved-aside +DerivedData *.hmap *.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -.build/ -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ +# Bundler +.bundle -# Carthage -# # Add this line if you want to avoid checking in source code from Carthage dependencies. # Carthage/Checkouts Carthage/Build -# fastlane +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +# Note: if you ignore the Pods directory, make sure to uncomment +# `pod install` in .travis.yml # -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control +# Pods/ -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output -Pods +.build +DerivedData +/.previous-build +xcuserdata +.DS_Store +*~ +\#* +.\#* +.*.sw[nop] +*.xcscmblueprint +/default.profraw +*.xcodeproj +Utilities/Docker/*.tar.gz +.swiftpm +Package.resolved +/build +*.pyc diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 088216c..6087ebe 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -413,7 +413,7 @@ 13D43156C2811562198271DD1F3F32D6 /* UIButton+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIButton+Rx.swift"; path = "RxCocoa/iOS/UIButton+Rx.swift"; sourceTree = ""; }; 14EE2C557CEEE7C8CC7CAB5B9FB0BD07 /* UINavigationController+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UINavigationController+Rx.swift"; path = "RxCocoa/iOS/UINavigationController+Rx.swift"; sourceTree = ""; }; 150550959A5E2126909D9CD099AC66BC /* NSSlider+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSSlider+Rx.swift"; path = "RxCocoa/macOS/NSSlider+Rx.swift"; sourceTree = ""; }; - 15DC18BE7B79A6011B0470691F827479 /* Pods_ServiceProvider_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ServiceProvider_Tests.framework; path = "Pods-ServiceProvider_Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 15DC18BE7B79A6011B0470691F827479 /* Pods_ServiceProvider_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ServiceProvider_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 15F9A5199BC6927819E2EAF5331E1E08 /* UIControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIControl+Rx.swift"; path = "RxCocoa/iOS/UIControl+Rx.swift"; sourceTree = ""; }; 1696501EC67F2E1CBCBFE41B25D34BB2 /* _RXObjCRuntime.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = _RXObjCRuntime.h; path = RxCocoa/Runtime/include/_RXObjCRuntime.h; sourceTree = ""; }; 17E98C2787B625F0C62958FBCE0BD2C1 /* DelaySubscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelaySubscription.swift; path = RxSwift/Observables/DelaySubscription.swift; sourceTree = ""; }; @@ -436,12 +436,12 @@ 249CD93174B76096B44663AF273C0B67 /* Lock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Lock.swift; path = RxSwift/Concurrency/Lock.swift; sourceTree = ""; }; 25768B2A7FF628E69629411FDF247C80 /* Bag+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Bag+Rx.swift"; path = "RxSwift/Extensions/Bag+Rx.swift"; sourceTree = ""; }; 26361D1E7B02B7CD89C2C324A6141F09 /* _RX.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RX.m; path = RxCocoa/Runtime/_RX.m; sourceTree = ""; }; - 269CBD012E5D1DD0FF572DCDF1A8C6E3 /* ServiceReload.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceReload.swift; path = ServiceProvider/Classes/ServiceReload.swift; sourceTree = ""; }; + 269CBD012E5D1DD0FF572DCDF1A8C6E3 /* ServiceReload.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceReload.swift; path = Sources/ServiceProvider/Classes/ServiceReload.swift; sourceTree = ""; }; 281F5B4B0C0961CAF97D9356118A324B /* Timer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timer.swift; path = RxSwift/Observables/Timer.swift; sourceTree = ""; }; 2995231F6036CAC57891F52AF48D6FD0 /* UITableView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UITableView+Rx.swift"; path = "RxCocoa/iOS/UITableView+Rx.swift"; sourceTree = ""; }; 29D8ACF9034C4FC20442CD4F1DFA8428 /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; 2A1A6641926F39EB66055E2F1E72B718 /* ShareReplayScope.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplayScope.swift; path = RxSwift/Observables/ShareReplayScope.swift; sourceTree = ""; }; - 2A3905ABB198DBB6640697A1969547CC /* ServiceProvider.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = ServiceProvider.framework; path = ServiceProvider.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2A3905ABB198DBB6640697A1969547CC /* ServiceProvider.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ServiceProvider.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2AB06640A31929DC2ED62DC33D8CED16 /* Errors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Errors.swift; path = RxSwift/Errors.swift; sourceTree = ""; }; 2AFB40765C9CE4D99E4B6DE3A243055B /* AnonymousObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousObserver.swift; path = RxSwift/Observers/AnonymousObserver.swift; sourceTree = ""; }; 2B6CA7806695BA46C205141827F44F47 /* RxTabBarDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTabBarDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxTabBarDelegateProxy.swift; sourceTree = ""; }; @@ -518,7 +518,7 @@ 6B4D4E074DB0327973DD374828CFB0DB /* KeychainAccess.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = KeychainAccess.modulemap; sourceTree = ""; }; 6BD9F8363FA4EB87058F04CFC144351D /* UIDatePicker+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIDatePicker+Rx.swift"; path = "RxCocoa/iOS/UIDatePicker+Rx.swift"; sourceTree = ""; }; 6BEAACC0E25D12817574669D2011D025 /* AnyObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyObserver.swift; path = RxSwift/AnyObserver.swift; sourceTree = ""; }; - 6C6FF4FB7B12855653E8429F7F4A43AB /* Service.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Service.swift; path = ServiceProvider/Classes/Service.swift; sourceTree = ""; }; + 6C6FF4FB7B12855653E8429F7F4A43AB /* Service.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Service.swift; path = Sources/ServiceProvider/Classes/Service.swift; sourceTree = ""; }; 6D84B7D1E0EB0259A14A81682269AEF5 /* ObserverBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverBase.swift; path = RxSwift/Observers/ObserverBase.swift; sourceTree = ""; }; 6F16C8BDF788CAC0F23475E65ACB03D8 /* RxSwift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-umbrella.h"; sourceTree = ""; }; 7001729AFEAAC9AB36F653D06AFCE462 /* UINavigationItem+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UINavigationItem+Rx.swift"; path = "RxCocoa/iOS/UINavigationItem+Rx.swift"; sourceTree = ""; }; @@ -543,7 +543,7 @@ 7E4AAC7BCCAC19A1473EEE492AB3E24F /* RxTabBarControllerDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTabBarControllerDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift; sourceTree = ""; }; 7F2137B211A00DC00E6CA4AC7B3234DE /* Reduce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reduce.swift; path = RxSwift/Observables/Reduce.swift; sourceTree = ""; }; 7FF76D647988585CCCC04A13DE8EA18C /* UIPageControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIPageControl+Rx.swift"; path = "RxCocoa/iOS/UIPageControl+Rx.swift"; sourceTree = ""; }; - 809C5FAB588354C9BA37DC3EAB8CB45C /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxSwift.framework; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 809C5FAB588354C9BA37DC3EAB8CB45C /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 80FE33737D9238DC81CA9C3C547ABD57 /* Timeout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeout.swift; path = RxSwift/Observables/Timeout.swift; sourceTree = ""; }; 813CC6733B65E36ECAF37CFD75464FBF /* RxCocoa.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxCocoa.xcconfig; sourceTree = ""; }; 81A0BA3F829578F83A6AA2E3FB424949 /* UISwitch+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UISwitch+Rx.swift"; path = "RxCocoa/iOS/UISwitch+Rx.swift"; sourceTree = ""; }; @@ -551,7 +551,7 @@ 82CC2F7CFC167D883BCDD5E3E928EA37 /* Buffer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Buffer.swift; path = RxSwift/Observables/Buffer.swift; sourceTree = ""; }; 83DF7CEADD823DF7DF0270903A4B10F4 /* NSControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSControl+Rx.swift"; path = "RxCocoa/macOS/NSControl+Rx.swift"; sourceTree = ""; }; 84F748B8822231F31025E283481AB9CE /* Pods-ServiceProvider_Tests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-ServiceProvider_Tests-Info.plist"; sourceTree = ""; }; - 87D96E10B82BD21A62C84395BA8506E6 /* ServiceKeychain.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceKeychain.swift; path = ServiceProvider/Classes/ServiceKeychain.swift; sourceTree = ""; }; + 87D96E10B82BD21A62C84395BA8506E6 /* ServiceKeychain.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceKeychain.swift; path = Sources/ServiceProvider/Classes/ServiceKeychain.swift; sourceTree = ""; }; 885216827B48C35280D12F0B02CB0047 /* PrimitiveSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PrimitiveSequence.swift; path = RxSwift/Traits/PrimitiveSequence.swift; sourceTree = ""; }; 8C372FB605D8C2F7B100CCB197102EB9 /* RxSwift-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "RxSwift-Info.plist"; sourceTree = ""; }; 8CF474136E1B0E63F88F8D0060A76076 /* Deprecated.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deprecated.swift; path = RxSwift/Deprecated.swift; sourceTree = ""; }; @@ -559,7 +559,7 @@ 8DDDF172D36A623453A2C4F643C4CA85 /* ConnectableObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConnectableObservableType.swift; path = RxSwift/ConnectableObservableType.swift; sourceTree = ""; }; 91A8BA606590A0224E343FA594A8D07B /* RxCollectionViewReactiveArrayDataSource.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxCollectionViewReactiveArrayDataSource.swift; path = RxCocoa/iOS/DataSources/RxCollectionViewReactiveArrayDataSource.swift; sourceTree = ""; }; 91B8DB8EC1C8CA12ED1CC02DAF4F5608 /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedDisposeType.swift; path = RxSwift/Concurrency/SynchronizedDisposeType.swift; sourceTree = ""; }; - 91C96F157B73957823D045924DBEDDB9 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; + 91C96F157B73957823D045924DBEDDB9 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 9237BEB7EF5BF3CABB02B7D291208889 /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; 926933DB4FA37BD2AD6436448847794C /* UISegmentedControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UISegmentedControl+Rx.swift"; path = "RxCocoa/iOS/UISegmentedControl+Rx.swift"; sourceTree = ""; }; 93DFFA38488164FBA8713E6289F9F8CD /* Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Driver.swift; path = RxCocoa/Traits/Driver/Driver.swift; sourceTree = ""; }; @@ -581,7 +581,7 @@ 9C0F994707691DC526658FFFECF8F215 /* KeychainAccess.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = KeychainAccess.xcconfig; sourceTree = ""; }; 9C96EDC17EDDFD3B3D28514BCC918EBB /* UISlider+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UISlider+Rx.swift"; path = "RxCocoa/iOS/UISlider+Rx.swift"; sourceTree = ""; }; 9D935BCF566A27DF6F3BC75283A05986 /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.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; }; 9DAF9B9D48230B4F8D8B2911259780A1 /* CurrentThreadScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CurrentThreadScheduler.swift; path = RxSwift/Schedulers/CurrentThreadScheduler.swift; sourceTree = ""; }; 9E3339155D3E908FB69CD08D0A1D45EA /* ScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItem.swift; path = RxSwift/Schedulers/Internal/ScheduledItem.swift; sourceTree = ""; }; 9FB4DA9C1033846631D6EA8C20F8E3CB /* Pods-ServiceProvider_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ServiceProvider_Example.debug.xcconfig"; sourceTree = ""; }; @@ -591,7 +591,7 @@ A1CCF680D80A18C9FBC14ECB1A208E31 /* RecursiveLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveLock.swift; path = Platform/RecursiveLock.swift; sourceTree = ""; }; A3E9977D1F226D92DCEB96895C9F5411 /* ControlTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ControlTarget.swift; path = RxCocoa/Common/ControlTarget.swift; sourceTree = ""; }; A403AC22739BDE732D2E06032F8DA583 /* NSObject+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Rx.swift"; path = "RxCocoa/Foundation/NSObject+Rx.swift"; sourceTree = ""; }; - A43C31F892964E27E1858FE052928248 /* Pods_ServiceProvider_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ServiceProvider_Example.framework; path = "Pods-ServiceProvider_Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + A43C31F892964E27E1858FE052928248 /* Pods_ServiceProvider_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ServiceProvider_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A4C4DF680381897292DABD654BF49647 /* RxTableViewDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTableViewDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift; sourceTree = ""; }; A5B02BC60954D2605E34171AABEB52A2 /* Do.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Do.swift; path = RxSwift/Observables/Do.swift; sourceTree = ""; }; A5E60671C30540069EB60DCFA00DF751 /* BehaviorSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BehaviorSubject.swift; path = RxSwift/Subjects/BehaviorSubject.swift; sourceTree = ""; }; @@ -632,7 +632,7 @@ BB3117484295787DAE559D44AF820238 /* RxTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTarget.swift; path = RxCocoa/Common/RxTarget.swift; sourceTree = ""; }; BBC14862603A92B36AC02A624CB9AFC6 /* Skip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Skip.swift; path = RxSwift/Observables/Skip.swift; sourceTree = ""; }; BC04D44FFB172C7A133FC94B8D8F9756 /* RxCocoa.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxCocoa.swift; path = RxCocoa/RxCocoa.swift; sourceTree = ""; }; - BC432FD48A5932251F1CAFBC4BF74894 /* RxCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxCocoa.framework; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BC432FD48A5932251F1CAFBC4BF74894 /* RxCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BC50B58F92423DE97C26E413DBDD0CB2 /* UIGestureRecognizer+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIGestureRecognizer+Rx.swift"; path = "RxCocoa/iOS/UIGestureRecognizer+Rx.swift"; sourceTree = ""; }; BC5C186AD1A4B1D7296CCD8A42905884 /* KeyPathBinder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = KeyPathBinder.swift; path = RxCocoa/Common/KeyPathBinder.swift; sourceTree = ""; }; BD2E561CE65841A512B0364110375EA4 /* Debug.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debug.swift; path = RxSwift/Observables/Debug.swift; sourceTree = ""; }; @@ -655,7 +655,7 @@ CB4D89AA7E6FC92C04CE0AC885A6F0B2 /* Reactive.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reactive.swift; path = RxSwift/Reactive.swift; sourceTree = ""; }; CBCC5B4B505202023D8F1BC0292BA3CD /* SynchronizedOnType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedOnType.swift; path = RxSwift/Concurrency/SynchronizedOnType.swift; sourceTree = ""; }; CCDFF87F84C8EE9C7B375F626F922B0F /* DefaultIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DefaultIfEmpty.swift; path = RxSwift/Observables/DefaultIfEmpty.swift; sourceTree = ""; }; - CD21180F1DE02C3D5E7A14339567AB4C /* ServiceNotification.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceNotification.swift; path = ServiceProvider/Classes/ServiceNotification.swift; sourceTree = ""; }; + CD21180F1DE02C3D5E7A14339567AB4C /* ServiceNotification.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceNotification.swift; path = Sources/ServiceProvider/Classes/ServiceNotification.swift; sourceTree = ""; }; CD4A5DBB72FA693933E5787CD09B7716 /* Generate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Generate.swift; path = RxSwift/Observables/Generate.swift; sourceTree = ""; }; CD5DAAC0A425AAE07DA2FDC79188C1E2 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Observable.swift; path = RxSwift/Observable.swift; sourceTree = ""; }; CDC69B6FEB02B66B35C31C99282A705E /* SingleAsync.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAsync.swift; path = RxSwift/Observables/SingleAsync.swift; sourceTree = ""; }; @@ -663,7 +663,7 @@ CF70C3430AA050D09D4E3A43046F85AA /* Take.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Take.swift; path = RxSwift/Observables/Take.swift; sourceTree = ""; }; D0931FD12122E01F0C3D761FFD62DF71 /* Delay.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Delay.swift; path = RxSwift/Observables/Delay.swift; sourceTree = ""; }; D0BD833401EE045B84BF7E51D9608076 /* NopDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NopDisposable.swift; path = RxSwift/Disposables/NopDisposable.swift; sourceTree = ""; }; - D19CFD045196453AC807B0B27C2B6AB0 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + D19CFD045196453AC807B0B27C2B6AB0 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; D241C443A18B3894A8A5BF3E6E84FE25 /* RxSearchBarDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxSearchBarDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift; sourceTree = ""; }; D26F4F3C366B3D158148C8087EC40B37 /* Pods-ServiceProvider_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ServiceProvider_Example-acknowledgements.markdown"; sourceTree = ""; }; D2992DB62B78241D53FC1594EA00CC57 /* Never.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Never.swift; path = RxSwift/Observables/Never.swift; sourceTree = ""; }; @@ -674,7 +674,7 @@ D5D52ECBB63678C1EB50B47664DCC8CF /* SkipUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipUntil.swift; path = RxSwift/Observables/SkipUntil.swift; sourceTree = ""; }; D8A5A75C20111C3D814342244835AF52 /* String+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "String+Rx.swift"; path = "RxSwift/Extensions/String+Rx.swift"; sourceTree = ""; }; DAE55E7FF899318658DF36331B3FB4E0 /* Pods-ServiceProvider_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-ServiceProvider_Tests.modulemap"; sourceTree = ""; }; - DB61A5769AE66DFDF1A384127A1F3AC1 /* ServiceStored.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceStored.swift; path = ServiceProvider/Classes/ServiceStored.swift; sourceTree = ""; }; + DB61A5769AE66DFDF1A384127A1F3AC1 /* ServiceStored.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceStored.swift; path = Sources/ServiceProvider/Classes/ServiceStored.swift; sourceTree = ""; }; DBF69FD9D4DBCA3DAB9F5198F532895C /* Debounce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debounce.swift; path = RxSwift/Observables/Debounce.swift; sourceTree = ""; }; DD7B97F842A2F7CA38242C8E024B136A /* Signal+Subscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Signal+Subscription.swift"; path = "RxCocoa/Traits/Signal/Signal+Subscription.swift"; sourceTree = ""; }; DE18AAF54FD56D0F87E53DCB16E11DBB /* RxTableViewDataSourceProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTableViewDataSourceProxy.swift; path = RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift; sourceTree = ""; }; @@ -688,13 +688,13 @@ E4545FA21988A9B13D68577E963EFA99 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = RxSwift/Observables/Error.swift; sourceTree = ""; }; E78CBB341532326FA2051F5A0352BD9D /* SharedSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SharedSequence.swift; path = RxCocoa/Traits/SharedSequence/SharedSequence.swift; sourceTree = ""; }; E8788C326347355070815AD174C46973 /* KVORepresentable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = KVORepresentable.swift; path = RxCocoa/Foundation/KVORepresentable.swift; sourceTree = ""; }; - E8EE7F078656FABB8F6821D10FF994BB /* KeychainAccess.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = KeychainAccess.framework; path = KeychainAccess.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E8EE7F078656FABB8F6821D10FF994BB /* KeychainAccess.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = KeychainAccess.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E967FC09FFE456859BA0A11BE8CFCAFE /* UIRefreshControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIRefreshControl+Rx.swift"; path = "RxCocoa/iOS/UIRefreshControl+Rx.swift"; sourceTree = ""; }; E9EA9EFCF1B9A669A62BE0F2BC831542 /* RxCocoa-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxCocoa-dummy.m"; sourceTree = ""; }; EA3C4AC6DEB0D2359D8FC5C08D475DB5 /* Logging.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Logging.swift; path = RxCocoa/Foundation/Logging.swift; sourceTree = ""; }; EADA49C6D6C18ED7910BED41C21ED0D5 /* Materialize.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Materialize.swift; path = RxSwift/Observables/Materialize.swift; sourceTree = ""; }; - EBE8A5C83E2E5519BEC530B9DB4EAE89 /* ServiceProvider.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = ServiceProvider.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - EC18A56C3056679B3951F9008C58A882 /* ServiceStoredRx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceStoredRx.swift; path = ServiceProvider/Classes/ServiceStoredRx.swift; sourceTree = ""; }; + EBE8A5C83E2E5519BEC530B9DB4EAE89 /* ServiceProvider.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; path = ServiceProvider.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + EC18A56C3056679B3951F9008C58A882 /* ServiceStoredRx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceStoredRx.swift; path = Sources/ServiceProvider/Classes/ServiceStoredRx.swift; sourceTree = ""; }; EE7B66A500BCE8088A06F9597BEA6661 /* SchedulerServices+Emulation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SchedulerServices+Emulation.swift"; path = "RxSwift/Schedulers/SchedulerServices+Emulation.swift"; sourceTree = ""; }; EE9E07A77B2FCA94BCA4753C27167B03 /* KVORepresentable+Swift.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "KVORepresentable+Swift.swift"; path = "RxCocoa/Foundation/KVORepresentable+Swift.swift"; sourceTree = ""; }; EF74BB9451F37A386042297B380F8A2F /* ImmediateSchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateSchedulerType.swift; path = RxSwift/ImmediateSchedulerType.swift; sourceTree = ""; }; @@ -996,7 +996,6 @@ 3B2700BF54A72A71B50BB34C2C6EE8A1 /* URLSession+Rx.swift */, 8FD5D9821A6715FBB52527AC511CDE45 /* Support Files */, ); - name = RxCocoa; path = RxCocoa; sourceTree = ""; }; @@ -1155,7 +1154,6 @@ A913A5D52521CED966A2C1CF537FCA13 /* Zip+Collection.swift */, 7CC448DC4A209D018D5DF81F64147B71 /* Support Files */, ); - name = RxSwift; path = RxSwift; sourceTree = ""; }; @@ -1239,7 +1237,6 @@ 1103C8D3890809C344B729FB5031A97D /* Keychain.swift */, 4AF236A3034993B64EE1AA672FEFB64C /* Support Files */, ); - name = KeychainAccess; path = KeychainAccess; sourceTree = ""; }; @@ -2246,8 +2243,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 = 5.0; SYMROOT = "${SRCROOT}/../build"; }; diff --git a/Example/Pods/Pods.xcodeproj/xcuserdata/brennobemoura.xcuserdatad/xcschemes/xcschememanagement.plist b/Example/Pods/Pods.xcodeproj/xcuserdata/brennobemoura.xcuserdatad/xcschemes/xcschememanagement.plist index fd92ca7..a174658 100644 --- a/Example/Pods/Pods.xcodeproj/xcuserdata/brennobemoura.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Example/Pods/Pods.xcodeproj/xcuserdata/brennobemoura.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,30 +9,51 @@ isShown + KeychainAccess.xcscheme_^#shared#^_ + + orderHint + 4 + Pods-ServiceProvider_Example.xcscheme isShown + orderHint + 0 Pods-ServiceProvider_Tests.xcscheme isShown + orderHint + 1 RxCocoa.xcscheme isShown + RxCocoa.xcscheme_^#shared#^_ + + orderHint + 5 + RxSwift.xcscheme isShown + RxSwift.xcscheme_^#shared#^_ + + orderHint + 6 + ServiceProvider.xcscheme isShown + orderHint + 2 SuppressBuildableAutocreation diff --git a/Example/ServiceProvider.xcodeproj/project.pbxproj b/Example/ServiceProvider.xcodeproj/project.pbxproj index edf26d8..42ed8c5 100644 --- a/Example/ServiceProvider.xcodeproj/project.pbxproj +++ b/Example/ServiceProvider.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 0C36D52B2440C1770062752A /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C36D52A2440C1770062752A /* Package.swift */; }; 4F37D739747FB018A5E2AA96 /* Pods_ServiceProvider_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C286321D1657E7011C8B5C9 /* Pods_ServiceProvider_Tests.framework */; }; 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; @@ -28,6 +29,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 0C36D52A2440C1770062752A /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Package.swift; path = ../Package.swift; sourceTree = ""; }; 1949C23199C656A3E6509960 /* Pods-ServiceProvider_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ServiceProvider_Tests.release.xcconfig"; path = "Target Support Files/Pods-ServiceProvider_Tests/Pods-ServiceProvider_Tests.release.xcconfig"; sourceTree = ""; }; 1C2546DF388A74D95578F42A /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 4C286321D1657E7011C8B5C9 /* Pods_ServiceProvider_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ServiceProvider_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -72,6 +74,7 @@ 607FACC71AFB9204008FA782 = { isa = PBXGroup; children = ( + 0C36D52A2440C1770062752A /* Package.swift */, 607FACF51AFB993E008FA782 /* Podspec Metadata */, 607FACD21AFB9204008FA782 /* Example for ServiceProvider */, 607FACE81AFB9204008FA782 /* Tests */, @@ -337,6 +340,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 0C36D52B2440C1770062752A /* Package.swift in Sources */, 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, ); diff --git a/Example/ServiceProvider.xcworkspace/xcuserdata/brennobemoura.xcuserdatad/UserInterfaceState.xcuserstate b/Example/ServiceProvider.xcworkspace/xcuserdata/brennobemoura.xcuserdatad/UserInterfaceState.xcuserstate index c54d17a..2b66109 100644 Binary files a/Example/ServiceProvider.xcworkspace/xcuserdata/brennobemoura.xcuserdatad/UserInterfaceState.xcuserstate and b/Example/ServiceProvider.xcworkspace/xcuserdata/brennobemoura.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/LICENSE b/LICENSE index a08a425..fea4d29 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019 brennobemoura +Copyright (c) 2019-Present Umobi - https:github.com/umobi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..8f02ed2 --- /dev/null +++ b/Package.swift @@ -0,0 +1,29 @@ +// swift-tools-version:5.2 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "ServiceProvider", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "ServiceProvider", + targets: ["ServiceProvider"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + .package(url: "https://github.com/kishikawakatsumi/KeychainAccess", "3.2"..<"4.1.0"), + .package(url: "https://github.com/ReactiveX/RxSwift", from: "5.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "ServiceProvider", + dependencies: ["RxSwift", "RxCocoa", "KeychainAccess"]), + .testTarget( + name: "ServiceProviderTests", + dependencies: ["ServiceProvider"]), + ] +) diff --git a/ServiceProvider.podspec b/ServiceProvider.podspec index d155bbb..0738590 100644 --- a/ServiceProvider.podspec +++ b/ServiceProvider.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'ServiceProvider' - s.version = '1.1.1' + s.version = '1.1.2' s.summary = 'ServiceProvider keeps your data near from our code' # This description is used to generate tags and improve search results. @@ -34,7 +34,7 @@ DESC s.source_files = 'ServiceProvider/Classes/**/*' - s.dependency 'RxSwift', '>= 4.5', "<= 5.0" - s.dependency 'RxCocoa', '>= 4.5', "<= 5.0" + s.dependency 'RxSwift', '5.0" + s.dependency 'RxCocoa', '5.0" s.dependency 'KeychainAccess', ">= 3.2", '<= 4.1.0' end diff --git a/ServiceProvider/Classes/ServiceKeychain.swift b/ServiceProvider/Classes/ServiceKeychain.swift deleted file mode 100644 index a3d9ffb..0000000 --- a/ServiceProvider/Classes/ServiceKeychain.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// ServiceKeychain.swift -// mercadoon -// -// Created by brennobemoura on 21/08/19. -// Copyright © 2019 brennobemoura. All rights reserved. -// - -import Foundation -import KeychainAccess - -public protocol KeychainKey: RawRepresentable { - var rawValue: String { get } -} - -public protocol ServiceKeychain { - associatedtype KeychainKeys: KeychainKey - - var keychain: Keychain { get } -} - -public extension ServiceKeychain { - func set(_ value: String, for key: KeychainKeys) throws { - try self.keychain.set(value, key: key.rawValue) - } - - func set(_ value: Data, for key: KeychainKeys) throws { - try self.keychain.set(value, key: key.rawValue) - } - - func get(for key: KeychainKeys) throws -> String? { - return try self.keychain.getString(key.rawValue) - } - - func get(for key: KeychainKeys) throws -> Data? { - return try self.keychain.getData(key.rawValue) - } - - func remove(for key: KeychainKeys) throws { - try self.keychain.remove(key.rawValue) - } -} - -public extension Keychain { - static var main: Keychain { - return .init(service: Bundle.main.bundleIdentifier!) - } -} - -public extension ServiceKeychain { - var keychain: Keychain { - return .main - } -} diff --git a/ServiceProvider/Classes/ServiceNotification.swift b/ServiceProvider/Classes/ServiceNotification.swift deleted file mode 100644 index 629c677..0000000 --- a/ServiceProvider/Classes/ServiceNotification.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// ServiceNotification.swift -// mercadoon -// -// Created by brennobemoura on 21/08/19. -// Copyright © 2019 brennobemoura. All rights reserved. -// - -import Foundation - -public protocol NotificationKey: RawRepresentable where RawValue == String {} - -public protocol ServiceNotification: class { - associatedtype NotificationKeys: NotificationKey -} - -public extension NotificationKey { - func name(_ serviceNotification: Service) -> Notification.Name { - return Notification.Name("\(ObjectIdentifier(serviceNotification))" + "." + self.rawValue) - } -} - -public extension ServiceNotification { - func post(object: Any? = nil, for key: NotificationKeys) { - NotificationCenter.default.post(name: key.name(self), object: nil) - } -} - -public extension Service where Controller: ServiceNotification { - func notification(_ key: Controller.NotificationKeys) -> Notification.Name? { - return key.name(self.controller) - } -} diff --git a/ServiceProvider/Classes/ServiceReload.swift b/ServiceProvider/Classes/ServiceReload.swift deleted file mode 100644 index 2efb1ed..0000000 --- a/ServiceProvider/Classes/ServiceReload.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// ServiceReload.swift -// mercadoon -// -// Created by brennobemoura on 21/08/19. -// Copyright © 2019 brennobemoura. All rights reserved. -// - -import Foundation -import RxCocoa -import RxSwift - -open class ReloadService: Service { - open func reload(_ completionHandler: (() -> Void)? = nil) { - self.controller.reload(completionHandler) - } -} - -open class ReloadController: ServiceController { - public final let disposeBag = DisposeBag() - - open func reload(_ completionHandler: (() -> Void)? = nil) { - completionHandler?() - } - - public required init() { - NotificationCenter.default.rx - .notification(NotificationKeys.reloadInfo.name(self)) - .asDriver(onErrorDriveWith: .never()) - .drive(onNext: { [weak self] _ in - self?.reload() - }).disposed(by: disposeBag) - - DispatchQueue.global().asyncAfter(deadline: .now() + 1.0, execute: { - self.post(for: .reloadInfo) - }) - } -} - -extension ReloadController: ServiceNotification { - public enum NotificationKeys: String, NotificationKey { - case reloadInfo - } -} diff --git a/ServiceProvider/Assets/.gitkeep b/Sources/ServiceProvider/Assets/.gitkeep similarity index 100% rename from ServiceProvider/Assets/.gitkeep rename to Sources/ServiceProvider/Assets/.gitkeep diff --git a/ServiceProvider/Classes/.gitkeep b/Sources/ServiceProvider/Classes/.gitkeep similarity index 100% rename from ServiceProvider/Classes/.gitkeep rename to Sources/ServiceProvider/Classes/.gitkeep diff --git a/ServiceProvider/Classes/Service.swift b/Sources/ServiceProvider/Classes/Service.swift similarity index 65% rename from ServiceProvider/Classes/Service.swift rename to Sources/ServiceProvider/Classes/Service.swift index 4eb9606..8d38b88 100644 --- a/ServiceProvider/Classes/Service.swift +++ b/Sources/ServiceProvider/Classes/Service.swift @@ -1,9 +1,23 @@ // -// Service.swift -// mercadoon +// Copyright (c) 2019-Present Umobi - https://github.com/umobi // -// Created by brennobemoura on 13/08/19. -// Copyright © 2019 brennobemoura. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. // import Foundation diff --git a/Sources/ServiceProvider/Classes/ServiceKeychain.swift b/Sources/ServiceProvider/Classes/ServiceKeychain.swift new file mode 100644 index 0000000..7f7c2db --- /dev/null +++ b/Sources/ServiceProvider/Classes/ServiceKeychain.swift @@ -0,0 +1,68 @@ +// +// Copyright (c) 2019-Present Umobi - https://github.com/umobi +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation +import KeychainAccess + +public protocol KeychainKey: RawRepresentable { + var rawValue: String { get } +} + +public protocol ServiceKeychain { + associatedtype KeychainKeys: KeychainKey + + var keychain: Keychain { get } +} + +public extension ServiceKeychain { + func set(_ value: String, for key: KeychainKeys) throws { + try self.keychain.set(value, key: key.rawValue) + } + + func set(_ value: Data, for key: KeychainKeys) throws { + try self.keychain.set(value, key: key.rawValue) + } + + func get(for key: KeychainKeys) throws -> String? { + return try self.keychain.getString(key.rawValue) + } + + func get(for key: KeychainKeys) throws -> Data? { + return try self.keychain.getData(key.rawValue) + } + + func remove(for key: KeychainKeys) throws { + try self.keychain.remove(key.rawValue) + } +} + +public extension Keychain { + static var main: Keychain { + return .init(service: Bundle.main.bundleIdentifier!) + } +} + +public extension ServiceKeychain { + var keychain: Keychain { + return .main + } +} diff --git a/Sources/ServiceProvider/Classes/ServiceNotification.swift b/Sources/ServiceProvider/Classes/ServiceNotification.swift new file mode 100644 index 0000000..5e4940d --- /dev/null +++ b/Sources/ServiceProvider/Classes/ServiceNotification.swift @@ -0,0 +1,47 @@ +// +// Copyright (c) 2019-Present Umobi - https://github.com/umobi +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +public protocol NotificationKey: RawRepresentable where RawValue == String {} + +public protocol ServiceNotification: class { + associatedtype NotificationKeys: NotificationKey +} + +public extension NotificationKey { + func name(_ serviceNotification: Service) -> Notification.Name { + return Notification.Name("\(ObjectIdentifier(serviceNotification))" + "." + self.rawValue) + } +} + +public extension ServiceNotification { + func post(object: Any? = nil, for key: NotificationKeys) { + NotificationCenter.default.post(name: key.name(self), object: nil) + } +} + +public extension Service where Controller: ServiceNotification { + func notification(_ key: Controller.NotificationKeys) -> Notification.Name? { + return key.name(self.controller) + } +} diff --git a/Sources/ServiceProvider/Classes/ServiceReload.swift b/Sources/ServiceProvider/Classes/ServiceReload.swift new file mode 100644 index 0000000..420a141 --- /dev/null +++ b/Sources/ServiceProvider/Classes/ServiceReload.swift @@ -0,0 +1,58 @@ +// +// Copyright (c) 2019-Present Umobi - https://github.com/umobi +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation +import RxCocoa +import RxSwift + +open class ReloadService: Service { + open func reload(_ completionHandler: (() -> Void)? = nil) { + self.controller.reload(completionHandler) + } +} + +open class ReloadController: ServiceController { + public final let disposeBag = DisposeBag() + + open func reload(_ completionHandler: (() -> Void)? = nil) { + completionHandler?() + } + + public required init() { + NotificationCenter.default.rx + .notification(NotificationKeys.reloadInfo.name(self)) + .asDriver(onErrorDriveWith: .never()) + .drive(onNext: { [weak self] _ in + self?.reload() + }).disposed(by: disposeBag) + + DispatchQueue.global().asyncAfter(deadline: .now() + 1.0, execute: { + self.post(for: .reloadInfo) + }) + } +} + +extension ReloadController: ServiceNotification { + public enum NotificationKeys: String, NotificationKey { + case reloadInfo + } +} diff --git a/ServiceProvider/Classes/ServiceStored.swift b/Sources/ServiceProvider/Classes/ServiceStored.swift similarity index 54% rename from ServiceProvider/Classes/ServiceStored.swift rename to Sources/ServiceProvider/Classes/ServiceStored.swift index 597056f..099482c 100644 --- a/ServiceProvider/Classes/ServiceStored.swift +++ b/Sources/ServiceProvider/Classes/ServiceStored.swift @@ -1,9 +1,23 @@ // -// BaseService.swift -// TokBeauty +// Copyright (c) 2019-Present Umobi - https://github.com/umobi // -// Created by Ramon Vicente on 14/03/17. -// Copyright © 2017 TokBeauty. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. // import Foundation diff --git a/ServiceProvider/Classes/ServiceStoredRx.swift b/Sources/ServiceProvider/Classes/ServiceStoredRx.swift similarity index 73% rename from ServiceProvider/Classes/ServiceStoredRx.swift rename to Sources/ServiceProvider/Classes/ServiceStoredRx.swift index d6c30fd..92533d6 100644 --- a/ServiceProvider/Classes/ServiceStoredRx.swift +++ b/Sources/ServiceProvider/Classes/ServiceStoredRx.swift @@ -1,9 +1,23 @@ // -// ServiceStoredRx.swift -// mercadoon +// Copyright (c) 2019-Present Umobi - https://github.com/umobi // -// Created by brennobemoura on 21/08/19. -// Copyright © 2019 brennobemoura. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. // import Foundation diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..751019a --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import ServiceProviderTests + +var tests = [XCTestCaseEntry]() +tests += ServiceProviderTests.allTests() +XCTMain(tests) diff --git a/Tests/ServiceProviderTests/ServiceProviderTests.swift b/Tests/ServiceProviderTests/ServiceProviderTests.swift new file mode 100644 index 0000000..460b4c0 --- /dev/null +++ b/Tests/ServiceProviderTests/ServiceProviderTests.swift @@ -0,0 +1,15 @@ +import XCTest +@testable import ServiceProvider + +final class ServiceProviderTests: XCTestCase { + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(ServiceProvider().text, "Hello, World!") + } + + static var allTests = [ + ("testExample", testExample), + ] +} diff --git a/Tests/ServiceProviderTests/XCTestManifests.swift b/Tests/ServiceProviderTests/XCTestManifests.swift new file mode 100644 index 0000000..7d60657 --- /dev/null +++ b/Tests/ServiceProviderTests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !canImport(ObjectiveC) +public func allTests() -> [XCTestCaseEntry] { + return [ + testCase(ServiceProviderTests.allTests), + ] +} +#endif