├── BigModule ├── BigModule.h ├── BigModule.xcassets │ ├── Contents.json │ └── woman.imageset │ │ ├── Contents.json │ │ ├── depositphotos_130002458-stock-illustration-woman-pictogram-icon-image-1.jpg │ │ └── depositphotos_130002458-stock-illustration-woman-pictogram-icon-image.jpg ├── BigModuleClass.swift ├── Bundle+BigModule.swift └── Info.plist ├── BigModuleTests ├── BigModuleTests.swift └── Info.plist ├── LittleModule ├── Info.plist ├── LittleModule.h └── LittleModuleClass.swift ├── LittleModuleTests ├── Info.plist └── LittleModuleTests.swift ├── Modularization.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── rayane_kurrimboccus.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcshareddata │ └── xcschemes │ │ ├── BigModule.xcscheme │ │ ├── LittleModule.xcscheme │ │ └── Modularization.xcscheme └── xcuserdata │ └── rayane_kurrimboccus.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── Modularization.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── rayane_kurrimboccus.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── Modularization ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── man.imageset │ │ ├── 1-1.jpg │ │ ├── 1-2.jpg │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── MainAppClass.swift └── ViewController.swift ├── ModularizationTests ├── Info.plist └── ModularizationTests.swift ├── Podfile ├── Podfile.lock ├── Pods ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── rayane_kurrimboccus.xcuserdatad │ │ └── xcschemes │ │ ├── Pods-BigModule.xcscheme │ │ ├── Pods-BigModuleTests.xcscheme │ │ ├── Pods-LittleModule.xcscheme │ │ ├── Pods-LittleModuleTests.xcscheme │ │ ├── Pods-Modularization.xcscheme │ │ ├── Pods-ModularizationTests.xcscheme │ │ ├── RxSwift.xcscheme │ │ └── xcschememanagement.plist ├── RxSwift │ ├── LICENSE.md │ ├── Platform │ │ ├── AtomicInt.swift │ │ ├── DataStructures │ │ │ ├── Bag.swift │ │ │ ├── InfiniteSequence.swift │ │ │ ├── PriorityQueue.swift │ │ │ └── Queue.swift │ │ ├── DeprecationWarner.swift │ │ ├── DispatchQueue+Extensions.swift │ │ ├── Platform.Darwin.swift │ │ ├── Platform.Linux.swift │ │ └── RecursiveLock.swift │ ├── README.md │ └── RxSwift │ │ ├── AnyObserver.swift │ │ ├── Cancelable.swift │ │ ├── Concurrency │ │ ├── AsyncLock.swift │ │ ├── Lock.swift │ │ ├── LockOwnerType.swift │ │ ├── SynchronizedDisposeType.swift │ │ ├── SynchronizedOnType.swift │ │ └── SynchronizedUnsubscribeType.swift │ │ ├── ConnectableObservableType.swift │ │ ├── Deprecated.swift │ │ ├── Disposable.swift │ │ ├── Disposables │ │ ├── AnonymousDisposable.swift │ │ ├── BinaryDisposable.swift │ │ ├── BooleanDisposable.swift │ │ ├── CompositeDisposable.swift │ │ ├── Disposables.swift │ │ ├── DisposeBag.swift │ │ ├── DisposeBase.swift │ │ ├── NopDisposable.swift │ │ ├── RefCountDisposable.swift │ │ ├── ScheduledDisposable.swift │ │ ├── SerialDisposable.swift │ │ ├── SingleAssignmentDisposable.swift │ │ └── SubscriptionDisposable.swift │ │ ├── Errors.swift │ │ ├── Event.swift │ │ ├── Extensions │ │ ├── Bag+Rx.swift │ │ └── String+Rx.swift │ │ ├── GroupedObservable.swift │ │ ├── ImmediateSchedulerType.swift │ │ ├── Observable.swift │ │ ├── ObservableConvertibleType.swift │ │ ├── ObservableType+Extensions.swift │ │ ├── ObservableType.swift │ │ ├── Observables │ │ ├── AddRef.swift │ │ ├── Amb.swift │ │ ├── AsMaybe.swift │ │ ├── AsSingle.swift │ │ ├── Buffer.swift │ │ ├── Catch.swift │ │ ├── CombineLatest+Collection.swift │ │ ├── CombineLatest+arity.swift │ │ ├── CombineLatest.swift │ │ ├── Concat.swift │ │ ├── Create.swift │ │ ├── Debounce.swift │ │ ├── Debug.swift │ │ ├── DefaultIfEmpty.swift │ │ ├── Deferred.swift │ │ ├── Delay.swift │ │ ├── DelaySubscription.swift │ │ ├── Dematerialize.swift │ │ ├── DistinctUntilChanged.swift │ │ ├── Do.swift │ │ ├── ElementAt.swift │ │ ├── Empty.swift │ │ ├── Enumerated.swift │ │ ├── Error.swift │ │ ├── Filter.swift │ │ ├── First.swift │ │ ├── Generate.swift │ │ ├── GroupBy.swift │ │ ├── Just.swift │ │ ├── Map.swift │ │ ├── Materialize.swift │ │ ├── Merge.swift │ │ ├── Multicast.swift │ │ ├── Never.swift │ │ ├── ObserveOn.swift │ │ ├── Optional.swift │ │ ├── Producer.swift │ │ ├── Range.swift │ │ ├── Reduce.swift │ │ ├── Repeat.swift │ │ ├── RetryWhen.swift │ │ ├── Sample.swift │ │ ├── Scan.swift │ │ ├── Sequence.swift │ │ ├── ShareReplayScope.swift │ │ ├── SingleAsync.swift │ │ ├── Sink.swift │ │ ├── Skip.swift │ │ ├── SkipUntil.swift │ │ ├── SkipWhile.swift │ │ ├── StartWith.swift │ │ ├── SubscribeOn.swift │ │ ├── Switch.swift │ │ ├── SwitchIfEmpty.swift │ │ ├── Take.swift │ │ ├── TakeLast.swift │ │ ├── TakeUntil.swift │ │ ├── TakeWhile.swift │ │ ├── Throttle.swift │ │ ├── Timeout.swift │ │ ├── Timer.swift │ │ ├── ToArray.swift │ │ ├── Using.swift │ │ ├── Window.swift │ │ ├── WithLatestFrom.swift │ │ ├── Zip+Collection.swift │ │ ├── Zip+arity.swift │ │ └── Zip.swift │ │ ├── ObserverType.swift │ │ ├── Observers │ │ ├── AnonymousObserver.swift │ │ ├── ObserverBase.swift │ │ └── TailRecursiveSink.swift │ │ ├── Reactive.swift │ │ ├── Rx.swift │ │ ├── RxMutableBox.swift │ │ ├── SchedulerType.swift │ │ ├── Schedulers │ │ ├── ConcurrentDispatchQueueScheduler.swift │ │ ├── ConcurrentMainScheduler.swift │ │ ├── CurrentThreadScheduler.swift │ │ ├── HistoricalScheduler.swift │ │ ├── HistoricalSchedulerTimeConverter.swift │ │ ├── Internal │ │ │ ├── DispatchQueueConfiguration.swift │ │ │ ├── InvocableScheduledItem.swift │ │ │ ├── InvocableType.swift │ │ │ ├── ScheduledItem.swift │ │ │ └── ScheduledItemType.swift │ │ ├── MainScheduler.swift │ │ ├── OperationQueueScheduler.swift │ │ ├── RecursiveScheduler.swift │ │ ├── SchedulerServices+Emulation.swift │ │ ├── SerialDispatchQueueScheduler.swift │ │ ├── VirtualTimeConverterType.swift │ │ └── VirtualTimeScheduler.swift │ │ ├── Subjects │ │ ├── AsyncSubject.swift │ │ ├── BehaviorSubject.swift │ │ ├── PublishSubject.swift │ │ ├── ReplaySubject.swift │ │ └── SubjectType.swift │ │ ├── SwiftSupport │ │ └── SwiftSupport.swift │ │ └── Traits │ │ ├── Completable+AndThen.swift │ │ ├── Completable.swift │ │ ├── Maybe.swift │ │ ├── ObservableType+PrimitiveSequence.swift │ │ ├── PrimitiveSequence+Zip+arity.swift │ │ ├── PrimitiveSequence.swift │ │ └── Single.swift └── Target Support Files │ ├── Pods-BigModule │ ├── Info.plist │ ├── Pods-BigModule-acknowledgements.markdown │ ├── Pods-BigModule-acknowledgements.plist │ ├── Pods-BigModule-dummy.m │ ├── Pods-BigModule-resources.sh │ ├── Pods-BigModule-umbrella.h │ ├── Pods-BigModule.debug.xcconfig │ ├── Pods-BigModule.modulemap │ └── Pods-BigModule.release.xcconfig │ ├── Pods-BigModuleTests │ ├── Info.plist │ ├── Pods-BigModuleTests-acknowledgements.markdown │ ├── Pods-BigModuleTests-acknowledgements.plist │ ├── Pods-BigModuleTests-dummy.m │ ├── Pods-BigModuleTests-frameworks.sh │ ├── Pods-BigModuleTests-resources.sh │ ├── Pods-BigModuleTests-umbrella.h │ ├── Pods-BigModuleTests.debug.xcconfig │ ├── Pods-BigModuleTests.modulemap │ └── Pods-BigModuleTests.release.xcconfig │ ├── Pods-LittleModule │ ├── Info.plist │ ├── Pods-LittleModule-acknowledgements.markdown │ ├── Pods-LittleModule-acknowledgements.plist │ ├── Pods-LittleModule-dummy.m │ ├── Pods-LittleModule-resources.sh │ ├── Pods-LittleModule-umbrella.h │ ├── Pods-LittleModule.debug.xcconfig │ ├── Pods-LittleModule.modulemap │ └── Pods-LittleModule.release.xcconfig │ ├── Pods-LittleModuleTests │ ├── Info.plist │ ├── Pods-LittleModuleTests-acknowledgements.markdown │ ├── Pods-LittleModuleTests-acknowledgements.plist │ ├── Pods-LittleModuleTests-dummy.m │ ├── Pods-LittleModuleTests-frameworks.sh │ ├── Pods-LittleModuleTests-resources.sh │ ├── Pods-LittleModuleTests-umbrella.h │ ├── Pods-LittleModuleTests.debug.xcconfig │ ├── Pods-LittleModuleTests.modulemap │ └── Pods-LittleModuleTests.release.xcconfig │ ├── Pods-Modularization │ ├── Info.plist │ ├── Pods-Modularization-acknowledgements.markdown │ ├── Pods-Modularization-acknowledgements.plist │ ├── Pods-Modularization-dummy.m │ ├── Pods-Modularization-frameworks.sh │ ├── Pods-Modularization-resources.sh │ ├── Pods-Modularization-umbrella.h │ ├── Pods-Modularization.debug.xcconfig │ ├── Pods-Modularization.modulemap │ └── Pods-Modularization.release.xcconfig │ ├── Pods-ModularizationTests │ ├── Info.plist │ ├── Pods-ModularizationTests-acknowledgements.markdown │ ├── Pods-ModularizationTests-acknowledgements.plist │ ├── Pods-ModularizationTests-dummy.m │ ├── Pods-ModularizationTests-frameworks.sh │ ├── Pods-ModularizationTests-resources.sh │ ├── Pods-ModularizationTests-umbrella.h │ ├── Pods-ModularizationTests.debug.xcconfig │ ├── Pods-ModularizationTests.modulemap │ └── Pods-ModularizationTests.release.xcconfig │ └── RxSwift │ ├── Info.plist │ ├── RxSwift-dummy.m │ ├── RxSwift-prefix.pch │ ├── RxSwift-umbrella.h │ ├── RxSwift.modulemap │ └── RxSwift.xcconfig └── README.md /BigModule/BigModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BigModule.h 3 | // BigModule 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for BigModule. 12 | FOUNDATION_EXPORT double BigModuleVersionNumber; 13 | 14 | //! Project version string for BigModule. 15 | FOUNDATION_EXPORT const unsigned char BigModuleVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /BigModule/BigModule.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /BigModule/BigModule.xcassets/woman.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "depositphotos_130002458-stock-illustration-woman-pictogram-icon-image-1.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "depositphotos_130002458-stock-illustration-woman-pictogram-icon-image.jpg", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BigModule/BigModule.xcassets/woman.imageset/depositphotos_130002458-stock-illustration-woman-pictogram-icon-image-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rayane-K/modularized-ios-app/e65a94135c8aab4c1ff5ab20c47c4decea8b002c/BigModule/BigModule.xcassets/woman.imageset/depositphotos_130002458-stock-illustration-woman-pictogram-icon-image-1.jpg -------------------------------------------------------------------------------- /BigModule/BigModule.xcassets/woman.imageset/depositphotos_130002458-stock-illustration-woman-pictogram-icon-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rayane-K/modularized-ios-app/e65a94135c8aab4c1ff5ab20c47c4decea8b002c/BigModule/BigModule.xcassets/woman.imageset/depositphotos_130002458-stock-illustration-woman-pictogram-icon-image.jpg -------------------------------------------------------------------------------- /BigModule/BigModuleClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BigModuleClass.swift 3 | // BigModule 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // You can use pods like in a non-modularized project, check the podfile 12 | import RxSwift 13 | 14 | // This module is accessible since it is declared in build phases and scheme of BigModule target 15 | import LittleModule 16 | 17 | 18 | 19 | 20 | // You must declare this class as public if you want to access it from the outside of the module 21 | public class BigModuleClass { 22 | 23 | public static var bigModuleText = "Hello ! I am from the big module" 24 | public static var littleModuleText = LittleModuleClass.littleModuleText 25 | 26 | 27 | /* 28 | Using RxSwift stuff... if you want to use it in one of your framework, add it in your podfile in your target part. 29 | Please check Podfile for details 30 | */ 31 | var rxObservable = Observable.just(true) 32 | } 33 | -------------------------------------------------------------------------------- /BigModule/Bundle+BigModule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Bundle+BigModule.swift 3 | // BigModule 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // This class allows us to use the bundle init for class 12 | class FakeClass {} 13 | 14 | extension Bundle { 15 | 16 | // Returns BigModule target bundle 17 | public static var bigModule: Bundle { 18 | return Bundle(for: FakeClass.self) 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /BigModule/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /BigModuleTests/BigModuleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BigModuleTests.swift 3 | // BigModuleTests 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import BigModule 11 | 12 | class BigModuleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /BigModuleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LittleModule/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /LittleModule/LittleModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // LittleModule.h 3 | // LittleModule 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for LittleModule. 12 | FOUNDATION_EXPORT double LittleModuleVersionNumber; 13 | 14 | //! Project version string for LittleModule. 15 | FOUNDATION_EXPORT const unsigned char LittleModuleVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /LittleModule/LittleModuleClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LittleModuleClass.swift 3 | // BigModule 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | // You must declare this class as public if you want to access it from the outside of the module 13 | public class LittleModuleClass { 14 | 15 | public static var littleModuleText = "Hello ! I am from the little module" 16 | 17 | } 18 | -------------------------------------------------------------------------------- /LittleModuleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LittleModuleTests/LittleModuleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LittleModuleTests.swift 3 | // LittleModuleTests 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import LittleModule 11 | 12 | class LittleModuleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Modularization.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Modularization.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Modularization.xcodeproj/project.xcworkspace/xcuserdata/rayane_kurrimboccus.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rayane-K/modularized-ios-app/e65a94135c8aab4c1ff5ab20c47c4decea8b002c/Modularization.xcodeproj/project.xcworkspace/xcuserdata/rayane_kurrimboccus.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Modularization.xcodeproj/xcuserdata/rayane_kurrimboccus.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BigModule.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | LittleModule.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | Modularization.xcscheme_^#shared#^_ 18 | 19 | orderHint 20 | 1 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | D1593E44225CB15500A73B34 26 | 27 | primary 28 | 29 | 30 | D1593E58225CB15700A73B34 31 | 32 | primary 33 | 34 | 35 | D1593E6C225CB27400A73B34 36 | 37 | primary 38 | 39 | 40 | D1593E74225CB27400A73B34 41 | 42 | primary 43 | 44 | 45 | D1593E8F225CB28600A73B34 46 | 47 | primary 48 | 49 | 50 | D1593E97225CB28600A73B34 51 | 52 | primary 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Modularization.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Modularization.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Modularization.xcworkspace/xcuserdata/rayane_kurrimboccus.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rayane-K/modularized-ios-app/e65a94135c8aab4c1ff5ab20c47c4decea8b002c/Modularization.xcworkspace/xcuserdata/rayane_kurrimboccus.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Modularization/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Modularization 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Modularization/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Modularization/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Modularization/Assets.xcassets/man.imageset/1-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rayane-K/modularized-ios-app/e65a94135c8aab4c1ff5ab20c47c4decea8b002c/Modularization/Assets.xcassets/man.imageset/1-1.jpg -------------------------------------------------------------------------------- /Modularization/Assets.xcassets/man.imageset/1-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rayane-K/modularized-ios-app/e65a94135c8aab4c1ff5ab20c47c4decea8b002c/Modularization/Assets.xcassets/man.imageset/1-2.jpg -------------------------------------------------------------------------------- /Modularization/Assets.xcassets/man.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "1-1.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "1-2.jpg", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Modularization/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Modularization/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Modularization/MainAppClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainAppClass.swift 3 | // Modularization 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // You can use pods like in a non-modularized project, check the podfile 12 | import RxSwift 13 | 14 | 15 | class MainAppClass { 16 | 17 | static var mainAppText = "Hello ! I am from the main app" 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Modularization/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Modularization 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // to use classes from a module you have to import it, after declaring it in the scheme and build phases of this target 12 | import BigModule 13 | 14 | class ViewController: UIViewController { 15 | @IBOutlet var leftImageView: UIImageView! 16 | @IBOutlet var rightImageView: UIImageView! 17 | 18 | @IBOutlet var firstLabel: UILabel! 19 | @IBOutlet var secondLabel: UILabel! 20 | @IBOutlet var thirdLabel: UILabel! 21 | 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | // By using image literals, you are using the MAIN BUNDLE. This image is contained in the main bundle so this will work 27 | leftImageView.image = #imageLiteral(resourceName: "man") 28 | 29 | // This image is contained in the BigModule target bundle. So you have to specify the bundle when instantiating it or it will crash 30 | rightImageView.image = UIImage(named: "woman", in: Bundle.bigModule, compatibleWith: nil) 31 | 32 | firstLabel.text = MainAppClass.mainAppText 33 | secondLabel.text = BigModuleClass.bigModuleText 34 | thirdLabel.text = BigModuleClass.littleModuleText 35 | } 36 | 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /ModularizationTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ModularizationTests/ModularizationTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ModularizationTests.swift 3 | // ModularizationTests 4 | // 5 | // Created by Kurrimboccus Rayane on 09/04/2019. 6 | // Copyright © 2019 Kurrimboccus Rayane. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Modularization 11 | 12 | class ModularizationTests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | 2 | target 'Modularization' do 3 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 4 | use_frameworks! 5 | 6 | # Pods for Modularization 7 | pod 'RxSwift' 8 | 9 | target 'ModularizationTests' do 10 | inherit! :search_paths 11 | # Pods for testing 12 | end 13 | 14 | end 15 | 16 | 17 | 18 | target 'BigModule' do 19 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 20 | use_frameworks! 21 | 22 | # Pods for BigModule 23 | pod 'RxSwift' 24 | 25 | target 'BigModuleTests' do 26 | inherit! :search_paths 27 | # Pods for testing 28 | end 29 | 30 | end 31 | 32 | target 'LittleModule' do 33 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 34 | use_frameworks! 35 | 36 | # Pods for LittleModule 37 | 38 | target 'LittleModuleTests' do 39 | inherit! :search_paths 40 | # Pods for testing 41 | end 42 | 43 | end 44 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - RxSwift (4.5.0) 3 | 4 | DEPENDENCIES: 5 | - RxSwift 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - RxSwift 10 | 11 | SPEC CHECKSUMS: 12 | RxSwift: f172070dfd1a93d70a9ab97a5a01166206e1c575 13 | 14 | PODFILE CHECKSUM: 3b0c0badeb50b54dd9acef43966ec5cd42039d76 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - RxSwift (4.5.0) 3 | 4 | DEPENDENCIES: 5 | - RxSwift 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - RxSwift 10 | 11 | SPEC CHECKSUMS: 12 | RxSwift: f172070dfd1a93d70a9ab97a5a01166206e1c575 13 | 14 | PODFILE CHECKSUM: 3b0c0badeb50b54dd9acef43966ec5cd42039d76 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/rayane_kurrimboccus.xcuserdatad/xcschemes/Pods-BigModule.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/rayane_kurrimboccus.xcuserdatad/xcschemes/Pods-BigModuleTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/rayane_kurrimboccus.xcuserdatad/xcschemes/Pods-LittleModule.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/rayane_kurrimboccus.xcuserdatad/xcschemes/Pods-LittleModuleTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/rayane_kurrimboccus.xcuserdatad/xcschemes/Pods-Modularization.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/rayane_kurrimboccus.xcuserdatad/xcschemes/Pods-ModularizationTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/rayane_kurrimboccus.xcuserdatad/xcschemes/RxSwift.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/rayane_kurrimboccus.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-BigModule.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-BigModuleTests.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods-LittleModule.xcscheme 18 | 19 | isShown 20 | 21 | 22 | Pods-LittleModuleTests.xcscheme 23 | 24 | isShown 25 | 26 | 27 | Pods-Modularization.xcscheme 28 | 29 | isShown 30 | 31 | 32 | Pods-ModularizationTests.xcscheme 33 | 34 | isShown 35 | 36 | 37 | RxSwift.xcscheme 38 | 39 | isShown 40 | 41 | 42 | 43 | SuppressBuildableAutocreation 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Pods/RxSwift/LICENSE.md: -------------------------------------------------------------------------------- 1 | **The MIT License** 2 | **Copyright © 2015 Krunoslav Zaher** 3 | **All rights reserved.** 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /Pods/RxSwift/Platform/AtomicInt.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AtomicInt.swift 3 | // Platform 4 | // 5 | // Created by Krunoslav Zaher on 10/28/18. 6 | // Copyright © 2018 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import class Foundation.NSLock 10 | 11 | final class AtomicInt: NSLock { 12 | fileprivate var value: Int32 13 | public init(_ value: Int32 = 0) { 14 | self.value = value 15 | } 16 | } 17 | 18 | @discardableResult 19 | @inline(__always) 20 | func add(_ this: AtomicInt, _ value: Int32) -> Int32 { 21 | this.lock() 22 | let oldValue = this.value 23 | this.value += value 24 | this.unlock() 25 | return oldValue 26 | } 27 | 28 | @discardableResult 29 | @inline(__always) 30 | func sub(_ this: AtomicInt, _ value: Int32) -> Int32 { 31 | this.lock() 32 | let oldValue = this.value 33 | this.value -= value 34 | this.unlock() 35 | return oldValue 36 | } 37 | 38 | @discardableResult 39 | @inline(__always) 40 | func fetchOr(_ this: AtomicInt, _ mask: Int32) -> Int32 { 41 | this.lock() 42 | let oldValue = this.value 43 | this.value |= mask 44 | this.unlock() 45 | return oldValue 46 | } 47 | 48 | @inline(__always) 49 | func load(_ this: AtomicInt) -> Int32 { 50 | this.lock() 51 | let oldValue = this.value 52 | this.unlock() 53 | return oldValue 54 | } 55 | 56 | @discardableResult 57 | @inline(__always) 58 | func increment(_ this: AtomicInt) -> Int32 { 59 | return add(this, 1) 60 | } 61 | 62 | @discardableResult 63 | @inline(__always) 64 | func decrement(_ this: AtomicInt) -> Int32 { 65 | return sub(this, 1) 66 | } 67 | 68 | @inline(__always) 69 | func isFlagSet(_ this: AtomicInt, _ mask: Int32) -> Bool { 70 | return (load(this) & mask) != 0 71 | } 72 | -------------------------------------------------------------------------------- /Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InfiniteSequence.swift 3 | // Platform 4 | // 5 | // Created by Krunoslav Zaher on 6/13/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Sequence that repeats `repeatedValue` infinite number of times. 10 | struct InfiniteSequence : Sequence { 11 | typealias Element = E 12 | typealias Iterator = AnyIterator 13 | 14 | private let _repeatedValue: E 15 | 16 | init(repeatedValue: E) { 17 | _repeatedValue = repeatedValue 18 | } 19 | 20 | func makeIterator() -> Iterator { 21 | let repeatedValue = _repeatedValue 22 | return AnyIterator { 23 | return repeatedValue 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Pods/RxSwift/Platform/DeprecationWarner.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeprecationWarner.swift 3 | // Platform 4 | // 5 | // Created by Shai Mishali on 1/9/18. 6 | // Copyright © 2018 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | #if DEBUG 12 | class DeprecationWarner { 13 | private static var warned = Set() 14 | private static var _lock = NSRecursiveLock() 15 | 16 | static func warnIfNeeded(_ kind: Kind) { 17 | _lock.lock(); defer { _lock.unlock() } 18 | guard !warned.contains(kind) else { return } 19 | 20 | warned.insert(kind) 21 | print("ℹ️ [DEPRECATED] \(kind.message)") 22 | } 23 | } 24 | 25 | extension DeprecationWarner { 26 | enum Kind { 27 | case variable 28 | case globalTestFunctionNext 29 | case globalTestFunctionError 30 | case globalTestFunctionCompleted 31 | 32 | var message: String { 33 | switch self { 34 | case .variable: return "`Variable` is planned for future deprecation. Please consider `BehaviorRelay` as a replacement. Read more at: https://git.io/vNqvx" 35 | case .globalTestFunctionNext: return "The `next()` global function is planned for future deprecation. Please use `Recorded.next()` instead." 36 | case .globalTestFunctionError: return "The `error()` global function is planned for future deprecation. Please use `Recorded.error()` instead." 37 | case .globalTestFunctionCompleted: return "The `completed()` global function is planned for future deprecation. Please use `Recorded.completed()` instead." 38 | } 39 | } 40 | } 41 | } 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /Pods/RxSwift/Platform/DispatchQueue+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchQueue+Extensions.swift 3 | // Platform 4 | // 5 | // Created by Krunoslav Zaher on 10/22/16. 6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Dispatch 10 | 11 | extension DispatchQueue { 12 | private static var token: DispatchSpecificKey<()> = { 13 | let key = DispatchSpecificKey<()>() 14 | DispatchQueue.main.setSpecific(key: key, value: ()) 15 | return key 16 | }() 17 | 18 | static var isMain: Bool { 19 | return DispatchQueue.getSpecific(key: token) != nil 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pods/RxSwift/Platform/Platform.Darwin.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Platform.Darwin.swift 3 | // Platform 4 | // 5 | // Created by Krunoslav Zaher on 12/29/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 10 | 11 | import Darwin 12 | import class Foundation.Thread 13 | import protocol Foundation.NSCopying 14 | 15 | extension Thread { 16 | static func setThreadLocalStorageValue(_ value: T?, forKey key: NSCopying) { 17 | let currentThread = Thread.current 18 | let threadDictionary = currentThread.threadDictionary 19 | 20 | if let newValue = value { 21 | threadDictionary[key] = newValue 22 | } 23 | else { 24 | threadDictionary[key] = nil 25 | } 26 | } 27 | 28 | static func getThreadLocalStorageValueForKey(_ key: NSCopying) -> T? { 29 | let currentThread = Thread.current 30 | let threadDictionary = currentThread.threadDictionary 31 | 32 | return threadDictionary[key] as? T 33 | } 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Pods/RxSwift/Platform/Platform.Linux.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Platform.Linux.swift 3 | // Platform 4 | // 5 | // Created by Krunoslav Zaher on 12/29/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(Linux) 10 | 11 | import class Foundation.Thread 12 | 13 | extension Thread { 14 | 15 | static func setThreadLocalStorageValue(_ value: T?, forKey key: String) { 16 | let currentThread = Thread.current 17 | var threadDictionary = currentThread.threadDictionary 18 | 19 | if let newValue = value { 20 | threadDictionary[key] = newValue 21 | } 22 | else { 23 | threadDictionary[key] = nil 24 | } 25 | 26 | currentThread.threadDictionary = threadDictionary 27 | } 28 | 29 | static func getThreadLocalStorageValueForKey(_ key: String) -> T? { 30 | let currentThread = Thread.current 31 | let threadDictionary = currentThread.threadDictionary 32 | 33 | return threadDictionary[key] as? T 34 | } 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Pods/RxSwift/Platform/RecursiveLock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RecursiveLock.swift 3 | // Platform 4 | // 5 | // Created by Krunoslav Zaher on 12/18/16. 6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import class Foundation.NSRecursiveLock 10 | 11 | #if TRACE_RESOURCES 12 | class RecursiveLock: NSRecursiveLock { 13 | override init() { 14 | _ = Resources.incrementTotal() 15 | super.init() 16 | } 17 | 18 | override func lock() { 19 | super.lock() 20 | _ = Resources.incrementTotal() 21 | } 22 | 23 | override func unlock() { 24 | super.unlock() 25 | _ = Resources.decrementTotal() 26 | } 27 | 28 | deinit { 29 | _ = Resources.decrementTotal() 30 | } 31 | } 32 | #else 33 | typealias RecursiveLock = NSRecursiveLock 34 | #endif 35 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/AnyObserver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnyObserver.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/28/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// A type-erased `ObserverType`. 10 | /// 11 | /// Forwards operations to an arbitrary underlying observer with the same `Element` type, hiding the specifics of the underlying observer type. 12 | public struct AnyObserver : ObserverType { 13 | /// The type of elements in sequence that observer can observe. 14 | public typealias E = Element 15 | 16 | /// Anonymous event handler type. 17 | public typealias EventHandler = (Event) -> Void 18 | 19 | private let observer: EventHandler 20 | 21 | /// Construct an instance whose `on(event)` calls `eventHandler(event)` 22 | /// 23 | /// - parameter eventHandler: Event handler that observes sequences events. 24 | public init(eventHandler: @escaping EventHandler) { 25 | self.observer = eventHandler 26 | } 27 | 28 | /// Construct an instance whose `on(event)` calls `observer.on(event)` 29 | /// 30 | /// - parameter observer: Observer that receives sequence events. 31 | public init(_ observer: O) where O.E == Element { 32 | self.observer = observer.on 33 | } 34 | 35 | /// Send `event` to this observer. 36 | /// 37 | /// - parameter event: Event instance. 38 | public func on(_ event: Event) { 39 | return self.observer(event) 40 | } 41 | 42 | /// Erases type of observer and returns canonical observer. 43 | /// 44 | /// - returns: type erased observer. 45 | public func asObserver() -> AnyObserver { 46 | return self 47 | } 48 | } 49 | 50 | extension AnyObserver { 51 | /// Collection of `AnyObserver`s 52 | typealias s = Bag<(Event) -> Void> 53 | } 54 | 55 | extension ObserverType { 56 | /// Erases type of observer and returns canonical observer. 57 | /// 58 | /// - returns: type erased observer. 59 | public func asObserver() -> AnyObserver { 60 | return AnyObserver(self) 61 | } 62 | 63 | /// Transforms observer of type R to type E using custom transform method. 64 | /// Each event sent to result observer is transformed and sent to `self`. 65 | /// 66 | /// - returns: observer that transforms events. 67 | public func mapObserver(_ transform: @escaping (R) throws -> E) -> AnyObserver { 68 | return AnyObserver { e in 69 | self.on(e.map(transform)) 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Cancelable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Cancelable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents disposable resource with state tracking. 10 | public protocol Cancelable : Disposable { 11 | /// Was resource disposed. 12 | var isDisposed: Bool { get } 13 | } 14 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AsyncLock.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/21/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /** 10 | In case nobody holds this lock, the work will be queued and executed immediately 11 | on thread that is requesting lock. 12 | 13 | In case there is somebody currently holding that lock, action will be enqueued. 14 | When owned of the lock finishes with it's processing, it will also execute 15 | and pending work. 16 | 17 | That means that enqueued work could possibly be executed later on a different thread. 18 | */ 19 | final class AsyncLock 20 | : Disposable 21 | , Lock 22 | , SynchronizedDisposeType { 23 | typealias Action = () -> Void 24 | 25 | var _lock = SpinLock() 26 | 27 | private var _queue: Queue = Queue(capacity: 0) 28 | 29 | private var _isExecuting: Bool = false 30 | private var _hasFaulted: Bool = false 31 | 32 | // lock { 33 | func lock() { 34 | self._lock.lock() 35 | } 36 | 37 | func unlock() { 38 | self._lock.unlock() 39 | } 40 | // } 41 | 42 | private func enqueue(_ action: I) -> I? { 43 | self._lock.lock(); defer { self._lock.unlock() } // { 44 | if self._hasFaulted { 45 | return nil 46 | } 47 | 48 | if self._isExecuting { 49 | self._queue.enqueue(action) 50 | return nil 51 | } 52 | 53 | self._isExecuting = true 54 | 55 | return action 56 | // } 57 | } 58 | 59 | private func dequeue() -> I? { 60 | self._lock.lock(); defer { self._lock.unlock() } // { 61 | if !self._queue.isEmpty { 62 | return self._queue.dequeue() 63 | } 64 | else { 65 | self._isExecuting = false 66 | return nil 67 | } 68 | // } 69 | } 70 | 71 | func invoke(_ action: I) { 72 | let firstEnqueuedAction = self.enqueue(action) 73 | 74 | if let firstEnqueuedAction = firstEnqueuedAction { 75 | firstEnqueuedAction.invoke() 76 | } 77 | else { 78 | // action is enqueued, it's somebody else's concern now 79 | return 80 | } 81 | 82 | while true { 83 | let nextAction = self.dequeue() 84 | 85 | if let nextAction = nextAction { 86 | nextAction.invoke() 87 | } 88 | else { 89 | return 90 | } 91 | } 92 | } 93 | 94 | func dispose() { 95 | self.synchronizedDispose() 96 | } 97 | 98 | func _synchronized_dispose() { 99 | self._queue = Queue(capacity: 0) 100 | self._hasFaulted = true 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/Lock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Lock.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/31/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | protocol Lock { 10 | func lock() 11 | func unlock() 12 | } 13 | 14 | // https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html 15 | typealias SpinLock = RecursiveLock 16 | 17 | extension RecursiveLock : Lock { 18 | @inline(__always) 19 | final func performLocked(_ action: () -> Void) { 20 | self.lock(); defer { self.unlock() } 21 | action() 22 | } 23 | 24 | @inline(__always) 25 | final func calculateLocked(_ action: () -> T) -> T { 26 | self.lock(); defer { self.unlock() } 27 | return action() 28 | } 29 | 30 | @inline(__always) 31 | final func calculateLockedOrFail(_ action: () throws -> T) throws -> T { 32 | self.lock(); defer { self.unlock() } 33 | let result = try action() 34 | return result 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LockOwnerType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | protocol LockOwnerType : class, Lock { 10 | var _lock: RecursiveLock { get } 11 | } 12 | 13 | extension LockOwnerType { 14 | func lock() { 15 | self._lock.lock() 16 | } 17 | 18 | func unlock() { 19 | self._lock.unlock() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedDisposeType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | protocol SynchronizedDisposeType : class, Disposable, Lock { 10 | func _synchronized_dispose() 11 | } 12 | 13 | extension SynchronizedDisposeType { 14 | func synchronizedDispose() { 15 | self.lock(); defer { self.unlock() } 16 | self._synchronized_dispose() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedOnType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | protocol SynchronizedOnType : class, ObserverType, Lock { 10 | func _synchronized_on(_ event: Event) 11 | } 12 | 13 | extension SynchronizedOnType { 14 | func synchronizedOn(_ event: Event) { 15 | self.lock(); defer { self.unlock() } 16 | self._synchronized_on(event) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedUnsubscribeType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | protocol SynchronizedUnsubscribeType : class { 10 | associatedtype DisposeKey 11 | 12 | func synchronizedUnsubscribe(_ disposeKey: DisposeKey) 13 | } 14 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ConnectableObservableType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectableObservableType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/1/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /** 10 | Represents an observable sequence wrapper that can be connected and disconnected from its underlying observable sequence. 11 | */ 12 | public protocol ConnectableObservableType : ObservableType { 13 | /** 14 | Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. 15 | 16 | - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence. 17 | */ 18 | func connect() -> Disposable 19 | } 20 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Disposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents a disposable resource. 10 | public protocol Disposable { 11 | /// Dispose resource. 12 | func dispose() 13 | } 14 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnonymousDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/15/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents an Action-based disposable. 10 | /// 11 | /// When dispose method is called, disposal action will be dereferenced. 12 | fileprivate final class AnonymousDisposable : DisposeBase, Cancelable { 13 | public typealias DisposeAction = () -> Void 14 | 15 | private let _isDisposed = AtomicInt(0) 16 | private var _disposeAction: DisposeAction? 17 | 18 | /// - returns: Was resource disposed. 19 | public var isDisposed: Bool { 20 | return isFlagSet(self._isDisposed, 1) 21 | } 22 | 23 | /// Constructs a new disposable with the given action used for disposal. 24 | /// 25 | /// - parameter disposeAction: Disposal action which will be run upon calling `dispose`. 26 | fileprivate init(_ disposeAction: @escaping DisposeAction) { 27 | self._disposeAction = disposeAction 28 | super.init() 29 | } 30 | 31 | // Non-deprecated version of the constructor, used by `Disposables.create(with:)` 32 | fileprivate init(disposeAction: @escaping DisposeAction) { 33 | self._disposeAction = disposeAction 34 | super.init() 35 | } 36 | 37 | /// Calls the disposal action if and only if the current instance hasn't been disposed yet. 38 | /// 39 | /// After invoking disposal action, disposal action will be dereferenced. 40 | fileprivate func dispose() { 41 | if fetchOr(self._isDisposed, 1) == 0 { 42 | if let action = self._disposeAction { 43 | self._disposeAction = nil 44 | action() 45 | } 46 | } 47 | } 48 | } 49 | 50 | extension Disposables { 51 | 52 | /// Constructs a new disposable with the given action used for disposal. 53 | /// 54 | /// - parameter dispose: Disposal action which will be run upon calling `dispose`. 55 | public static func create(with dispose: @escaping () -> Void) -> Cancelable { 56 | return AnonymousDisposable(disposeAction: dispose) 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BinaryDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents two disposable resources that are disposed together. 10 | private final class BinaryDisposable : DisposeBase, Cancelable { 11 | 12 | private let _isDisposed = AtomicInt(0) 13 | 14 | // state 15 | private var _disposable1: Disposable? 16 | private var _disposable2: Disposable? 17 | 18 | /// - returns: Was resource disposed. 19 | var isDisposed: Bool { 20 | return isFlagSet(self._isDisposed, 1) 21 | } 22 | 23 | /// Constructs new binary disposable from two disposables. 24 | /// 25 | /// - parameter disposable1: First disposable 26 | /// - parameter disposable2: Second disposable 27 | init(_ disposable1: Disposable, _ disposable2: Disposable) { 28 | self._disposable1 = disposable1 29 | self._disposable2 = disposable2 30 | super.init() 31 | } 32 | 33 | /// Calls the disposal action if and only if the current instance hasn't been disposed yet. 34 | /// 35 | /// After invoking disposal action, disposal action will be dereferenced. 36 | func dispose() { 37 | if fetchOr(self._isDisposed, 1) == 0 { 38 | self._disposable1?.dispose() 39 | self._disposable2?.dispose() 40 | self._disposable1 = nil 41 | self._disposable2 = nil 42 | } 43 | } 44 | } 45 | 46 | extension Disposables { 47 | 48 | /// Creates a disposable with the given disposables. 49 | public static func create(_ disposable1: Disposable, _ disposable2: Disposable) -> Cancelable { 50 | return BinaryDisposable(disposable1, disposable2) 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BooleanDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Junior B. on 10/29/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents a disposable resource that can be checked for disposal status. 10 | public final class BooleanDisposable : Cancelable { 11 | 12 | internal static let BooleanDisposableTrue = BooleanDisposable(isDisposed: true) 13 | private var _isDisposed = false 14 | 15 | /// Initializes a new instance of the `BooleanDisposable` class 16 | public init() { 17 | } 18 | 19 | /// Initializes a new instance of the `BooleanDisposable` class with given value 20 | public init(isDisposed: Bool) { 21 | self._isDisposed = isDisposed 22 | } 23 | 24 | /// - returns: Was resource disposed. 25 | public var isDisposed: Bool { 26 | return self._isDisposed 27 | } 28 | 29 | /// Sets the status to disposed, which can be observer through the `isDisposed` property. 30 | public func dispose() { 31 | self._isDisposed = true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/Disposables.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Disposables.swift 3 | // RxSwift 4 | // 5 | // Created by Mohsen Ramezanpoor on 01/08/2016. 6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// A collection of utility methods for common disposable operations. 10 | public struct Disposables { 11 | private init() {} 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DisposeBase.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 4/4/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Base class for all disposables. 10 | public class DisposeBase { 11 | init() { 12 | #if TRACE_RESOURCES 13 | _ = Resources.incrementTotal() 14 | #endif 15 | } 16 | 17 | deinit { 18 | #if TRACE_RESOURCES 19 | _ = Resources.decrementTotal() 20 | #endif 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NopDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/15/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents a disposable that does nothing on disposal. 10 | /// 11 | /// Nop = No Operation 12 | fileprivate struct NopDisposable : Disposable { 13 | 14 | fileprivate static let noOp: Disposable = NopDisposable() 15 | 16 | fileprivate init() { 17 | 18 | } 19 | 20 | /// Does nothing. 21 | public func dispose() { 22 | } 23 | } 24 | 25 | extension Disposables { 26 | /** 27 | Creates a disposable that does nothing on disposal. 28 | */ 29 | static public func create() -> Disposable { 30 | return NopDisposable.noOp 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScheduledDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/13/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | private let disposeScheduledDisposable: (ScheduledDisposable) -> Disposable = { sd in 10 | sd.disposeInner() 11 | return Disposables.create() 12 | } 13 | 14 | /// Represents a disposable resource whose disposal invocation will be scheduled on the specified scheduler. 15 | public final class ScheduledDisposable : Cancelable { 16 | public let scheduler: ImmediateSchedulerType 17 | 18 | private let _isDisposed = AtomicInt(0) 19 | 20 | // state 21 | private var _disposable: Disposable? 22 | 23 | /// - returns: Was resource disposed. 24 | public var isDisposed: Bool { 25 | return isFlagSet(self._isDisposed, 1) 26 | } 27 | 28 | /** 29 | Initializes a new instance of the `ScheduledDisposable` that uses a `scheduler` on which to dispose the `disposable`. 30 | 31 | - parameter scheduler: Scheduler where the disposable resource will be disposed on. 32 | - parameter disposable: Disposable resource to dispose on the given scheduler. 33 | */ 34 | public init(scheduler: ImmediateSchedulerType, disposable: Disposable) { 35 | self.scheduler = scheduler 36 | self._disposable = disposable 37 | } 38 | 39 | /// Disposes the wrapped disposable on the provided scheduler. 40 | public func dispose() { 41 | _ = self.scheduler.schedule(self, action: disposeScheduledDisposable) 42 | } 43 | 44 | func disposeInner() { 45 | if fetchOr(self._isDisposed, 1) == 0 { 46 | self._disposable!.dispose() 47 | self._disposable = nil 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SerialDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. 10 | public final class SerialDisposable : DisposeBase, Cancelable { 11 | private var _lock = SpinLock() 12 | 13 | // state 14 | private var _current = nil as Disposable? 15 | private var _isDisposed = false 16 | 17 | /// - returns: Was resource disposed. 18 | public var isDisposed: Bool { 19 | return self._isDisposed 20 | } 21 | 22 | /// Initializes a new instance of the `SerialDisposable`. 23 | override public init() { 24 | super.init() 25 | } 26 | 27 | /** 28 | Gets or sets the underlying disposable. 29 | 30 | Assigning this property disposes the previous disposable object. 31 | 32 | If the `SerialDisposable` has already been disposed, assignment to this property causes immediate disposal of the given disposable object. 33 | */ 34 | public var disposable: Disposable { 35 | get { 36 | return self._lock.calculateLocked { 37 | return self._current ?? Disposables.create() 38 | } 39 | } 40 | set (newDisposable) { 41 | let disposable: Disposable? = self._lock.calculateLocked { 42 | if self._isDisposed { 43 | return newDisposable 44 | } 45 | else { 46 | let toDispose = self._current 47 | self._current = newDisposable 48 | return toDispose 49 | } 50 | } 51 | 52 | if let disposable = disposable { 53 | disposable.dispose() 54 | } 55 | } 56 | } 57 | 58 | /// Disposes the underlying disposable as well as all future replacements. 59 | public func dispose() { 60 | self._dispose()?.dispose() 61 | } 62 | 63 | private func _dispose() -> Disposable? { 64 | self._lock.lock(); defer { self._lock.unlock() } 65 | if self._isDisposed { 66 | return nil 67 | } 68 | else { 69 | self._isDisposed = true 70 | let current = self._current 71 | self._current = nil 72 | return current 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SingleAssignmentDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/15/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /** 10 | Represents a disposable resource which only allows a single assignment of its underlying disposable resource. 11 | 12 | If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an exception. 13 | */ 14 | public final class SingleAssignmentDisposable : DisposeBase, Cancelable { 15 | 16 | fileprivate enum DisposeState: Int32 { 17 | case disposed = 1 18 | case disposableSet = 2 19 | } 20 | 21 | // state 22 | private let _state = AtomicInt(0) 23 | private var _disposable = nil as Disposable? 24 | 25 | /// - returns: A value that indicates whether the object is disposed. 26 | public var isDisposed: Bool { 27 | return isFlagSet(self._state, DisposeState.disposed.rawValue) 28 | } 29 | 30 | /// Initializes a new instance of the `SingleAssignmentDisposable`. 31 | public override init() { 32 | super.init() 33 | } 34 | 35 | /// Gets or sets the underlying disposable. After disposal, the result of getting this property is undefined. 36 | /// 37 | /// **Throws exception if the `SingleAssignmentDisposable` has already been assigned to.** 38 | public func setDisposable(_ disposable: Disposable) { 39 | self._disposable = disposable 40 | 41 | let previousState = fetchOr(self._state, DisposeState.disposableSet.rawValue) 42 | 43 | if (previousState & DisposeState.disposableSet.rawValue) != 0 { 44 | rxFatalError("oldState.disposable != nil") 45 | } 46 | 47 | if (previousState & DisposeState.disposed.rawValue) != 0 { 48 | disposable.dispose() 49 | self._disposable = nil 50 | } 51 | } 52 | 53 | /// Disposes the underlying disposable. 54 | public func dispose() { 55 | let previousState = fetchOr(self._state, DisposeState.disposed.rawValue) 56 | 57 | if (previousState & DisposeState.disposed.rawValue) != 0 { 58 | return 59 | } 60 | 61 | if (previousState & DisposeState.disposableSet.rawValue) != 0 { 62 | guard let disposable = self._disposable else { 63 | rxFatalError("Disposable not set") 64 | } 65 | disposable.dispose() 66 | self._disposable = nil 67 | } 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SubscriptionDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | struct SubscriptionDisposable : Disposable { 10 | private let _key: T.DisposeKey 11 | private weak var _owner: T? 12 | 13 | init(owner: T, key: T.DisposeKey) { 14 | self._owner = owner 15 | self._key = key 16 | } 17 | 18 | func dispose() { 19 | self._owner?.synchronizedUnsubscribe(self._key) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Errors.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Errors.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/28/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | let RxErrorDomain = "RxErrorDomain" 10 | let RxCompositeFailures = "RxCompositeFailures" 11 | 12 | /// Generic Rx error codes. 13 | public enum RxError 14 | : Swift.Error 15 | , CustomDebugStringConvertible { 16 | /// Unknown error occurred. 17 | case unknown 18 | /// Performing an action on disposed object. 19 | case disposed(object: AnyObject) 20 | /// Aritmetic overflow error. 21 | case overflow 22 | /// Argument out of range error. 23 | case argumentOutOfRange 24 | /// Sequence doesn't contain any elements. 25 | case noElements 26 | /// Sequence contains more than one element. 27 | case moreThanOneElement 28 | /// Timeout error. 29 | case timeout 30 | } 31 | 32 | extension RxError { 33 | /// A textual representation of `self`, suitable for debugging. 34 | public var debugDescription: String { 35 | switch self { 36 | case .unknown: 37 | return "Unknown error occurred." 38 | case .disposed(let object): 39 | return "Object `\(object)` was already disposed." 40 | case .overflow: 41 | return "Arithmetic overflow occurred." 42 | case .argumentOutOfRange: 43 | return "Argument out of range." 44 | case .noElements: 45 | return "Sequence doesn't contain any elements." 46 | case .moreThanOneElement: 47 | return "Sequence contains more than one element." 48 | case .timeout: 49 | return "Sequence timeout." 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Event.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Event.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents a sequence event. 10 | /// 11 | /// Sequence grammar: 12 | /// **next\* (error | completed)** 13 | public enum Event { 14 | /// Next element is produced. 15 | case next(Element) 16 | 17 | /// Sequence terminated with an error. 18 | case error(Swift.Error) 19 | 20 | /// Sequence completed successfully. 21 | case completed 22 | } 23 | 24 | extension Event : CustomDebugStringConvertible { 25 | /// Description of event. 26 | public var debugDescription: String { 27 | switch self { 28 | case .next(let value): 29 | return "next(\(value))" 30 | case .error(let error): 31 | return "error(\(error))" 32 | case .completed: 33 | return "completed" 34 | } 35 | } 36 | } 37 | 38 | extension Event { 39 | /// Is `completed` or `error` event. 40 | public var isStopEvent: Bool { 41 | switch self { 42 | case .next: return false 43 | case .error, .completed: return true 44 | } 45 | } 46 | 47 | /// If `next` event, returns element value. 48 | public var element: Element? { 49 | if case .next(let value) = self { 50 | return value 51 | } 52 | return nil 53 | } 54 | 55 | /// If `error` event, returns error. 56 | public var error: Swift.Error? { 57 | if case .error(let error) = self { 58 | return error 59 | } 60 | return nil 61 | } 62 | 63 | /// If `completed` event, returns `true`. 64 | public var isCompleted: Bool { 65 | if case .completed = self { 66 | return true 67 | } 68 | return false 69 | } 70 | } 71 | 72 | extension Event { 73 | /// Maps sequence elements using transform. If error happens during the transform, `.error` 74 | /// will be returned as value. 75 | public func map(_ transform: (Element) throws -> Result) -> Event { 76 | do { 77 | switch self { 78 | case let .next(element): 79 | return .next(try transform(element)) 80 | case let .error(error): 81 | return .error(error) 82 | case .completed: 83 | return .completed 84 | } 85 | } 86 | catch let e { 87 | return .error(e) 88 | } 89 | } 90 | } 91 | 92 | /// A type that can be converted to `Event`. 93 | public protocol EventConvertible { 94 | /// Type of element in event 95 | associatedtype ElementType 96 | 97 | /// Event representation of this instance 98 | var event: Event { get } 99 | } 100 | 101 | extension Event : EventConvertible { 102 | /// Event representation of this instance 103 | public var event: Event { 104 | return self 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Bag+Rx.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 10/19/16. 6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | 10 | // MARK: forEach 11 | 12 | @inline(__always) 13 | func dispatch(_ bag: Bag<(Event) -> Void>, _ event: Event) { 14 | bag._value0?(event) 15 | 16 | if bag._onlyFastPath { 17 | return 18 | } 19 | 20 | let pairs = bag._pairs 21 | for i in 0 ..< pairs.count { 22 | pairs[i].value(event) 23 | } 24 | 25 | if let dictionary = bag._dictionary { 26 | for element in dictionary.values { 27 | element(event) 28 | } 29 | } 30 | } 31 | 32 | /// Dispatches `dispose` to all disposables contained inside bag. 33 | func disposeAll(in bag: Bag) { 34 | bag._value0?.dispose() 35 | 36 | if bag._onlyFastPath { 37 | return 38 | } 39 | 40 | let pairs = bag._pairs 41 | for i in 0 ..< pairs.count { 42 | pairs[i].value.dispose() 43 | } 44 | 45 | if let dictionary = bag._dictionary { 46 | for element in dictionary.values { 47 | element.dispose() 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Extensions/String+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Rx.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 12/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension String { 10 | /// This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)` 11 | func lastIndexOf(_ character: Character) -> Index? { 12 | var index = self.endIndex 13 | while index > self.startIndex { 14 | index = self.index(before: index) 15 | if self[index] == character { 16 | return index 17 | } 18 | } 19 | 20 | return nil 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/GroupedObservable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GroupedObservable.swift 3 | // RxSwift 4 | // 5 | // Created by Tomi Koskinen on 01/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents an observable sequence of elements that have a common key. 10 | public struct GroupedObservable : ObservableType { 11 | public typealias E = Element 12 | 13 | /// Gets the common key. 14 | public let key: Key 15 | 16 | private let source: Observable 17 | 18 | /// Initializes grouped observable sequence with key and source observable sequence. 19 | /// 20 | /// - parameter key: Grouped observable sequence key 21 | /// - parameter source: Observable sequence that represents sequence of elements for the key 22 | /// - returns: Grouped observable sequence of elements for the specific key 23 | public init(key: Key, source: Observable) { 24 | self.key = key 25 | self.source = source 26 | } 27 | 28 | /// Subscribes `observer` to receive events for this sequence. 29 | public func subscribe(_ observer: O) -> Disposable where O.E == E { 30 | return self.source.subscribe(observer) 31 | } 32 | 33 | /// Converts `self` to `Observable` sequence. 34 | public func asObservable() -> Observable { 35 | return self.source 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImmediateSchedulerType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 5/31/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents an object that immediately schedules units of work. 10 | public protocol ImmediateSchedulerType { 11 | /** 12 | Schedules an action to be executed immediately. 13 | 14 | - parameter state: State passed to the action to be executed. 15 | - parameter action: Action to be executed. 16 | - returns: The disposable object used to cancel the scheduled action (best effort). 17 | */ 18 | func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable 19 | } 20 | 21 | extension ImmediateSchedulerType { 22 | /** 23 | Schedules an action to be executed recursively. 24 | 25 | - parameter state: State passed to the action to be executed. 26 | - parameter action: Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. 27 | - returns: The disposable object used to cancel the scheduled action (best effort). 28 | */ 29 | public func scheduleRecursive(_ state: State, action: @escaping (_ state: State, _ recurse: (State) -> Void) -> Void) -> Disposable { 30 | let recursiveScheduler = RecursiveImmediateScheduler(action: action, scheduler: self) 31 | 32 | recursiveScheduler.schedule(state) 33 | 34 | return Disposables.create(with: recursiveScheduler.dispose) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Observable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// A type-erased `ObservableType`. 10 | /// 11 | /// It represents a push style sequence. 12 | public class Observable : ObservableType { 13 | /// Type of elements in sequence. 14 | public typealias E = Element 15 | 16 | init() { 17 | #if TRACE_RESOURCES 18 | _ = Resources.incrementTotal() 19 | #endif 20 | } 21 | 22 | public func subscribe(_ observer: O) -> Disposable where O.E == E { 23 | rxAbstractMethod() 24 | } 25 | 26 | public func asObservable() -> Observable { 27 | return self 28 | } 29 | 30 | deinit { 31 | #if TRACE_RESOURCES 32 | _ = Resources.decrementTotal() 33 | #endif 34 | } 35 | 36 | // this is kind of ugly I know :( 37 | // Swift compiler reports "Not supported yet" when trying to override protocol extensions, so ¯\_(ツ)_/¯ 38 | 39 | /// Optimizations for map operator 40 | internal func composeMap(_ transform: @escaping (Element) throws -> R) -> Observable { 41 | return _map(source: self, transform: transform) 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ObservableConvertibleType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObservableConvertibleType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 9/17/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Type that can be converted to observable sequence (`Observable`). 10 | public protocol ObservableConvertibleType { 11 | /// Type of elements in sequence. 12 | associatedtype E 13 | 14 | /// Converts `self` to `Observable` sequence. 15 | /// 16 | /// - returns: Observable sequence that represents `self`. 17 | func asObservable() -> Observable 18 | } 19 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ObservableType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObservableType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 8/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents a push style sequence. 10 | public protocol ObservableType : ObservableConvertibleType { 11 | /** 12 | Subscribes `observer` to receive events for this sequence. 13 | 14 | ### Grammar 15 | 16 | **Next\* (Error | Completed)?** 17 | 18 | * sequences can produce zero or more elements so zero or more `Next` events can be sent to `observer` 19 | * once an `Error` or `Completed` event is sent, the sequence terminates and can't produce any other elements 20 | 21 | It is possible that events are sent from different threads, but no two events can be sent concurrently to 22 | `observer`. 23 | 24 | ### Resource Management 25 | 26 | When sequence sends `Complete` or `Error` event all internal resources that compute sequence elements 27 | will be freed. 28 | 29 | To cancel production of sequence elements and free resources immediately, call `dispose` on returned 30 | subscription. 31 | 32 | - returns: Subscription for `observer` that can be used to cancel production of sequence elements and free resources. 33 | */ 34 | func subscribe(_ observer: O) -> Disposable where O.E == E 35 | } 36 | 37 | extension ObservableType { 38 | 39 | /// Default implementation of converting `ObservableType` to `Observable`. 40 | public func asObservable() -> Observable { 41 | // temporary workaround 42 | //return Observable.create(subscribe: self.subscribe) 43 | return Observable.create { o in 44 | return self.subscribe(o) 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/AddRef.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AddRef.swift 3 | // RxSwift 4 | // 5 | // Created by Junior B. on 30/10/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | final class AddRefSink : Sink, ObserverType { 10 | typealias Element = O.E 11 | 12 | override init(observer: O, cancel: Cancelable) { 13 | super.init(observer: observer, cancel: cancel) 14 | } 15 | 16 | func on(_ event: Event) { 17 | switch event { 18 | case .next: 19 | self.forwardOn(event) 20 | case .completed, .error: 21 | self.forwardOn(event) 22 | self.dispose() 23 | } 24 | } 25 | } 26 | 27 | final class AddRef : Producer { 28 | 29 | private let _source: Observable 30 | private let _refCount: RefCountDisposable 31 | 32 | init(source: Observable, refCount: RefCountDisposable) { 33 | self._source = source 34 | self._refCount = refCount 35 | } 36 | 37 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 38 | let releaseDisposable = self._refCount.retain() 39 | let sink = AddRefSink(observer: observer, cancel: cancel) 40 | let subscription = Disposables.create(releaseDisposable, self._source.subscribe(sink)) 41 | 42 | return (sink: sink, subscription: subscription) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/AsMaybe.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AsMaybe.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/12/17. 6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | fileprivate final class AsMaybeSink : Sink, ObserverType { 10 | typealias ElementType = O.E 11 | typealias E = ElementType 12 | 13 | private var _element: Event? 14 | 15 | func on(_ event: Event) { 16 | switch event { 17 | case .next: 18 | if self._element != nil { 19 | self.forwardOn(.error(RxError.moreThanOneElement)) 20 | self.dispose() 21 | } 22 | 23 | self._element = event 24 | case .error: 25 | self.forwardOn(event) 26 | self.dispose() 27 | case .completed: 28 | if let element = self._element { 29 | self.forwardOn(element) 30 | } 31 | self.forwardOn(.completed) 32 | self.dispose() 33 | } 34 | } 35 | } 36 | 37 | final class AsMaybe: Producer { 38 | fileprivate let _source: Observable 39 | 40 | init(source: Observable) { 41 | self._source = source 42 | } 43 | 44 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 45 | let sink = AsMaybeSink(observer: observer, cancel: cancel) 46 | let subscription = self._source.subscribe(sink) 47 | return (sink: sink, subscription: subscription) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/AsSingle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AsSingle.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/12/17. 6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | fileprivate final class AsSingleSink : Sink, ObserverType { 10 | typealias ElementType = O.E 11 | typealias E = ElementType 12 | 13 | private var _element: Event? 14 | 15 | func on(_ event: Event) { 16 | switch event { 17 | case .next: 18 | if self._element != nil { 19 | self.forwardOn(.error(RxError.moreThanOneElement)) 20 | self.dispose() 21 | } 22 | 23 | self._element = event 24 | case .error: 25 | self.forwardOn(event) 26 | self.dispose() 27 | case .completed: 28 | if let element = self._element { 29 | self.forwardOn(element) 30 | self.forwardOn(.completed) 31 | } 32 | else { 33 | self.forwardOn(.error(RxError.noElements)) 34 | } 35 | self.dispose() 36 | } 37 | } 38 | } 39 | 40 | final class AsSingle: Producer { 41 | fileprivate let _source: Observable 42 | 43 | init(source: Observable) { 44 | self._source = source 45 | } 46 | 47 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 48 | let sink = AsSingleSink(observer: observer, cancel: cancel) 49 | let subscription = self._source.subscribe(sink) 50 | return (sink: sink, subscription: subscription) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Create.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Create.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | // MARK: create 11 | 12 | /** 13 | Creates an observable sequence from a specified subscribe method implementation. 14 | 15 | - seealso: [create operator on reactivex.io](http://reactivex.io/documentation/operators/create.html) 16 | 17 | - parameter subscribe: Implementation of the resulting observable sequence's `subscribe` method. 18 | - returns: The observable sequence with the specified implementation for the `subscribe` method. 19 | */ 20 | public static func create(_ subscribe: @escaping (AnyObserver) -> Disposable) -> Observable { 21 | return AnonymousObservable(subscribe) 22 | } 23 | } 24 | 25 | final private class AnonymousObservableSink: Sink, ObserverType { 26 | typealias E = O.E 27 | typealias Parent = AnonymousObservable 28 | 29 | // state 30 | private let _isStopped = AtomicInt(0) 31 | 32 | #if DEBUG 33 | fileprivate let _synchronizationTracker = SynchronizationTracker() 34 | #endif 35 | 36 | override init(observer: O, cancel: Cancelable) { 37 | super.init(observer: observer, cancel: cancel) 38 | } 39 | 40 | func on(_ event: Event) { 41 | #if DEBUG 42 | self._synchronizationTracker.register(synchronizationErrorMessage: .default) 43 | defer { self._synchronizationTracker.unregister() } 44 | #endif 45 | switch event { 46 | case .next: 47 | if load(self._isStopped) == 1 { 48 | return 49 | } 50 | self.forwardOn(event) 51 | case .error, .completed: 52 | if fetchOr(self._isStopped, 1) == 0 { 53 | self.forwardOn(event) 54 | self.dispose() 55 | } 56 | } 57 | } 58 | 59 | func run(_ parent: Parent) -> Disposable { 60 | return parent._subscribeHandler(AnyObserver(self)) 61 | } 62 | } 63 | 64 | final private class AnonymousObservable: Producer { 65 | typealias SubscribeHandler = (AnyObserver) -> Disposable 66 | 67 | let _subscribeHandler: SubscribeHandler 68 | 69 | init(_ subscribeHandler: @escaping SubscribeHandler) { 70 | self._subscribeHandler = subscribeHandler 71 | } 72 | 73 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 74 | let sink = AnonymousObservableSink(observer: observer, cancel: cancel) 75 | let subscription = sink.run(self) 76 | return (sink: sink, subscription: subscription) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultIfEmpty.swift 3 | // RxSwift 4 | // 5 | // Created by sergdort on 23/12/2016. 6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Emits elements from the source observable sequence, or a default element if the source observable sequence is empty. 13 | 14 | - seealso: [DefaultIfEmpty operator on reactivex.io](http://reactivex.io/documentation/operators/defaultifempty.html) 15 | 16 | - parameter default: Default element to be sent if the source does not emit any elements 17 | - returns: An observable sequence which emits default element end completes in case the original sequence is empty 18 | */ 19 | public func ifEmpty(default: E) -> Observable { 20 | return DefaultIfEmpty(source: self.asObservable(), default: `default`) 21 | } 22 | } 23 | 24 | final private class DefaultIfEmptySink: Sink, ObserverType { 25 | typealias E = O.E 26 | private let _default: E 27 | private var _isEmpty = true 28 | 29 | init(default: E, observer: O, cancel: Cancelable) { 30 | self._default = `default` 31 | super.init(observer: observer, cancel: cancel) 32 | } 33 | 34 | func on(_ event: Event) { 35 | switch event { 36 | case .next: 37 | self._isEmpty = false 38 | self.forwardOn(event) 39 | case .error: 40 | self.forwardOn(event) 41 | self.dispose() 42 | case .completed: 43 | if self._isEmpty { 44 | self.forwardOn(.next(self._default)) 45 | } 46 | self.forwardOn(.completed) 47 | self.dispose() 48 | } 49 | } 50 | } 51 | 52 | final private class DefaultIfEmpty: Producer { 53 | private let _source: Observable 54 | private let _default: SourceType 55 | 56 | init(source: Observable, `default`: SourceType) { 57 | self._source = source 58 | self._default = `default` 59 | } 60 | 61 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceType { 62 | let sink = DefaultIfEmptySink(default: self._default, observer: observer, cancel: cancel) 63 | let subscription = self._source.subscribe(sink) 64 | return (sink: sink, subscription: subscription) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Deferred.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Deferred.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 4/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | /** 11 | Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. 12 | 13 | - seealso: [defer operator on reactivex.io](http://reactivex.io/documentation/operators/defer.html) 14 | 15 | - parameter observableFactory: Observable factory function to invoke for each observer that subscribes to the resulting sequence. 16 | - returns: An observable sequence whose observers trigger an invocation of the given observable factory function. 17 | */ 18 | public static func deferred(_ observableFactory: @escaping () throws -> Observable) 19 | -> Observable { 20 | return Deferred(observableFactory: observableFactory) 21 | } 22 | } 23 | 24 | final private class DeferredSink: Sink, ObserverType where S.E == O.E { 25 | typealias E = O.E 26 | 27 | private let _observableFactory: () throws -> S 28 | 29 | init(observableFactory: @escaping () throws -> S, observer: O, cancel: Cancelable) { 30 | self._observableFactory = observableFactory 31 | super.init(observer: observer, cancel: cancel) 32 | } 33 | 34 | func run() -> Disposable { 35 | do { 36 | let result = try self._observableFactory() 37 | return result.subscribe(self) 38 | } 39 | catch let e { 40 | self.forwardOn(.error(e)) 41 | self.dispose() 42 | return Disposables.create() 43 | } 44 | } 45 | 46 | func on(_ event: Event) { 47 | self.forwardOn(event) 48 | 49 | switch event { 50 | case .next: 51 | break 52 | case .error: 53 | self.dispose() 54 | case .completed: 55 | self.dispose() 56 | } 57 | } 58 | } 59 | 60 | final private class Deferred: Producer { 61 | typealias Factory = () throws -> S 62 | 63 | private let _observableFactory : Factory 64 | 65 | init(observableFactory: @escaping Factory) { 66 | self._observableFactory = observableFactory 67 | } 68 | 69 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { 70 | let sink = DeferredSink(observableFactory: self._observableFactory, observer: observer, cancel: cancel) 71 | let subscription = sink.run() 72 | return (sink: sink, subscription: subscription) 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DelaySubscription.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers. 13 | 14 | - seealso: [delay operator on reactivex.io](http://reactivex.io/documentation/operators/delay.html) 15 | 16 | - parameter dueTime: Relative time shift of the subscription. 17 | - parameter scheduler: Scheduler to run the subscription delay timer on. 18 | - returns: Time-shifted sequence. 19 | */ 20 | public func delaySubscription(_ dueTime: RxTimeInterval, scheduler: SchedulerType) 21 | -> Observable { 22 | return DelaySubscription(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) 23 | } 24 | } 25 | 26 | final private class DelaySubscriptionSink 27 | : Sink, ObserverType { 28 | typealias E = O.E 29 | 30 | func on(_ event: Event) { 31 | self.forwardOn(event) 32 | if event.isStopEvent { 33 | self.dispose() 34 | } 35 | } 36 | 37 | } 38 | 39 | final private class DelaySubscription: Producer { 40 | private let _source: Observable 41 | private let _dueTime: RxTimeInterval 42 | private let _scheduler: SchedulerType 43 | 44 | init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { 45 | self._source = source 46 | self._dueTime = dueTime 47 | self._scheduler = scheduler 48 | } 49 | 50 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 51 | let sink = DelaySubscriptionSink(observer: observer, cancel: cancel) 52 | let subscription = self._scheduler.scheduleRelative((), dueTime: self._dueTime) { _ in 53 | return self._source.subscribe(sink) 54 | } 55 | 56 | return (sink: sink, subscription: subscription) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Dematerialize.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Dematerialize.swift 3 | // RxSwift 4 | // 5 | // Created by Jamie Pinkham on 3/13/17. 6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType where E: EventConvertible { 10 | /** 11 | Convert any previously materialized Observable into it's original form. 12 | - seealso: [materialize operator on reactivex.io](http://reactivex.io/documentation/operators/materialize-dematerialize.html) 13 | - returns: The dematerialized observable sequence. 14 | */ 15 | public func dematerialize() -> Observable { 16 | return Dematerialize(source: self.asObservable()) 17 | } 18 | 19 | } 20 | 21 | fileprivate final class DematerializeSink: Sink, ObserverType where O.E == Element.ElementType { 22 | fileprivate func on(_ event: Event) { 23 | switch event { 24 | case .next(let element): 25 | self.forwardOn(element.event) 26 | if element.event.isStopEvent { 27 | self.dispose() 28 | } 29 | case .completed: 30 | self.forwardOn(.completed) 31 | self.dispose() 32 | case .error(let error): 33 | self.forwardOn(.error(error)) 34 | self.dispose() 35 | } 36 | } 37 | } 38 | 39 | final private class Dematerialize: Producer { 40 | private let _source: Observable 41 | 42 | init(source: Observable) { 43 | self._source = source 44 | } 45 | 46 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element.ElementType { 47 | let sink = DematerializeSink(observer: observer, cancel: cancel) 48 | let subscription = self._source.subscribe(sink) 49 | return (sink: sink, subscription: subscription) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/ElementAt.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ElementAt.swift 3 | // RxSwift 4 | // 5 | // Created by Junior B. on 21/10/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Returns a sequence emitting only element _n_ emitted by an Observable 13 | 14 | - seealso: [elementAt operator on reactivex.io](http://reactivex.io/documentation/operators/elementat.html) 15 | 16 | - parameter index: The index of the required element (starting from 0). 17 | - returns: An observable sequence that emits the desired element as its own sole emission. 18 | */ 19 | public func elementAt(_ index: Int) 20 | -> Observable { 21 | return ElementAt(source: self.asObservable(), index: index, throwOnEmpty: true) 22 | } 23 | } 24 | 25 | final private class ElementAtSink: Sink, ObserverType { 26 | typealias SourceType = O.E 27 | typealias Parent = ElementAt 28 | 29 | let _parent: Parent 30 | var _i: Int 31 | 32 | init(parent: Parent, observer: O, cancel: Cancelable) { 33 | self._parent = parent 34 | self._i = parent._index 35 | 36 | super.init(observer: observer, cancel: cancel) 37 | } 38 | 39 | func on(_ event: Event) { 40 | switch event { 41 | case .next: 42 | 43 | if self._i == 0 { 44 | self.forwardOn(event) 45 | self.forwardOn(.completed) 46 | self.dispose() 47 | } 48 | 49 | do { 50 | _ = try decrementChecked(&self._i) 51 | } catch let e { 52 | self.forwardOn(.error(e)) 53 | self.dispose() 54 | return 55 | } 56 | 57 | case .error(let e): 58 | self.forwardOn(.error(e)) 59 | self.dispose() 60 | case .completed: 61 | if self._parent._throwOnEmpty { 62 | self.forwardOn(.error(RxError.argumentOutOfRange)) 63 | } else { 64 | self.forwardOn(.completed) 65 | } 66 | 67 | self.dispose() 68 | } 69 | } 70 | } 71 | 72 | final private class ElementAt: Producer { 73 | let _source: Observable 74 | let _throwOnEmpty: Bool 75 | let _index: Int 76 | 77 | init(source: Observable, index: Int, throwOnEmpty: Bool) { 78 | if index < 0 { 79 | rxFatalError("index can't be negative") 80 | } 81 | 82 | self._source = source 83 | self._index = index 84 | self._throwOnEmpty = throwOnEmpty 85 | } 86 | 87 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceType { 88 | let sink = ElementAtSink(parent: self, observer: observer, cancel: cancel) 89 | let subscription = self._source.subscribe(sink) 90 | return (sink: sink, subscription: subscription) 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Empty.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Empty.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 8/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | /** 11 | Returns an empty observable sequence, using the specified scheduler to send out the single `Completed` message. 12 | 13 | - seealso: [empty operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) 14 | 15 | - returns: An observable sequence with no elements. 16 | */ 17 | public static func empty() -> Observable { 18 | return EmptyProducer() 19 | } 20 | } 21 | 22 | final private class EmptyProducer: Producer { 23 | override func subscribe(_ observer: O) -> Disposable where O.E == Element { 24 | observer.on(.completed) 25 | return Disposables.create() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Enumerated.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Enumerated.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 8/6/17. 6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Enumerates the elements of an observable sequence. 13 | 14 | - seealso: [map operator on reactivex.io](http://reactivex.io/documentation/operators/map.html) 15 | 16 | - returns: An observable sequence that contains tuples of source sequence elements and their indexes. 17 | */ 18 | public func enumerated() 19 | -> Observable<(index: Int, element: E)> { 20 | return Enumerated(source: self.asObservable()) 21 | } 22 | } 23 | 24 | final private class EnumeratedSink: Sink, ObserverType where O.E == (index: Int, element: Element) { 25 | typealias E = Element 26 | var index = 0 27 | 28 | func on(_ event: Event) { 29 | switch event { 30 | case .next(let value): 31 | do { 32 | let nextIndex = try incrementChecked(&self.index) 33 | let next = (index: nextIndex, element: value) 34 | self.forwardOn(.next(next)) 35 | } 36 | catch let e { 37 | self.forwardOn(.error(e)) 38 | self.dispose() 39 | } 40 | case .completed: 41 | self.forwardOn(.completed) 42 | self.dispose() 43 | case .error(let error): 44 | self.forwardOn(.error(error)) 45 | self.dispose() 46 | } 47 | } 48 | } 49 | 50 | final private class Enumerated: Producer<(index: Int, element: Element)> { 51 | private let _source: Observable 52 | 53 | init(source: Observable) { 54 | self._source = source 55 | } 56 | 57 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == (index: Int, element: Element) { 58 | let sink = EnumeratedSink(observer: observer, cancel: cancel) 59 | let subscription = self._source.subscribe(sink) 60 | return (sink: sink, subscription: subscription) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Error.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Error.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 8/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | /** 11 | Returns an observable sequence that terminates with an `error`. 12 | 13 | - seealso: [throw operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) 14 | 15 | - returns: The observable sequence that terminates with specified error. 16 | */ 17 | public static func error(_ error: Swift.Error) -> Observable { 18 | return ErrorProducer(error: error) 19 | } 20 | } 21 | 22 | final private class ErrorProducer: Producer { 23 | private let _error: Swift.Error 24 | 25 | init(error: Swift.Error) { 26 | self._error = error 27 | } 28 | 29 | override func subscribe(_ observer: O) -> Disposable where O.E == Element { 30 | observer.on(.error(self._error)) 31 | return Disposables.create() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/First.swift: -------------------------------------------------------------------------------- 1 | // 2 | // First.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 7/31/17. 6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | fileprivate final class FirstSink : Sink, ObserverType where O.E == Element? { 10 | typealias E = Element 11 | typealias Parent = First 12 | 13 | func on(_ event: Event) { 14 | switch event { 15 | case .next(let value): 16 | self.forwardOn(.next(value)) 17 | self.forwardOn(.completed) 18 | self.dispose() 19 | case .error(let error): 20 | self.forwardOn(.error(error)) 21 | self.dispose() 22 | case .completed: 23 | self.forwardOn(.next(nil)) 24 | self.forwardOn(.completed) 25 | self.dispose() 26 | } 27 | } 28 | } 29 | 30 | final class First: Producer { 31 | fileprivate let _source: Observable 32 | 33 | init(source: Observable) { 34 | self._source = source 35 | } 36 | 37 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element? { 38 | let sink = FirstSink(observer: observer, cancel: cancel) 39 | let subscription = self._source.subscribe(sink) 40 | return (sink: sink, subscription: subscription) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Materialize.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Materialize.swift 3 | // RxSwift 4 | // 5 | // Created by sergdort on 08/03/2017. 6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | /** 11 | Convert any Observable into an Observable of its events. 12 | - seealso: [materialize operator on reactivex.io](http://reactivex.io/documentation/operators/materialize-dematerialize.html) 13 | - returns: An observable sequence that wraps events in an Event. The returned Observable never errors, but it does complete after observing all of the events of the underlying Observable. 14 | */ 15 | public func materialize() -> Observable> { 16 | return Materialize(source: self.asObservable()) 17 | } 18 | } 19 | 20 | fileprivate final class MaterializeSink: Sink, ObserverType where O.E == Event { 21 | 22 | func on(_ event: Event) { 23 | self.forwardOn(.next(event)) 24 | if event.isStopEvent { 25 | self.forwardOn(.completed) 26 | self.dispose() 27 | } 28 | } 29 | } 30 | 31 | final private class Materialize: Producer> { 32 | private let _source: Observable 33 | 34 | init(source: Observable) { 35 | self._source = source 36 | } 37 | 38 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { 39 | let sink = MaterializeSink(observer: observer, cancel: cancel) 40 | let subscription = self._source.subscribe(sink) 41 | 42 | return (sink: sink, subscription: subscription) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Never.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Never.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 8/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Returns a non-terminating observable sequence, which can be used to denote an infinite duration. 13 | 14 | - seealso: [never operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) 15 | 16 | - returns: An observable sequence whose observers will never get called. 17 | */ 18 | public static func never() -> Observable { 19 | return NeverProducer() 20 | } 21 | } 22 | 23 | final private class NeverProducer: Producer { 24 | override func subscribe(_ observer: O) -> Disposable where O.E == Element { 25 | return Disposables.create() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Range.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Range.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 9/13/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType where E : RxAbstractInteger { 10 | /** 11 | Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to generate and send out observer messages. 12 | 13 | - seealso: [range operator on reactivex.io](http://reactivex.io/documentation/operators/range.html) 14 | 15 | - parameter start: The value of the first integer in the sequence. 16 | - parameter count: The number of sequential integers to generate. 17 | - parameter scheduler: Scheduler to run the generator loop on. 18 | - returns: An observable sequence that contains a range of sequential integral numbers. 19 | */ 20 | public static func range(start: E, count: E, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { 21 | return RangeProducer(start: start, count: count, scheduler: scheduler) 22 | } 23 | } 24 | 25 | final private class RangeProducer: Producer { 26 | fileprivate let _start: E 27 | fileprivate let _count: E 28 | fileprivate let _scheduler: ImmediateSchedulerType 29 | 30 | init(start: E, count: E, scheduler: ImmediateSchedulerType) { 31 | guard count >= 0 else { 32 | rxFatalError("count can't be negative") 33 | } 34 | 35 | guard start &+ (count - 1) >= start || count == 0 else { 36 | rxFatalError("overflow of count") 37 | } 38 | 39 | self._start = start 40 | self._count = count 41 | self._scheduler = scheduler 42 | } 43 | 44 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { 45 | let sink = RangeSink(parent: self, observer: observer, cancel: cancel) 46 | let subscription = sink.run() 47 | return (sink: sink, subscription: subscription) 48 | } 49 | } 50 | 51 | final private class RangeSink: Sink where O.E: RxAbstractInteger { 52 | typealias Parent = RangeProducer 53 | 54 | private let _parent: Parent 55 | 56 | init(parent: Parent, observer: O, cancel: Cancelable) { 57 | self._parent = parent 58 | super.init(observer: observer, cancel: cancel) 59 | } 60 | 61 | func run() -> Disposable { 62 | return self._parent._scheduler.scheduleRecursive(0 as O.E) { i, recurse in 63 | if i < self._parent._count { 64 | self.forwardOn(.next(self._parent._start + i)) 65 | recurse(i + 1) 66 | } 67 | else { 68 | self.forwardOn(.completed) 69 | self.dispose() 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Repeat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Repeat.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 9/13/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | /** 11 | Generates an observable sequence that repeats the given element infinitely, using the specified scheduler to send out observer messages. 12 | 13 | - seealso: [repeat operator on reactivex.io](http://reactivex.io/documentation/operators/repeat.html) 14 | 15 | - parameter element: Element to repeat. 16 | - parameter scheduler: Scheduler to run the producer loop on. 17 | - returns: An observable sequence that repeats the given element infinitely. 18 | */ 19 | public static func repeatElement(_ element: E, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { 20 | return RepeatElement(element: element, scheduler: scheduler) 21 | } 22 | } 23 | 24 | final private class RepeatElement: Producer { 25 | fileprivate let _element: Element 26 | fileprivate let _scheduler: ImmediateSchedulerType 27 | 28 | init(element: Element, scheduler: ImmediateSchedulerType) { 29 | self._element = element 30 | self._scheduler = scheduler 31 | } 32 | 33 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 34 | let sink = RepeatElementSink(parent: self, observer: observer, cancel: cancel) 35 | let subscription = sink.run() 36 | 37 | return (sink: sink, subscription: subscription) 38 | } 39 | } 40 | 41 | final private class RepeatElementSink: Sink { 42 | typealias Parent = RepeatElement 43 | 44 | private let _parent: Parent 45 | 46 | init(parent: Parent, observer: O, cancel: Cancelable) { 47 | self._parent = parent 48 | super.init(observer: observer, cancel: cancel) 49 | } 50 | 51 | func run() -> Disposable { 52 | return self._parent._scheduler.scheduleRecursive(self._parent._element) { e, recurse in 53 | self.forwardOn(.next(e)) 54 | recurse(e) 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Sink.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Sink.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | class Sink : Disposable { 10 | fileprivate let _observer: O 11 | fileprivate let _cancel: Cancelable 12 | fileprivate let _disposed = AtomicInt(0) 13 | 14 | #if DEBUG 15 | fileprivate let _synchronizationTracker = SynchronizationTracker() 16 | #endif 17 | 18 | init(observer: O, cancel: Cancelable) { 19 | #if TRACE_RESOURCES 20 | _ = Resources.incrementTotal() 21 | #endif 22 | self._observer = observer 23 | self._cancel = cancel 24 | } 25 | 26 | final func forwardOn(_ event: Event) { 27 | #if DEBUG 28 | self._synchronizationTracker.register(synchronizationErrorMessage: .default) 29 | defer { self._synchronizationTracker.unregister() } 30 | #endif 31 | if isFlagSet(self._disposed, 1) { 32 | return 33 | } 34 | self._observer.on(event) 35 | } 36 | 37 | final func forwarder() -> SinkForward { 38 | return SinkForward(forward: self) 39 | } 40 | 41 | final var disposed: Bool { 42 | return isFlagSet(self._disposed, 1) 43 | } 44 | 45 | func dispose() { 46 | fetchOr(self._disposed, 1) 47 | self._cancel.dispose() 48 | } 49 | 50 | deinit { 51 | #if TRACE_RESOURCES 52 | _ = Resources.decrementTotal() 53 | #endif 54 | } 55 | } 56 | 57 | final class SinkForward: ObserverType { 58 | typealias E = O.E 59 | 60 | private let _forward: Sink 61 | 62 | init(forward: Sink) { 63 | self._forward = forward 64 | } 65 | 66 | final func on(_ event: Event) { 67 | switch event { 68 | case .next: 69 | self._forward._observer.on(event) 70 | case .error, .completed: 71 | self._forward._observer.on(event) 72 | self._forward._cancel.dispose() 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/SkipWhile.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SkipWhile.swift 3 | // RxSwift 4 | // 5 | // Created by Yury Korolev on 10/9/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. 13 | 14 | - seealso: [skipWhile operator on reactivex.io](http://reactivex.io/documentation/operators/skipwhile.html) 15 | 16 | - parameter predicate: A function to test each element for a condition. 17 | - returns: An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. 18 | */ 19 | public func skipWhile(_ predicate: @escaping (E) throws -> Bool) -> Observable { 20 | return SkipWhile(source: self.asObservable(), predicate: predicate) 21 | } 22 | } 23 | 24 | final private class SkipWhileSink: Sink, ObserverType { 25 | typealias Element = O.E 26 | typealias Parent = SkipWhile 27 | 28 | fileprivate let _parent: Parent 29 | fileprivate var _running = false 30 | 31 | init(parent: Parent, observer: O, cancel: Cancelable) { 32 | self._parent = parent 33 | super.init(observer: observer, cancel: cancel) 34 | } 35 | 36 | func on(_ event: Event) { 37 | switch event { 38 | case .next(let value): 39 | if !self._running { 40 | do { 41 | self._running = try !self._parent._predicate(value) 42 | } catch let e { 43 | self.forwardOn(.error(e)) 44 | self.dispose() 45 | return 46 | } 47 | } 48 | 49 | if self._running { 50 | self.forwardOn(.next(value)) 51 | } 52 | case .error, .completed: 53 | self.forwardOn(event) 54 | self.dispose() 55 | } 56 | } 57 | } 58 | 59 | final private class SkipWhile: Producer { 60 | typealias Predicate = (Element) throws -> Bool 61 | 62 | fileprivate let _source: Observable 63 | fileprivate let _predicate: Predicate 64 | 65 | init(source: Observable, predicate: @escaping Predicate) { 66 | self._source = source 67 | self._predicate = predicate 68 | } 69 | 70 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 71 | let sink = SkipWhileSink(parent: self, observer: observer, cancel: cancel) 72 | let subscription = self._source.subscribe(sink) 73 | return (sink: sink, subscription: subscription) 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/StartWith.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StartWith.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 4/6/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Prepends a sequence of values to an observable sequence. 13 | 14 | - seealso: [startWith operator on reactivex.io](http://reactivex.io/documentation/operators/startwith.html) 15 | 16 | - parameter elements: Elements to prepend to the specified sequence. 17 | - returns: The source sequence prepended with the specified values. 18 | */ 19 | public func startWith(_ elements: E ...) 20 | -> Observable { 21 | return StartWith(source: self.asObservable(), elements: elements) 22 | } 23 | } 24 | 25 | final private class StartWith: Producer { 26 | let elements: [Element] 27 | let source: Observable 28 | 29 | init(source: Observable, elements: [Element]) { 30 | self.source = source 31 | self.elements = elements 32 | super.init() 33 | } 34 | 35 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 36 | for e in self.elements { 37 | observer.on(.next(e)) 38 | } 39 | 40 | return (sink: Disposables.create(), subscription: self.source.subscribe(observer)) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SubscribeOn.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Wraps the source sequence in order to run its subscription and unsubscription logic on the specified 13 | scheduler. 14 | 15 | This operation is not commonly used. 16 | 17 | This only performs the side-effects of subscription and unsubscription on the specified scheduler. 18 | 19 | In order to invoke observer callbacks on a `scheduler`, use `observeOn`. 20 | 21 | - seealso: [subscribeOn operator on reactivex.io](http://reactivex.io/documentation/operators/subscribeon.html) 22 | 23 | - parameter scheduler: Scheduler to perform subscription and unsubscription actions on. 24 | - returns: The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. 25 | */ 26 | public func subscribeOn(_ scheduler: ImmediateSchedulerType) 27 | -> Observable { 28 | return SubscribeOn(source: self, scheduler: scheduler) 29 | } 30 | } 31 | 32 | final private class SubscribeOnSink: Sink, ObserverType where Ob.E == O.E { 33 | typealias Element = O.E 34 | typealias Parent = SubscribeOn 35 | 36 | let parent: Parent 37 | 38 | init(parent: Parent, observer: O, cancel: Cancelable) { 39 | self.parent = parent 40 | super.init(observer: observer, cancel: cancel) 41 | } 42 | 43 | func on(_ event: Event) { 44 | self.forwardOn(event) 45 | 46 | if event.isStopEvent { 47 | self.dispose() 48 | } 49 | } 50 | 51 | func run() -> Disposable { 52 | let disposeEverything = SerialDisposable() 53 | let cancelSchedule = SingleAssignmentDisposable() 54 | 55 | disposeEverything.disposable = cancelSchedule 56 | 57 | let disposeSchedule = self.parent.scheduler.schedule(()) { _ -> Disposable in 58 | let subscription = self.parent.source.subscribe(self) 59 | disposeEverything.disposable = ScheduledDisposable(scheduler: self.parent.scheduler, disposable: subscription) 60 | return Disposables.create() 61 | } 62 | 63 | cancelSchedule.setDisposable(disposeSchedule) 64 | 65 | return disposeEverything 66 | } 67 | } 68 | 69 | final private class SubscribeOn: Producer { 70 | let source: Ob 71 | let scheduler: ImmediateSchedulerType 72 | 73 | init(source: Ob, scheduler: ImmediateSchedulerType) { 74 | self.source = source 75 | self.scheduler = scheduler 76 | } 77 | 78 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Ob.E { 79 | let sink = SubscribeOnSink(parent: self, observer: observer, cancel: cancel) 80 | let subscription = sink.run() 81 | return (sink: sink, subscription: subscription) 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/TakeLast.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TakeLast.swift 3 | // RxSwift 4 | // 5 | // Created by Tomi Koskinen on 25/10/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Returns a specified number of contiguous elements from the end of an observable sequence. 13 | 14 | This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. 15 | 16 | - seealso: [takeLast operator on reactivex.io](http://reactivex.io/documentation/operators/takelast.html) 17 | 18 | - parameter count: Number of elements to take from the end of the source sequence. 19 | - returns: An observable sequence containing the specified number of elements from the end of the source sequence. 20 | */ 21 | public func takeLast(_ count: Int) 22 | -> Observable { 23 | return TakeLast(source: self.asObservable(), count: count) 24 | } 25 | } 26 | 27 | final private class TakeLastSink: Sink, ObserverType { 28 | typealias E = O.E 29 | typealias Parent = TakeLast 30 | 31 | private let _parent: Parent 32 | 33 | private var _elements: Queue 34 | 35 | init(parent: Parent, observer: O, cancel: Cancelable) { 36 | self._parent = parent 37 | self._elements = Queue(capacity: parent._count + 1) 38 | super.init(observer: observer, cancel: cancel) 39 | } 40 | 41 | func on(_ event: Event) { 42 | switch event { 43 | case .next(let value): 44 | self._elements.enqueue(value) 45 | if self._elements.count > self._parent._count { 46 | _ = self._elements.dequeue() 47 | } 48 | case .error: 49 | self.forwardOn(event) 50 | self.dispose() 51 | case .completed: 52 | for e in self._elements { 53 | self.forwardOn(.next(e)) 54 | } 55 | self.forwardOn(.completed) 56 | self.dispose() 57 | } 58 | } 59 | } 60 | 61 | final private class TakeLast: Producer { 62 | fileprivate let _source: Observable 63 | fileprivate let _count: Int 64 | 65 | init(source: Observable, count: Int) { 66 | if count < 0 { 67 | rxFatalError("count can't be negative") 68 | } 69 | self._source = source 70 | self._count = count 71 | } 72 | 73 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 74 | let sink = TakeLastSink(parent: self, observer: observer, cancel: cancel) 75 | let subscription = self._source.subscribe(sink) 76 | return (sink: sink, subscription: subscription) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/TakeWhile.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TakeWhile.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | 11 | /** 12 | Returns elements from an observable sequence as long as a specified condition is true. 13 | 14 | - seealso: [takeWhile operator on reactivex.io](http://reactivex.io/documentation/operators/takewhile.html) 15 | 16 | - parameter predicate: A function to test each element for a condition. 17 | - returns: An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. 18 | */ 19 | public func takeWhile(_ predicate: @escaping (E) throws -> Bool) 20 | -> Observable { 21 | return TakeWhile(source: self.asObservable(), predicate: predicate) 22 | } 23 | } 24 | 25 | final private class TakeWhileSink 26 | : Sink 27 | , ObserverType { 28 | typealias Element = O.E 29 | typealias Parent = TakeWhile 30 | 31 | fileprivate let _parent: Parent 32 | 33 | fileprivate var _running = true 34 | 35 | init(parent: Parent, observer: O, cancel: Cancelable) { 36 | self._parent = parent 37 | super.init(observer: observer, cancel: cancel) 38 | } 39 | 40 | func on(_ event: Event) { 41 | switch event { 42 | case .next(let value): 43 | if !self._running { 44 | return 45 | } 46 | 47 | do { 48 | self._running = try self._parent._predicate(value) 49 | } catch let e { 50 | self.forwardOn(.error(e)) 51 | self.dispose() 52 | return 53 | } 54 | 55 | if self._running { 56 | self.forwardOn(.next(value)) 57 | } else { 58 | self.forwardOn(.completed) 59 | self.dispose() 60 | } 61 | case .error, .completed: 62 | self.forwardOn(event) 63 | self.dispose() 64 | } 65 | } 66 | 67 | } 68 | 69 | final private class TakeWhile: Producer { 70 | typealias Predicate = (Element) throws -> Bool 71 | 72 | fileprivate let _source: Observable 73 | fileprivate let _predicate: Predicate 74 | 75 | init(source: Observable, predicate: @escaping Predicate) { 76 | self._source = source 77 | self._predicate = predicate 78 | } 79 | 80 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 81 | let sink = TakeWhileSink(parent: self, observer: observer, cancel: cancel) 82 | let subscription = self._source.subscribe(sink) 83 | return (sink: sink, subscription: subscription) 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/ToArray.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ToArray.swift 3 | // RxSwift 4 | // 5 | // Created by Junior B. on 20/10/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | 10 | extension ObservableType { 11 | 12 | /** 13 | Converts an Observable into another Observable that emits the whole sequence as a single array and then terminates. 14 | 15 | For aggregation behavior see `reduce`. 16 | 17 | - seealso: [toArray operator on reactivex.io](http://reactivex.io/documentation/operators/to.html) 18 | 19 | - returns: An observable sequence containing all the emitted elements as array. 20 | */ 21 | public func toArray() 22 | -> Observable<[E]> { 23 | return ToArray(source: self.asObservable()) 24 | } 25 | } 26 | 27 | final private class ToArraySink: Sink, ObserverType where O.E == [SourceType] { 28 | typealias Parent = ToArray 29 | 30 | let _parent: Parent 31 | var _list = [SourceType]() 32 | 33 | init(parent: Parent, observer: O, cancel: Cancelable) { 34 | self._parent = parent 35 | 36 | super.init(observer: observer, cancel: cancel) 37 | } 38 | 39 | func on(_ event: Event) { 40 | switch event { 41 | case .next(let value): 42 | self._list.append(value) 43 | case .error(let e): 44 | self.forwardOn(.error(e)) 45 | self.dispose() 46 | case .completed: 47 | self.forwardOn(.next(self._list)) 48 | self.forwardOn(.completed) 49 | self.dispose() 50 | } 51 | } 52 | } 53 | 54 | final private class ToArray: Producer<[SourceType]> { 55 | let _source: Observable 56 | 57 | init(source: Observable) { 58 | self._source = source 59 | } 60 | 61 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == [SourceType] { 62 | let sink = ToArraySink(parent: self, observer: observer, cancel: cancel) 63 | let subscription = self._source.subscribe(sink) 64 | return (sink: sink, subscription: subscription) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ObserverType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObserverType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Supports push-style iteration over an observable sequence. 10 | public protocol ObserverType { 11 | /// The type of elements in sequence that observer can observe. 12 | associatedtype E 13 | 14 | /// Notify observer about sequence event. 15 | /// 16 | /// - parameter event: Event that occurred. 17 | func on(_ event: Event) 18 | } 19 | 20 | /// Convenience API extensions to provide alternate next, error, completed events 21 | extension ObserverType { 22 | 23 | /// Convenience method equivalent to `on(.next(element: E))` 24 | /// 25 | /// - parameter element: Next element to send to observer(s) 26 | public func onNext(_ element: E) { 27 | self.on(.next(element)) 28 | } 29 | 30 | /// Convenience method equivalent to `on(.completed)` 31 | public func onCompleted() { 32 | self.on(.completed) 33 | } 34 | 35 | /// Convenience method equivalent to `on(.error(Swift.Error))` 36 | /// - parameter error: Swift.Error to send to observer(s) 37 | public func onError(_ error: Swift.Error) { 38 | self.on(.error(error)) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnonymousObserver.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | final class AnonymousObserver : ObserverBase { 10 | typealias Element = ElementType 11 | 12 | typealias EventHandler = (Event) -> Void 13 | 14 | private let _eventHandler : EventHandler 15 | 16 | init(_ eventHandler: @escaping EventHandler) { 17 | #if TRACE_RESOURCES 18 | _ = Resources.incrementTotal() 19 | #endif 20 | self._eventHandler = eventHandler 21 | } 22 | 23 | override func onCore(_ event: Event) { 24 | return self._eventHandler(event) 25 | } 26 | 27 | #if TRACE_RESOURCES 28 | deinit { 29 | _ = Resources.decrementTotal() 30 | } 31 | #endif 32 | } 33 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observers/ObserverBase.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObserverBase.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/15/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | class ObserverBase : Disposable, ObserverType { 10 | typealias E = ElementType 11 | 12 | private let _isStopped = AtomicInt(0) 13 | 14 | func on(_ event: Event) { 15 | switch event { 16 | case .next: 17 | if load(self._isStopped) == 0 { 18 | self.onCore(event) 19 | } 20 | case .error, .completed: 21 | if fetchOr(self._isStopped, 1) == 0 { 22 | self.onCore(event) 23 | } 24 | } 25 | } 26 | 27 | func onCore(_ event: Event) { 28 | rxAbstractMethod() 29 | } 30 | 31 | func dispose() { 32 | fetchOr(self._isStopped, 1) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Reactive.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Reactive.swift 3 | // RxSwift 4 | // 5 | // Created by Yury Korolev on 5/2/16. 6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /** 10 | Use `Reactive` proxy as customization point for constrained protocol extensions. 11 | 12 | General pattern would be: 13 | 14 | // 1. Extend Reactive protocol with constrain on Base 15 | // Read as: Reactive Extension where Base is a SomeType 16 | extension Reactive where Base: SomeType { 17 | // 2. Put any specific reactive extension for SomeType here 18 | } 19 | 20 | With this approach we can have more specialized methods and properties using 21 | `Base` and not just specialized on common base type. 22 | 23 | */ 24 | 25 | public struct Reactive { 26 | /// Base object to extend. 27 | public let base: Base 28 | 29 | /// Creates extensions with base object. 30 | /// 31 | /// - parameter base: Base object. 32 | public init(_ base: Base) { 33 | self.base = base 34 | } 35 | } 36 | 37 | /// A type that has reactive extensions. 38 | public protocol ReactiveCompatible { 39 | /// Extended type 40 | associatedtype CompatibleType 41 | 42 | /// Reactive extensions. 43 | static var rx: Reactive.Type { get set } 44 | 45 | /// Reactive extensions. 46 | var rx: Reactive { get set } 47 | } 48 | 49 | extension ReactiveCompatible { 50 | /// Reactive extensions. 51 | public static var rx: Reactive.Type { 52 | get { 53 | return Reactive.self 54 | } 55 | set { 56 | // this enables using Reactive to "mutate" base type 57 | } 58 | } 59 | 60 | /// Reactive extensions. 61 | public var rx: Reactive { 62 | get { 63 | return Reactive(self) 64 | } 65 | set { 66 | // this enables using Reactive to "mutate" base object 67 | } 68 | } 69 | } 70 | 71 | import class Foundation.NSObject 72 | 73 | /// Extend NSObject with `rx` proxy. 74 | extension NSObject: ReactiveCompatible { } 75 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/RxMutableBox.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxMutableBox.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 5/22/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Creates mutable reference wrapper for any type. 10 | final class RxMutableBox : CustomDebugStringConvertible { 11 | /// Wrapped value 12 | var value : T 13 | 14 | /// Creates reference wrapper for `value`. 15 | /// 16 | /// - parameter value: Value to wrap. 17 | init (_ value: T) { 18 | self.value = value 19 | } 20 | } 21 | 22 | extension RxMutableBox { 23 | /// - returns: Box description. 24 | var debugDescription: String { 25 | return "MutatingBox(\(self.value))" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/SchedulerType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SchedulerType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import struct Foundation.TimeInterval 10 | import struct Foundation.Date 11 | 12 | // Type that represents time interval in the context of RxSwift. 13 | public typealias RxTimeInterval = TimeInterval 14 | 15 | /// Type that represents absolute time in the context of RxSwift. 16 | public typealias RxTime = Date 17 | 18 | /// Represents an object that schedules units of work. 19 | public protocol SchedulerType: ImmediateSchedulerType { 20 | 21 | /// - returns: Current time. 22 | var now : RxTime { 23 | get 24 | } 25 | 26 | /** 27 | Schedules an action to be executed. 28 | 29 | - parameter state: State passed to the action to be executed. 30 | - parameter dueTime: Relative time after which to execute the action. 31 | - parameter action: Action to be executed. 32 | - returns: The disposable object used to cancel the scheduled action (best effort). 33 | */ 34 | func scheduleRelative(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable 35 | 36 | /** 37 | Schedules a periodic piece of work. 38 | 39 | - parameter state: State passed to the action to be executed. 40 | - parameter startAfter: Period after which initial work should be run. 41 | - parameter period: Period for running the work periodically. 42 | - parameter action: Action to be executed. 43 | - returns: The disposable object used to cancel the scheduled action (best effort). 44 | */ 45 | func schedulePeriodic(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable 46 | } 47 | 48 | extension SchedulerType { 49 | 50 | /** 51 | Periodic task will be emulated using recursive scheduling. 52 | 53 | - parameter state: Initial state passed to the action upon the first iteration. 54 | - parameter startAfter: Period after which initial work should be run. 55 | - parameter period: Period for running the work periodically. 56 | - returns: The disposable object used to cancel the scheduled recurring action (best effort). 57 | */ 58 | public func schedulePeriodic(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { 59 | let schedule = SchedulePeriodicRecursive(scheduler: self, startAfter: startAfter, period: period, action: action, state: state) 60 | 61 | return schedule.start() 62 | } 63 | 64 | func scheduleRecursive(_ state: State, dueTime: RxTimeInterval, action: @escaping (State, AnyRecursiveScheduler) -> Void) -> Disposable { 65 | let scheduler = AnyRecursiveScheduler(scheduler: self, action: action) 66 | 67 | scheduler.schedule(state, dueTime: dueTime) 68 | 69 | return Disposables.create(with: scheduler.dispose) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoricalScheduler.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 12/27/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import struct Foundation.Date 10 | 11 | /// Provides a virtual time scheduler that uses `Date` for absolute time and `NSTimeInterval` for relative time. 12 | public class HistoricalScheduler : VirtualTimeScheduler { 13 | 14 | /** 15 | Creates a new historical scheduler with initial clock value. 16 | 17 | - parameter initialClock: Initial value for virtual clock. 18 | */ 19 | public init(initialClock: RxTime = Date(timeIntervalSince1970: 0)) { 20 | super.init(initialClock: initialClock, converter: HistoricalSchedulerTimeConverter()) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoricalSchedulerTimeConverter.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 12/27/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import struct Foundation.Date 10 | 11 | /// Converts historical virtual time into real time. 12 | /// 13 | /// Since historical virtual time is also measured in `Date`, this converter is identity function. 14 | public struct HistoricalSchedulerTimeConverter : VirtualTimeConverterType { 15 | /// Virtual time unit used that represents ticks of virtual clock. 16 | public typealias VirtualTimeUnit = RxTime 17 | 18 | /// Virtual time unit used to represent differences of virtual times. 19 | public typealias VirtualTimeIntervalUnit = RxTimeInterval 20 | 21 | /// Returns identical value of argument passed because historical virtual time is equal to real time, just 22 | /// decoupled from local machine clock. 23 | public func convertFromVirtualTime(_ virtualTime: VirtualTimeUnit) -> RxTime { 24 | return virtualTime 25 | } 26 | 27 | /// Returns identical value of argument passed because historical virtual time is equal to real time, just 28 | /// decoupled from local machine clock. 29 | public func convertToVirtualTime(_ time: RxTime) -> VirtualTimeUnit { 30 | return time 31 | } 32 | 33 | /// Returns identical value of argument passed because historical virtual time is equal to real time, just 34 | /// decoupled from local machine clock. 35 | public func convertFromVirtualTimeInterval(_ virtualTimeInterval: VirtualTimeIntervalUnit) -> RxTimeInterval { 36 | return virtualTimeInterval 37 | } 38 | 39 | /// Returns identical value of argument passed because historical virtual time is equal to real time, just 40 | /// decoupled from local machine clock. 41 | public func convertToVirtualTimeInterval(_ timeInterval: RxTimeInterval) -> VirtualTimeIntervalUnit { 42 | return timeInterval 43 | } 44 | 45 | /** 46 | Offsets `Date` by time interval. 47 | 48 | - parameter time: Time. 49 | - parameter timeInterval: Time interval offset. 50 | - returns: Time offsetted by time interval. 51 | */ 52 | public func offsetVirtualTime(_ time: VirtualTimeUnit, offset: VirtualTimeIntervalUnit) -> VirtualTimeUnit { 53 | return time.addingTimeInterval(offset) 54 | } 55 | 56 | /// Compares two `Date`s. 57 | public func compareVirtualTime(_ lhs: VirtualTimeUnit, _ rhs: VirtualTimeUnit) -> VirtualTimeComparison { 58 | switch lhs.compare(rhs as Date) { 59 | case .orderedAscending: 60 | return .lessThan 61 | case .orderedSame: 62 | return .equal 63 | case .orderedDescending: 64 | return .greaterThan 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InvocableScheduledItem.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 11/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | struct InvocableScheduledItem : InvocableType { 10 | 11 | let _invocable: I 12 | let _state: I.Value 13 | 14 | init(invocable: I, state: I.Value) { 15 | self._invocable = invocable 16 | self._state = state 17 | } 18 | 19 | func invoke() { 20 | self._invocable.invoke(self._state) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InvocableType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 11/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | protocol InvocableType { 10 | func invoke() 11 | } 12 | 13 | protocol InvocableWithValueType { 14 | associatedtype Value 15 | 16 | func invoke(_ value: Value) 17 | } 18 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScheduledItem.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 9/2/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | struct ScheduledItem 10 | : ScheduledItemType 11 | , InvocableType { 12 | typealias Action = (T) -> Disposable 13 | 14 | private let _action: Action 15 | private let _state: T 16 | 17 | private let _disposable = SingleAssignmentDisposable() 18 | 19 | var isDisposed: Bool { 20 | return self._disposable.isDisposed 21 | } 22 | 23 | init(action: @escaping Action, state: T) { 24 | self._action = action 25 | self._state = state 26 | } 27 | 28 | func invoke() { 29 | self._disposable.setDisposable(self._action(self._state)) 30 | } 31 | 32 | func dispose() { 33 | self._disposable.dispose() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScheduledItemType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 11/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | protocol ScheduledItemType 10 | : Cancelable 11 | , InvocableType { 12 | func invoke() 13 | } 14 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OperationQueueScheduler.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 4/4/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import class Foundation.Operation 10 | import class Foundation.OperationQueue 11 | import class Foundation.BlockOperation 12 | import Dispatch 13 | 14 | /// Abstracts the work that needs to be performed on a specific `NSOperationQueue`. 15 | /// 16 | /// This scheduler is suitable for cases when there is some bigger chunk of work that needs to be performed in background and you want to fine tune concurrent processing using `maxConcurrentOperationCount`. 17 | public class OperationQueueScheduler: ImmediateSchedulerType { 18 | public let operationQueue: OperationQueue 19 | public let queuePriority: Operation.QueuePriority 20 | 21 | /// Constructs new instance of `OperationQueueScheduler` that performs work on `operationQueue`. 22 | /// 23 | /// - parameter operationQueue: Operation queue targeted to perform work on. 24 | /// - parameter queuePriority: Queue priority which will be assigned to new operations. 25 | public init(operationQueue: OperationQueue, queuePriority: Operation.QueuePriority = .normal) { 26 | self.operationQueue = operationQueue 27 | self.queuePriority = queuePriority 28 | } 29 | 30 | /** 31 | Schedules an action to be executed recursively. 32 | 33 | - parameter state: State passed to the action to be executed. 34 | - parameter action: Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. 35 | - returns: The disposable object used to cancel the scheduled action (best effort). 36 | */ 37 | public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { 38 | let cancel = SingleAssignmentDisposable() 39 | 40 | let operation = BlockOperation { 41 | if cancel.isDisposed { 42 | return 43 | } 44 | 45 | 46 | cancel.setDisposable(action(state)) 47 | } 48 | 49 | operation.queuePriority = self.queuePriority 50 | 51 | self.operationQueue.addOperation(operation) 52 | 53 | return cancel 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SchedulerServices+Emulation.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/6/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | enum SchedulePeriodicRecursiveCommand { 10 | case tick 11 | case dispatchStart 12 | } 13 | 14 | final class SchedulePeriodicRecursive { 15 | typealias RecursiveAction = (State) -> State 16 | typealias RecursiveScheduler = AnyRecursiveScheduler 17 | 18 | private let _scheduler: SchedulerType 19 | private let _startAfter: RxTimeInterval 20 | private let _period: RxTimeInterval 21 | private let _action: RecursiveAction 22 | 23 | private var _state: State 24 | private let _pendingTickCount = AtomicInt(0) 25 | 26 | init(scheduler: SchedulerType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping RecursiveAction, state: State) { 27 | self._scheduler = scheduler 28 | self._startAfter = startAfter 29 | self._period = period 30 | self._action = action 31 | self._state = state 32 | } 33 | 34 | func start() -> Disposable { 35 | return self._scheduler.scheduleRecursive(SchedulePeriodicRecursiveCommand.tick, dueTime: self._startAfter, action: self.tick) 36 | } 37 | 38 | func tick(_ command: SchedulePeriodicRecursiveCommand, scheduler: RecursiveScheduler) { 39 | // Tries to emulate periodic scheduling as best as possible. 40 | // The problem that could arise is if handling periodic ticks take too long, or 41 | // tick interval is short. 42 | switch command { 43 | case .tick: 44 | scheduler.schedule(.tick, dueTime: self._period) 45 | 46 | // The idea is that if on tick there wasn't any item enqueued, schedule to perform work immediately. 47 | // Else work will be scheduled after previous enqueued work completes. 48 | if increment(self._pendingTickCount) == 0 { 49 | self.tick(.dispatchStart, scheduler: scheduler) 50 | } 51 | 52 | case .dispatchStart: 53 | self._state = self._action(self._state) 54 | // Start work and schedule check is this last batch of work 55 | if decrement(self._pendingTickCount) > 1 { 56 | // This gives priority to scheduler emulation, it's not perfect, but helps 57 | scheduler.schedule(SchedulePeriodicRecursiveCommand.dispatchStart) 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Subjects/SubjectType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SubjectType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/1/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents an object that is both an observable sequence as well as an observer. 10 | public protocol SubjectType : ObservableType { 11 | /// The type of the observer that represents this subject. 12 | /// 13 | /// Usually this type is type of subject itself, but it doesn't have to be. 14 | associatedtype SubjectObserverType : ObserverType 15 | 16 | /// Returns observer interface for subject. 17 | /// 18 | /// - returns: Observer interface for subject. 19 | func asObserver() -> SubjectObserverType 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftSupport.swift 3 | // RxSwift 4 | // 5 | // Created by Volodymyr Gorbenko on 3/6/17. 6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | typealias IntMax = Int64 12 | public typealias RxAbstractInteger = FixedWidthInteger 13 | 14 | extension SignedInteger { 15 | func toIntMax() -> IntMax { 16 | return IntMax(self) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObservableType+PrimitiveSequence.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 9/17/17. 6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension ObservableType { 10 | /** 11 | The `asSingle` operator throws a `RxError.noElements` or `RxError.moreThanOneElement` 12 | if the source Observable does not emit exactly one element before successfully completing. 13 | 14 | - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) 15 | 16 | - returns: An observable sequence that emits a single element when the source Observable has completed, or throws an exception if more (or none) of them are emitted. 17 | */ 18 | public func asSingle() -> Single { 19 | return PrimitiveSequence(raw: AsSingle(source: self.asObservable())) 20 | } 21 | 22 | /** 23 | The `first` operator emits only the very first item emitted by this Observable, 24 | or nil if this Observable completes without emitting anything. 25 | 26 | - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) 27 | 28 | - returns: An observable sequence that emits a single element or nil if the source observable sequence completes without emitting any items. 29 | */ 30 | public func first() -> Single { 31 | return PrimitiveSequence(raw: First(source: self.asObservable())) 32 | } 33 | 34 | /** 35 | The `asMaybe` operator throws a `RxError.moreThanOneElement` 36 | if the source Observable does not emit at most one element before successfully completing. 37 | 38 | - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) 39 | 40 | - returns: An observable sequence that emits a single element, completes when the source Observable has completed, or throws an exception if more of them are emitted. 41 | */ 42 | public func asMaybe() -> Maybe { 43 | return PrimitiveSequence(raw: AsMaybe(source: self.asObservable())) 44 | } 45 | } 46 | 47 | extension ObservableType where E == Never { 48 | /** 49 | - returns: An observable sequence that completes. 50 | */ 51 | public func asCompletable() 52 | -> Completable { 53 | return PrimitiveSequence(raw: self.asObservable()) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModule/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModule/Pods-BigModule-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## RxSwift 5 | 6 | **The MIT License** 7 | **Copyright © 2015 Krunoslav Zaher** 8 | **All rights reserved.** 9 | 10 | 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: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | 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. 15 | Generated by CocoaPods - https://cocoapods.org 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModule/Pods-BigModule-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | **The MIT License** 18 | **Copyright © 2015 Krunoslav Zaher** 19 | **All rights reserved.** 20 | 21 | 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: 22 | 23 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 24 | 25 | 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. 26 | License 27 | MIT 28 | Title 29 | RxSwift 30 | Type 31 | PSGroupSpecifier 32 | 33 | 34 | FooterText 35 | Generated by CocoaPods - https://cocoapods.org 36 | Title 37 | 38 | Type 39 | PSGroupSpecifier 40 | 41 | 42 | StringsTable 43 | Acknowledgements 44 | Title 45 | Acknowledgements 46 | 47 | 48 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModule/Pods-BigModule-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_BigModule : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_BigModule 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModule/Pods-BigModule-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_BigModuleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_BigModuleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModule/Pods-BigModule.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift/RxSwift.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "RxSwift" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModule/Pods-BigModule.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_BigModule { 2 | umbrella header "Pods-BigModule-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModule/Pods-BigModule.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift/RxSwift.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "RxSwift" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModuleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModuleTests/Pods-BigModuleTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## RxSwift 5 | 6 | **The MIT License** 7 | **Copyright © 2015 Krunoslav Zaher** 8 | **All rights reserved.** 9 | 10 | 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: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | 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. 15 | Generated by CocoaPods - https://cocoapods.org 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModuleTests/Pods-BigModuleTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | **The MIT License** 18 | **Copyright © 2015 Krunoslav Zaher** 19 | **All rights reserved.** 20 | 21 | 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: 22 | 23 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 24 | 25 | 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. 26 | License 27 | MIT 28 | Title 29 | RxSwift 30 | Type 31 | PSGroupSpecifier 32 | 33 | 34 | FooterText 35 | Generated by CocoaPods - https://cocoapods.org 36 | Title 37 | 38 | Type 39 | PSGroupSpecifier 40 | 41 | 42 | StringsTable 43 | Acknowledgements 44 | Title 45 | Acknowledgements 46 | 47 | 48 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModuleTests/Pods-BigModuleTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_BigModuleTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_BigModuleTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModuleTests/Pods-BigModuleTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_BigModuleTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_BigModuleTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModuleTests/Pods-BigModuleTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift/RxSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "RxSwift" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModuleTests/Pods-BigModuleTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_BigModuleTests { 2 | umbrella header "Pods-BigModuleTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-BigModuleTests/Pods-BigModuleTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift/RxSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "RxSwift" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModule/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModule/Pods-LittleModule-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModule/Pods-LittleModule-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModule/Pods-LittleModule-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LittleModule : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LittleModule 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModule/Pods-LittleModule-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_LittleModuleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_LittleModuleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModule/Pods-LittleModule.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModule/Pods-LittleModule.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_LittleModule { 2 | umbrella header "Pods-LittleModule-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModule/Pods-LittleModule.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModuleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModuleTests/Pods-LittleModuleTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModuleTests/Pods-LittleModuleTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModuleTests/Pods-LittleModuleTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LittleModuleTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LittleModuleTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModuleTests/Pods-LittleModuleTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_LittleModuleTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_LittleModuleTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModuleTests/Pods-LittleModuleTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModuleTests/Pods-LittleModuleTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_LittleModuleTests { 2 | umbrella header "Pods-LittleModuleTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LittleModuleTests/Pods-LittleModuleTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Modularization/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Modularization/Pods-Modularization-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## RxSwift 5 | 6 | **The MIT License** 7 | **Copyright © 2015 Krunoslav Zaher** 8 | **All rights reserved.** 9 | 10 | 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: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | 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. 15 | Generated by CocoaPods - https://cocoapods.org 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Modularization/Pods-Modularization-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | **The MIT License** 18 | **Copyright © 2015 Krunoslav Zaher** 19 | **All rights reserved.** 20 | 21 | 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: 22 | 23 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 24 | 25 | 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. 26 | License 27 | MIT 28 | Title 29 | RxSwift 30 | Type 31 | PSGroupSpecifier 32 | 33 | 34 | FooterText 35 | Generated by CocoaPods - https://cocoapods.org 36 | Title 37 | 38 | Type 39 | PSGroupSpecifier 40 | 41 | 42 | StringsTable 43 | Acknowledgements 44 | Title 45 | Acknowledgements 46 | 47 | 48 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Modularization/Pods-Modularization-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Modularization : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Modularization 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Modularization/Pods-Modularization-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ModularizationVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ModularizationVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Modularization/Pods-Modularization.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift/RxSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "RxSwift" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Modularization/Pods-Modularization.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Modularization { 2 | umbrella header "Pods-Modularization-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Modularization/Pods-Modularization.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift/RxSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "RxSwift" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ModularizationTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ModularizationTests/Pods-ModularizationTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ModularizationTests/Pods-ModularizationTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ModularizationTests/Pods-ModularizationTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ModularizationTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ModularizationTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ModularizationTests/Pods-ModularizationTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ModularizationTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ModularizationTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ModularizationTests/Pods-ModularizationTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift/RxSwift.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ModularizationTests/Pods-ModularizationTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ModularizationTests { 2 | umbrella header "Pods-ModularizationTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ModularizationTests/Pods-ModularizationTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RxSwift/RxSwift.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.5.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_RxSwift : NSObject 3 | @end 4 | @implementation PodsDummy_RxSwift 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double RxSwiftVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char RxSwiftVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift.modulemap: -------------------------------------------------------------------------------- 1 | framework module RxSwift { 2 | umbrella header "RxSwift-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/RxSwift 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/RxSwift 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # modularized-ios-app 2 | Here is a example of a modularized iOS app with multiple and dependent frameworks/modules. This app is also using pods inside modules 3 | 4 | It comes as a complement for my post on medium on [how to modularize an iOS app](https://medium.com/swlh/modularize-an-ios-application-919b30e41e3c) ! 5 | --------------------------------------------------------------------------------