├── .DS_Store ├── .gitignore ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── Alamofire │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── AFError.swift │ │ ├── Alamofire.swift │ │ ├── DispatchQueue+Alamofire.swift │ │ ├── MultipartFormData.swift │ │ ├── NetworkReachabilityManager.swift │ │ ├── Notifications.swift │ │ ├── ParameterEncoding.swift │ │ ├── Request.swift │ │ ├── Response.swift │ │ ├── ResponseSerialization.swift │ │ ├── Result.swift │ │ ├── ServerTrustPolicy.swift │ │ ├── SessionDelegate.swift │ │ ├── SessionManager.swift │ │ ├── TaskDelegate.swift │ │ ├── Timeline.swift │ │ └── Validation.swift ├── HandyJSON │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── AnyExtensions.swift │ │ ├── Configuration.swift │ │ ├── CustomDateFormatTransform.swift │ │ ├── DataTransform.swift │ │ ├── DateFormatterTransform.swift │ │ ├── DateTransform.swift │ │ ├── Deserializer.swift │ │ ├── EnumTransform.swift │ │ ├── HandyJSON.h │ │ ├── HelpingMapper.swift │ │ ├── HexColorTransform.swift │ │ ├── ISO8601DateTransform.swift │ │ ├── Logger.swift │ │ ├── Metadata.swift │ │ ├── NSDecimalNumberTransform.swift │ │ ├── NominalType.swift │ │ ├── OtherExtension.swift │ │ ├── PointerType.swift │ │ ├── Properties.swift │ │ ├── Protocol.swift │ │ ├── ReflectionHelper.swift │ │ ├── Serializer+Legacy.swift │ │ ├── Serializer.swift │ │ ├── TransformOf.swift │ │ ├── TransformType.swift │ │ └── URLTransform.swift ├── Manifest.lock ├── Moya │ ├── License.md │ ├── Readme.md │ └── Sources │ │ ├── Moya │ │ ├── Cancellable.swift │ │ ├── Endpoint.swift │ │ ├── Image.swift │ │ ├── Moya+Alamofire.swift │ │ ├── MoyaAvailability.swift │ │ ├── MoyaError.swift │ │ ├── MoyaProvider+Defaults.swift │ │ ├── MoyaProvider+Internal.swift │ │ ├── MoyaProvider.swift │ │ ├── MultiTarget.swift │ │ ├── MultipartFormData.swift │ │ ├── Plugin.swift │ │ ├── Plugins │ │ │ ├── AccessTokenPlugin.swift │ │ │ ├── CredentialsPlugin.swift │ │ │ ├── NetworkActivityPlugin.swift │ │ │ └── NetworkLoggerPlugin.swift │ │ ├── Response.swift │ │ └── TargetType.swift │ │ └── RxMoya │ │ ├── Observable+Response.swift │ │ └── RxMoyaProvider.swift ├── ObjectMapper │ ├── LICENSE │ ├── README-CN.md │ └── Sources │ │ ├── CustomDateFormatTransform.swift │ │ ├── DataTransform.swift │ │ ├── DateFormatterTransform.swift │ │ ├── DateTransform.swift │ │ ├── DictionaryTransform.swift │ │ ├── EnumOperators.swift │ │ ├── EnumTransform.swift │ │ ├── FromJSON.swift │ │ ├── HexColorTransform.swift │ │ ├── ISO8601DateTransform.swift │ │ ├── ImmutableMappable.swift │ │ ├── IntegerOperators.swift │ │ ├── Map.swift │ │ ├── MapError.swift │ │ ├── Mappable.swift │ │ ├── Mapper.swift │ │ ├── NSDecimalNumberTransform.swift │ │ ├── Operators.swift │ │ ├── ToJSON.swift │ │ ├── TransformOf.swift │ │ ├── TransformOperators.swift │ │ ├── TransformType.swift │ │ └── URLTransform.swift ├── Pods.xcodeproj │ └── project.pbxproj ├── Result │ ├── LICENSE │ ├── README.md │ └── Result │ │ ├── Result.swift │ │ └── ResultProtocol.swift ├── RxSwift │ ├── LICENSE.md │ ├── Platform │ │ ├── DataStructures │ │ │ ├── Bag.swift │ │ │ ├── InfiniteSequence.swift │ │ │ ├── PriorityQueue.swift │ │ │ └── Queue.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 │ │ ├── SynchronizedSubscribeType.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 │ │ ├── Error.swift │ │ ├── Filter.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 │ │ ├── ImmediateScheduler.swift │ │ ├── Internal │ │ │ ├── AnonymousInvocable.swift │ │ │ ├── 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 │ │ └── Variable.swift │ │ └── Traits │ │ ├── PrimitiveSequence+Zip+arity.swift │ │ └── PrimitiveSequence.swift └── Target Support Files │ ├── Alamofire │ ├── Alamofire-dummy.m │ ├── Alamofire-prefix.pch │ ├── Alamofire-umbrella.h │ ├── Alamofire.modulemap │ ├── Alamofire.xcconfig │ └── Info.plist │ ├── HandyJSON │ ├── HandyJSON-dummy.m │ ├── HandyJSON-prefix.pch │ ├── HandyJSON-umbrella.h │ ├── HandyJSON.modulemap │ ├── HandyJSON.xcconfig │ └── Info.plist │ ├── Moya │ ├── Info.plist │ ├── Moya-dummy.m │ ├── Moya-prefix.pch │ ├── Moya-umbrella.h │ ├── Moya.modulemap │ └── Moya.xcconfig │ ├── ObjectMapper │ ├── Info.plist │ ├── ObjectMapper-dummy.m │ ├── ObjectMapper-prefix.pch │ ├── ObjectMapper-umbrella.h │ ├── ObjectMapper.modulemap │ └── ObjectMapper.xcconfig │ ├── Pods-RxMoyaExample │ ├── Info.plist │ ├── Pods-RxMoyaExample-acknowledgements.markdown │ ├── Pods-RxMoyaExample-acknowledgements.plist │ ├── Pods-RxMoyaExample-dummy.m │ ├── Pods-RxMoyaExample-frameworks.sh │ ├── Pods-RxMoyaExample-resources.sh │ ├── Pods-RxMoyaExample-umbrella.h │ ├── Pods-RxMoyaExample.debug.xcconfig │ ├── Pods-RxMoyaExample.modulemap │ └── Pods-RxMoyaExample.release.xcconfig │ ├── Pods-RxMoyaExampleTests │ ├── Info.plist │ ├── Pods-RxMoyaExampleTests-acknowledgements.markdown │ ├── Pods-RxMoyaExampleTests-acknowledgements.plist │ ├── Pods-RxMoyaExampleTests-dummy.m │ ├── Pods-RxMoyaExampleTests-frameworks.sh │ ├── Pods-RxMoyaExampleTests-resources.sh │ ├── Pods-RxMoyaExampleTests-umbrella.h │ ├── Pods-RxMoyaExampleTests.debug.xcconfig │ ├── Pods-RxMoyaExampleTests.modulemap │ └── Pods-RxMoyaExampleTests.release.xcconfig │ ├── Pods-RxMoyaExampleUITests │ ├── Info.plist │ ├── Pods-RxMoyaExampleUITests-acknowledgements.markdown │ ├── Pods-RxMoyaExampleUITests-acknowledgements.plist │ ├── Pods-RxMoyaExampleUITests-dummy.m │ ├── Pods-RxMoyaExampleUITests-frameworks.sh │ ├── Pods-RxMoyaExampleUITests-resources.sh │ ├── Pods-RxMoyaExampleUITests-umbrella.h │ ├── Pods-RxMoyaExampleUITests.debug.xcconfig │ ├── Pods-RxMoyaExampleUITests.modulemap │ └── Pods-RxMoyaExampleUITests.release.xcconfig │ ├── Result │ ├── Info.plist │ ├── Result-dummy.m │ ├── Result-prefix.pch │ ├── Result-umbrella.h │ ├── Result.modulemap │ └── Result.xcconfig │ └── RxSwift │ ├── Info.plist │ ├── RxSwift-dummy.m │ ├── RxSwift-prefix.pch │ ├── RxSwift-umbrella.h │ ├── RxSwift.modulemap │ └── RxSwift.xcconfig ├── README.md ├── RxMoyaExample.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── RxMoyaExample.xcworkspace └── contents.xcworkspacedata ├── RxMoyaExample ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── Moya.swift ├── Router.swift ├── Rx HandyJSON.swift ├── RxMoyaMapper.swift ├── User.swift └── ViewController.swift ├── RxMoyaExampleTests ├── Info.plist └── RxMoyaExampleTests.swift └── RxMoyaExampleUITests ├── Info.plist └── RxMoyaExampleUITests.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cd5z/RxMoyaExample/bbda5386ac40598d23c690a90f8988aa54d45253/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | # Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | # Carthage/Checkouts 54 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | */.DS_Store 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 l 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'RxMoyaExample' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | pod 'Moya/RxSwift' 8 | pod 'ObjectMapper', '~> 2.2' 9 | pod 'HandyJSON', '~> 1.7.2' 10 | # Pods for RxMoyaExample 11 | 12 | target 'RxMoyaExampleTests' do 13 | inherit! :search_paths 14 | # Pods for testing 15 | end 16 | 17 | target 'RxMoyaExampleUITests' do 18 | inherit! :search_paths 19 | # Pods for testing 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.4.0) 3 | - HandyJSON (1.7.2) 4 | - Moya/Core (8.0.5): 5 | - Alamofire (~> 4.1) 6 | - Result (~> 3.0) 7 | - Moya/RxSwift (8.0.5): 8 | - Moya/Core 9 | - RxSwift (~> 3.0) 10 | - ObjectMapper (2.2.7) 11 | - Result (3.2.3) 12 | - RxSwift (3.5.0) 13 | 14 | DEPENDENCIES: 15 | - HandyJSON (~> 1.7.2) 16 | - Moya/RxSwift 17 | - ObjectMapper (~> 2.2) 18 | 19 | SPEC CHECKSUMS: 20 | Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d 21 | HandyJSON: e7ad0483005826baba1d1c251cd98d0aa8bd8cce 22 | Moya: c37eec09a098ba9991b5a963b291fc5704bdb9ef 23 | ObjectMapper: 65abcfd9a61cf7396cbd14a4fb22fddfcc46577e 24 | Result: 128640a6347e8d2ae48b142556739a2d13f90ce6 25 | RxSwift: 18ee9d78b45edb3b0b7e79916b47a116e6dbc842 26 | 27 | PODFILE CHECKSUM: 6e1941e82f770d7db6880dd8c6e8d61e72546309 28 | 29 | COCOAPODS: 1.2.1 30 | -------------------------------------------------------------------------------- /Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/DispatchQueue+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchQueue+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Dispatch 26 | import Foundation 27 | 28 | extension DispatchQueue { 29 | static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } 30 | static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } 31 | static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } 32 | static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } 33 | 34 | func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { 35 | asyncAfter(deadline: .now() + delay, execute: closure) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Pods/HandyJSON/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 1999-2016 Alibaba Group Holding Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/Configuration.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2101 Alibaba Group. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Configuration.swift 19 | // HandyJSON 20 | // 21 | // Created by zhouzhuo on 08/01/2017. 22 | // 23 | 24 | public struct DeserializeOptions: OptionSet { 25 | public let rawValue: Int 26 | 27 | public static let caseInsensitive = DeserializeOptions(rawValue: 1 << 0) 28 | 29 | public static let defaultOptions: DeserializeOptions = [] 30 | 31 | public init(rawValue: Int) { 32 | self.rawValue = rawValue 33 | } 34 | } 35 | 36 | public enum DebugMode: Int { 37 | case verbose = 0 38 | case debug = 1 39 | case error = 2 40 | case none = 3 41 | } 42 | 43 | public struct HandyJSONConfiguration { 44 | 45 | private static var _mode = DebugMode.error 46 | public static var debugMode: DebugMode { 47 | get { 48 | return _mode 49 | } 50 | set { 51 | _mode = newValue 52 | } 53 | } 54 | 55 | public static var deserializeOptions: DeserializeOptions = .defaultOptions 56 | } 57 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/CustomDateFormatTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomDateFormatTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Dan McCracken on 3/8/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class CustomDateFormatTransform: DateFormatterTransform { 32 | 33 | public init(formatString: String) { 34 | let formatter = DateFormatter() 35 | formatter.locale = Locale(identifier: "en_US_POSIX") 36 | formatter.dateFormat = formatString 37 | 38 | super.init(dateFormatter: formatter) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/DataTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DataTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Yagrushkin, Evgeny on 8/30/16. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class DataTransform: TransformType { 32 | public typealias Object = Data 33 | public typealias JSON = String 34 | 35 | public init() {} 36 | 37 | open func transformFromJSON(_ value: Any?) -> Data? { 38 | guard let string = value as? String else{ 39 | return nil 40 | } 41 | return Data(base64Encoded: string) 42 | } 43 | 44 | open func transformToJSON(_ value: Data?) -> String? { 45 | guard let data = value else{ 46 | return nil 47 | } 48 | return data.base64EncodedString() 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/DateFormatterTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DateFormatterTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Tristan Himmelman on 2015-03-09. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class DateFormatterTransform: TransformType { 32 | public typealias Object = Date 33 | public typealias JSON = String 34 | 35 | public let dateFormatter: DateFormatter 36 | 37 | public init(dateFormatter: DateFormatter) { 38 | self.dateFormatter = dateFormatter 39 | } 40 | 41 | open func transformFromJSON(_ value: Any?) -> Date? { 42 | if let dateString = value as? String { 43 | return dateFormatter.date(from: dateString) 44 | } 45 | return nil 46 | } 47 | 48 | open func transformToJSON(_ value: Date?) -> String? { 49 | if let date = value { 50 | return dateFormatter.string(from: date) 51 | } 52 | return nil 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/DateTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DateTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Tristan Himmelman on 2014-10-13. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class DateTransform: TransformType { 32 | public typealias Object = Date 33 | public typealias JSON = Double 34 | 35 | public init() {} 36 | 37 | open func transformFromJSON(_ value: Any?) -> Date? { 38 | if let timeInt = value as? Double { 39 | return Date(timeIntervalSince1970: TimeInterval(timeInt)) 40 | } 41 | 42 | if let timeStr = value as? String { 43 | return Date(timeIntervalSince1970: TimeInterval(atof(timeStr))) 44 | } 45 | 46 | return nil 47 | } 48 | 49 | open func transformToJSON(_ value: Date?) -> Double? { 50 | if let date = value { 51 | return Double(date.timeIntervalSince1970) 52 | } 53 | return nil 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/EnumTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EnumTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Kaan Dedeoglu on 3/20/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class EnumTransform: TransformType { 32 | public typealias Object = T 33 | public typealias JSON = T.RawValue 34 | 35 | public init() {} 36 | 37 | open func transformFromJSON(_ value: Any?) -> T? { 38 | if let raw = value as? T.RawValue { 39 | return T(rawValue: raw) 40 | } 41 | return nil 42 | } 43 | 44 | open func transformToJSON(_ value: T?) -> T.RawValue? { 45 | if let obj = value { 46 | return obj.rawValue 47 | } 48 | return nil 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/HandyJSON.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2101 Alibaba Group. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Created by zhouzhuo on 7/11/16. 18 | // 19 | 20 | @import Foundation; 21 | 22 | //! Project version number for HandyJSON. 23 | FOUNDATION_EXPORT double HandyJSONVersionNumber; 24 | 25 | //! Project version string for HandyJSON. 26 | FOUNDATION_EXPORT const unsigned char HandyJSONVersionString[]; 27 | 28 | // In this header, you should import all the public headers of your framework using statements like #import 29 | 30 | 31 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/ISO8601DateTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ISO8601DateTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Jean-Pierre Mouilleseaux on 21 Nov 2014. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class ISO8601DateTransform: DateFormatterTransform { 32 | 33 | public init() { 34 | let formatter = DateFormatter() 35 | formatter.locale = Locale(identifier: "en_US_POSIX") 36 | formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" 37 | 38 | super.init(dateFormatter: formatter) 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/Logger.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2101 Alibaba Group. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Logger.swift 19 | // HandyJSON 20 | // 21 | // Created by zhouzhuo on 08/01/2017. 22 | // 23 | 24 | struct InternalLogger { 25 | 26 | static func logError(_ items: Any..., separator: String = " ", terminator: String = "\n") { 27 | if HandyJSONConfiguration.debugMode.rawValue <= DebugMode.error.rawValue { 28 | print(items, separator: separator, terminator: terminator) 29 | } 30 | } 31 | 32 | static func logDebug(_ items: Any..., separator: String = " ", terminator: String = "\n") { 33 | if HandyJSONConfiguration.debugMode.rawValue <= DebugMode.debug.rawValue { 34 | print(items, separator: separator, terminator: terminator) 35 | } 36 | } 37 | 38 | static func logVerbose(_ items: Any..., separator: String = " ", terminator: String = "\n") { 39 | if HandyJSONConfiguration.debugMode.rawValue <= DebugMode.verbose.rawValue { 40 | print(items, separator: separator, terminator: terminator) 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/NSDecimalNumberTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransformOf.swift 3 | // ObjectMapper 4 | // 5 | // Created by Tristan Himmelman on 8/22/16. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class NSDecimalNumberTransform: TransformType { 32 | public typealias Object = NSDecimalNumber 33 | public typealias JSON = String 34 | 35 | public init() {} 36 | 37 | open func transformFromJSON(_ value: Any?) -> NSDecimalNumber? { 38 | if let string = value as? String { 39 | return NSDecimalNumber(string: string) 40 | } 41 | if let double = value as? Double { 42 | return NSDecimalNumber(value: double) 43 | } 44 | return nil 45 | } 46 | 47 | open func transformToJSON(_ value: NSDecimalNumber?) -> String? { 48 | guard let value = value else { return nil } 49 | return value.description 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/OtherExtension.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2101 Alibaba Group. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // OtherExtension.swift 19 | // HandyJSON 20 | // 21 | // Created by zhouzhuo on 08/01/2017. 22 | // 23 | 24 | protocol UTF8Initializable { 25 | init?(validatingUTF8: UnsafePointer) 26 | } 27 | 28 | extension String : UTF8Initializable {} 29 | 30 | extension Array where Element : UTF8Initializable { 31 | 32 | init(utf8Strings: UnsafePointer) { 33 | var strings = [Element]() 34 | var pointer = utf8Strings 35 | while let string = Element(validatingUTF8: pointer) { 36 | strings.append(string) 37 | while pointer.pointee != 0 { 38 | pointer.advance() 39 | } 40 | pointer.advance() 41 | guard pointer.pointee != 0 else { 42 | break 43 | } 44 | } 45 | self = strings 46 | } 47 | } 48 | 49 | extension Strideable { 50 | mutating func advance() { 51 | self = advanced(by: 1) 52 | } 53 | } 54 | 55 | extension UnsafePointer { 56 | 57 | init(_ pointer: UnsafePointer) { 58 | self = UnsafeRawPointer(pointer).assumingMemoryBound(to: Pointee.self) 59 | } 60 | } 61 | 62 | func relativePointer(base: UnsafePointer, offset: U) -> UnsafePointer where U : Integer { 63 | return UnsafeRawPointer(base).advanced(by: Int(integer: offset)).assumingMemoryBound(to: V.self) 64 | } 65 | 66 | extension Int { 67 | fileprivate init(integer: T) { 68 | switch integer { 69 | case let value as Int: self = value 70 | case let value as Int32: self = Int(value) 71 | case let value as Int16: self = Int(value) 72 | case let value as Int8: self = Int(value) 73 | default: self = 0 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/PointerType.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2101 Alibaba Group. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Created by zhouzhuo on 07/01/2017. 19 | // 20 | 21 | protocol PointerType : Equatable { 22 | associatedtype Pointee 23 | var pointer: UnsafePointer { get set } 24 | } 25 | 26 | extension PointerType { 27 | init(pointer: UnsafePointer) { 28 | func cast(_ value: T) -> U { 29 | return unsafeBitCast(value, to: U.self) 30 | } 31 | self = cast(UnsafePointer(pointer)) 32 | } 33 | } 34 | 35 | func == (lhs: T, rhs: T) -> Bool { 36 | return lhs.pointer == rhs.pointer 37 | } 38 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/ReflectionHelper.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2101 Alibaba Group. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Helper.swift 19 | // HandyJSON 20 | // 21 | // Created by zhouzhuo on 07/01/2017. 22 | // 23 | 24 | struct ReflectionHelper { 25 | 26 | static func mutableStorage(instance: inout T) -> UnsafeMutableRawPointer { 27 | return UnsafeMutableRawPointer(mutating: storage(instance: &instance)) 28 | } 29 | 30 | static func storage(instance: inout T) -> UnsafeRawPointer { 31 | if type(of: instance) is AnyClass { 32 | let opaquePointer = Unmanaged.passUnretained(instance as AnyObject).toOpaque() 33 | return UnsafeRawPointer(opaquePointer) 34 | } else { 35 | return withUnsafePointer(to: &instance) { pointer in 36 | return UnsafeRawPointer(pointer) 37 | } 38 | } 39 | } 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/TransformOf.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransformOf.swift 3 | // ObjectMapper 4 | // 5 | // Created by Syo Ikeda on 1/23/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | open class TransformOf: TransformType { 30 | public typealias Object = ObjectType 31 | public typealias JSON = JSONType 32 | 33 | private let fromJSON: (JSONType?) -> ObjectType? 34 | private let toJSON: (ObjectType?) -> JSONType? 35 | 36 | public init(fromJSON: @escaping(JSONType?) -> ObjectType?, toJSON: @escaping(ObjectType?) -> JSONType?) { 37 | self.fromJSON = fromJSON 38 | self.toJSON = toJSON 39 | } 40 | 41 | open func transformFromJSON(_ value: Any?) -> ObjectType? { 42 | return fromJSON(value as? JSONType) 43 | } 44 | 45 | open func transformToJSON(_ value: ObjectType?) -> JSONType? { 46 | return toJSON(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/TransformType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransformType.swift 3 | // ObjectMapper 4 | // 5 | // Created by Syo Ikeda on 2/4/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | public protocol TransformType { 30 | associatedtype Object 31 | associatedtype JSON 32 | 33 | func transformFromJSON(_ value: Any?) -> Object? 34 | func transformToJSON(_ value: Object?) -> JSON? 35 | } 36 | -------------------------------------------------------------------------------- /Pods/HandyJSON/Source/URLTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Tristan Himmelman on 2014-10-27. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class URLTransform: TransformType { 32 | public typealias Object = URL 33 | public typealias JSON = String 34 | private let shouldEncodeURLString: Bool 35 | 36 | /** 37 | Initializes the URLTransform with an option to encode URL strings before converting them to an NSURL 38 | - parameter shouldEncodeUrlString: when true (the default) the string is encoded before passing 39 | to `NSURL(string:)` 40 | - returns: an initialized transformer 41 | */ 42 | public init(shouldEncodeURLString: Bool = true) { 43 | self.shouldEncodeURLString = shouldEncodeURLString 44 | } 45 | 46 | open func transformFromJSON(_ value: Any?) -> URL? { 47 | guard let URLString = value as? String else { return nil } 48 | 49 | if !shouldEncodeURLString { 50 | return URL(string: URLString) 51 | } 52 | 53 | guard let escapedURLString = URLString.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed) else { 54 | return nil 55 | } 56 | return URL(string: escapedURLString) 57 | } 58 | 59 | open func transformToJSON(_ value: URL?) -> String? { 60 | if let URL = value { 61 | return URL.absoluteString 62 | } 63 | return nil 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.4.0) 3 | - HandyJSON (1.7.2) 4 | - Moya/Core (8.0.5): 5 | - Alamofire (~> 4.1) 6 | - Result (~> 3.0) 7 | - Moya/RxSwift (8.0.5): 8 | - Moya/Core 9 | - RxSwift (~> 3.0) 10 | - ObjectMapper (2.2.7) 11 | - Result (3.2.3) 12 | - RxSwift (3.5.0) 13 | 14 | DEPENDENCIES: 15 | - HandyJSON (~> 1.7.2) 16 | - Moya/RxSwift 17 | - ObjectMapper (~> 2.2) 18 | 19 | SPEC CHECKSUMS: 20 | Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d 21 | HandyJSON: e7ad0483005826baba1d1c251cd98d0aa8bd8cce 22 | Moya: c37eec09a098ba9991b5a963b291fc5704bdb9ef 23 | ObjectMapper: 65abcfd9a61cf7396cbd14a4fb22fddfcc46577e 24 | Result: 128640a6347e8d2ae48b142556739a2d13f90ce6 25 | RxSwift: 18ee9d78b45edb3b0b7e79916b47a116e6dbc842 26 | 27 | PODFILE CHECKSUM: 6e1941e82f770d7db6880dd8c6e8d61e72546309 28 | 29 | COCOAPODS: 1.2.1 30 | -------------------------------------------------------------------------------- /Pods/Moya/License.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Artsy, Ash Furrow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/Cancellable.swift: -------------------------------------------------------------------------------- 1 | /// Protocol to define the opaque type returned from a request 2 | public protocol Cancellable { 3 | var isCancelled: Bool { get } 4 | func cancel() 5 | } 6 | 7 | internal class CancellableWrapper: Cancellable { 8 | internal var innerCancellable: Cancellable = SimpleCancellable() 9 | 10 | var isCancelled: Bool { return innerCancellable.isCancelled } 11 | 12 | internal func cancel() { 13 | innerCancellable.cancel() 14 | } 15 | } 16 | 17 | internal class SimpleCancellable: Cancellable { 18 | var isCancelled = false 19 | func cancel() { 20 | isCancelled = true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/Image.swift: -------------------------------------------------------------------------------- 1 | #if os(iOS) || os(watchOS) || os(tvOS) 2 | import UIKit.UIImage 3 | public typealias ImageType = UIImage 4 | #elseif os(OSX) 5 | import AppKit.NSImage 6 | public typealias ImageType = NSImage 7 | #endif 8 | 9 | /// An alias for the SDK's image type. 10 | public typealias Image = ImageType 11 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/MoyaAvailability.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Result 3 | 4 | @available(*, unavailable, renamed: "MoyaError", message: "Moya.Error has been renamed to MoyaError in version 8.0.0") 5 | public typealias Error = MoyaError 6 | 7 | extension Endpoint { 8 | @available(*, unavailable, renamed: "adding(newParameters:)") 9 | public func endpointByAddingParameters(parameters: [String: AnyObject]) -> Endpoint { fatalError() } 10 | 11 | @available(*, unavailable, renamed: "adding(newHTTPHeaderFields:)") 12 | public func endpointByAddingHTTPHeaderFields(httpHeaderFields: [String: String]) -> Endpoint { fatalError() } 13 | 14 | @available(*, unavailable, renamed: "adding(newParameterEncoding:)") 15 | public func endpointByAddingParameterEncoding(newParameterEncoding: Moya.ParameterEncoding) -> Endpoint { fatalError() } 16 | 17 | @available(*, unavailable, renamed: "adding(parameters:httpHeaderFields:parameterEncoding:)") 18 | public func endpointByAdding(parameters: [String: AnyObject]? = nil, httpHeaderFields: [String: String]? = nil, parameterEncoding: Moya.ParameterEncoding? = nil) -> Endpoint { fatalError() } 19 | } 20 | 21 | @available(*, unavailable, renamed: "MultiTarget", message: "StructTarget has been renamed to MultiTarget in version 8.0.0") 22 | enum StructTarget { } 23 | 24 | extension MoyaProvider { 25 | @available(*, unavailable, renamed: "notifyPluginsOfImpendingStub(for:target:)") 26 | internal final func notifyPluginsOfImpendingStub(request: URLRequest, target: Target) { fatalError() } 27 | } 28 | 29 | extension Response { 30 | @available(*, unavailable, renamed: "filter(statusCodes:)") 31 | public func filterStatusCodes(range: ClosedRange) throws -> Response { fatalError() } 32 | 33 | @available(*, unavailable, renamed: "filter(statusCode:)") 34 | public func filterStatusCode(code: Int) throws -> Response { fatalError() } 35 | } 36 | 37 | extension PluginType { 38 | @available(*, unavailable, renamed: "willSend(_:)") 39 | func willSendRequest(request: RequestType, target: TargetType) { fatalError() } 40 | 41 | @available(*, unavailable, renamed: "didReceive(_:)") 42 | func didReceiveResponse(result: Result, target: TargetType) { fatalError() } 43 | } 44 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/MoyaError.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum MoyaError: Swift.Error { 4 | 5 | /// Indicates a response failed to map to an image. 6 | case imageMapping(Response) 7 | 8 | /// Indicates a response failed to map to a JSON structure. 9 | case jsonMapping(Response) 10 | 11 | /// Indicates a response failed to map to a String. 12 | case stringMapping(Response) 13 | 14 | /// Indicates a response failed with an invalid HTTP status code. 15 | case statusCode(Response) 16 | 17 | /// Indicates a response failed due to an underlying `Error`. 18 | case underlying(Swift.Error) 19 | 20 | /// Indicates that an `Endpoint` failed to map to a `URLRequest`. 21 | case requestMapping(String) 22 | } 23 | 24 | public extension MoyaError { 25 | /// Depending on error type, returns a `Response` object. 26 | var response: Moya.Response? { 27 | switch self { 28 | case .imageMapping(let response): return response 29 | case .jsonMapping(let response): return response 30 | case .stringMapping(let response): return response 31 | case .statusCode(let response): return response 32 | case .underlying: return nil 33 | case .requestMapping: return nil 34 | } 35 | } 36 | } 37 | 38 | // MARK: - Error Descriptions 39 | 40 | extension MoyaError: LocalizedError { 41 | public var errorDescription: String? { 42 | switch self { 43 | case .imageMapping: 44 | return "Failed to map data to an Image." 45 | case .jsonMapping: 46 | return "Failed to map data to JSON." 47 | case .stringMapping: 48 | return "Failed to map data to a String." 49 | case .statusCode: 50 | return "Status code didn't fall within the given range." 51 | case .requestMapping: 52 | return "Failed to map Endpoint to a URLRequest." 53 | case .underlying(let error): 54 | return error.localizedDescription 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/MoyaProvider+Defaults.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Alamofire 3 | 4 | /// These functions are default mappings to `MoyaProvider`'s properties: endpoints, requests, manager, etc. 5 | public extension MoyaProvider { 6 | public final class func defaultEndpointMapping(for target: Target) -> Endpoint { 7 | return Endpoint( 8 | url: url(for: target).absoluteString, 9 | sampleResponseClosure: { .networkResponse(200, target.sampleData) }, 10 | method: target.method, 11 | parameters: target.parameters, 12 | parameterEncoding: target.parameterEncoding 13 | ) 14 | } 15 | 16 | public final class func defaultRequestMapping(for endpoint: Endpoint, closure: RequestResultClosure) { 17 | if let urlRequest = endpoint.urlRequest { 18 | closure(.success(urlRequest)) 19 | } else { 20 | closure(.failure(MoyaError.requestMapping(endpoint.url))) 21 | } 22 | } 23 | 24 | public final class func defaultAlamofireManager() -> Manager { 25 | let configuration = URLSessionConfiguration.default 26 | configuration.httpAdditionalHeaders = Manager.defaultHTTPHeaders 27 | 28 | let manager = Manager(configuration: configuration) 29 | manager.startRequestsImmediately = false 30 | return manager 31 | } 32 | 33 | // When a TargetType's path is empty, URL.appendingPathComponent may introduce trailing /, which may not be wanted in some cases 34 | // See: https://github.com/Moya/Moya/pull/1053 35 | // And: https://github.com/Moya/Moya/issues/1049 36 | private final class func url(for target: Target) -> URL { 37 | if target.path.isEmpty { 38 | return target.baseURL 39 | } 40 | 41 | return target.baseURL.appendingPathComponent(target.path) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/MultiTarget.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A `TargetType` used to enable `MoyaProvider` to process multiple `TargetType`s. 4 | public enum MultiTarget: TargetType { 5 | /// The embedded `TargetType`. 6 | case target(TargetType) 7 | 8 | public init(_ target: TargetType) { 9 | self = MultiTarget.target(target) 10 | } 11 | 12 | public var path: String { 13 | return target.path 14 | } 15 | 16 | public var baseURL: URL { 17 | return target.baseURL 18 | } 19 | 20 | public var method: Moya.Method { 21 | return target.method 22 | } 23 | 24 | public var parameters: [String: Any]? { 25 | return target.parameters 26 | } 27 | 28 | public var parameterEncoding: ParameterEncoding { 29 | return target.parameterEncoding 30 | } 31 | 32 | public var sampleData: Data { 33 | return target.sampleData 34 | } 35 | 36 | public var task: Task { 37 | return target.task 38 | } 39 | 40 | public var validate: Bool { 41 | return target.validate 42 | } 43 | 44 | /// The embedded `TargetType`. 45 | public var target: TargetType { 46 | switch self { 47 | case .target(let t): return t 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/MultipartFormData.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Represents "multipart/form-data" for an upload. 4 | public struct MultipartFormData { 5 | 6 | /// Method to provide the form data. 7 | public enum FormDataProvider { 8 | case data(Foundation.Data) 9 | case file(URL) 10 | case stream(InputStream, UInt64) 11 | } 12 | 13 | /// Initialize a new `MultipartFormData`. 14 | public init(provider: FormDataProvider, name: String, fileName: String? = nil, mimeType: String? = nil) { 15 | self.provider = provider 16 | self.name = name 17 | self.fileName = fileName 18 | self.mimeType = mimeType 19 | } 20 | 21 | /// The method being used for providing form data. 22 | public let provider: FormDataProvider 23 | 24 | /// The name. 25 | public let name: String 26 | 27 | /// The file name. 28 | public let fileName: String? 29 | 30 | /// The MIME type 31 | public let mimeType: String? 32 | } 33 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/Plugin.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Result 3 | 4 | /// A Moya Plugin receives callbacks to perform side effects wherever a request is sent or received. 5 | /// 6 | /// for example, a plugin may be used to 7 | /// - log network requests 8 | /// - hide and show a network activity indicator 9 | /// - inject additional information into a request 10 | public protocol PluginType { 11 | /// Called to modify a request before sending 12 | func prepare(_ request: URLRequest, target: TargetType) -> URLRequest 13 | 14 | /// Called immediately before a request is sent over the network (or stubbed). 15 | func willSend(_ request: RequestType, target: TargetType) 16 | 17 | /// Called after a response has been received, but before the MoyaProvider has invoked its completion handler. 18 | func didReceive(_ result: Result, target: TargetType) 19 | 20 | /// Called to modify a result before completion 21 | func process(_ result: Result, target: TargetType) -> Result 22 | } 23 | 24 | public extension PluginType { 25 | func prepare(_ request: URLRequest, target: TargetType) -> URLRequest { return request } 26 | func willSend(_ request: RequestType, target: TargetType) { } 27 | func didReceive(_ result: Result, target: TargetType) { } 28 | func process(_ result: Result, target: TargetType) -> Result { return result } 29 | } 30 | 31 | /// Request type used by `willSend` plugin function. 32 | public protocol RequestType { 33 | 34 | // Note: 35 | // 36 | // We use this protocol instead of the Alamofire request to avoid leaking that abstraction. 37 | // A plugin should not know about Alamofire at all. 38 | 39 | /// Retrieve an `NSURLRequest` representation. 40 | var request: URLRequest? { get } 41 | 42 | /// Authenticates the request with a username and password. 43 | func authenticate(user: String, password: String, persistence: URLCredential.Persistence) -> Self 44 | 45 | /// Authenticates the request with an `NSURLCredential` instance. 46 | func authenticate(usingCredential credential: URLCredential) -> Self 47 | } 48 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/Plugins/AccessTokenPlugin.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Result 3 | 4 | // MARK: - AccessTokenAuthorizable 5 | 6 | /// A protocol for controlling the behavior of `AccessTokenPlugin`. 7 | public protocol AccessTokenAuthorizable { 8 | 9 | /// Declares whether or not `AccessTokenPlugin` should add an authorization header 10 | /// to requests. 11 | var shouldAuthorize: Bool { get } 12 | } 13 | 14 | // MARK: - AccessTokenPlugin 15 | 16 | /** 17 | A plugin for adding bearer-type authorization headers to requests. Example: 18 | 19 | ``` 20 | Authorization: Bearer 21 | ``` 22 | 23 | - Note: By default, requests to all `TargetType`s will receive this header. You can control this 24 | behvaior by conforming to `AccessTokenAuthorizable`. 25 | */ 26 | public struct AccessTokenPlugin: PluginType { 27 | 28 | /// The access token to be applied in the header. 29 | public let token: String 30 | 31 | private var authVal: String { 32 | return "Bearer " + token 33 | } 34 | 35 | /** 36 | Initialize a new `AccessTokenPlugin`. 37 | 38 | - parameters: 39 | - token: The token to be applied in the pattern `Authorization: Bearer ` 40 | */ 41 | public init(token: String) { 42 | self.token = token 43 | } 44 | 45 | /** 46 | Prepare a request by adding an authorization header if necessary. 47 | 48 | - parameters: 49 | - request: The request to modify. 50 | - target: The target of the request. 51 | - returns: The modified `URLRequest`. 52 | */ 53 | public func prepare(_ request: URLRequest, target: TargetType) -> URLRequest { 54 | if let authorizable = target as? AccessTokenAuthorizable, authorizable.shouldAuthorize == false { 55 | return request 56 | } 57 | 58 | var request = request 59 | request.addValue(authVal, forHTTPHeaderField: "Authorization") 60 | 61 | return request 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/Plugins/CredentialsPlugin.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Result 3 | 4 | /// Provides each request with optional URLCredentials. 5 | public final class CredentialsPlugin: PluginType { 6 | 7 | public typealias CredentialClosure = (TargetType) -> URLCredential? 8 | let credentialsClosure: CredentialClosure 9 | 10 | public init(credentialsClosure: @escaping CredentialClosure) { 11 | self.credentialsClosure = credentialsClosure 12 | } 13 | 14 | // MARK: Plugin 15 | 16 | public func willSend(_ request: RequestType, target: TargetType) { 17 | if let credentials = credentialsClosure(target) { 18 | _ = request.authenticate(usingCredential: credentials) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/Plugins/NetworkActivityPlugin.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Result 3 | 4 | /// Network activity change notification type. 5 | public enum NetworkActivityChangeType { 6 | case began, ended 7 | } 8 | 9 | /// Notify a request's network activity changes (request begins or ends). 10 | public final class NetworkActivityPlugin: PluginType { 11 | 12 | public typealias NetworkActivityClosure = (_ change: NetworkActivityChangeType) -> Void 13 | let networkActivityClosure: NetworkActivityClosure 14 | 15 | public init(networkActivityClosure: @escaping NetworkActivityClosure) { 16 | self.networkActivityClosure = networkActivityClosure 17 | } 18 | 19 | // MARK: Plugin 20 | 21 | /// Called by the provider as soon as the request is about to start 22 | public func willSend(_ request: RequestType, target: TargetType) { 23 | networkActivityClosure(.began) 24 | } 25 | 26 | /// Called by the provider as soon as a response arrives, even if the request is canceled. 27 | public func didReceive(_ result: Result, target: TargetType) { 28 | networkActivityClosure(.ended) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Pods/Moya/Sources/Moya/TargetType.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Alamofire 3 | 4 | /// The protocol used to define the specifications necessary for a `MoyaProvider`. 5 | public protocol TargetType { 6 | 7 | /// The target's base `URL`. 8 | var baseURL: URL { get } 9 | 10 | /// The path to be appended to `baseURL` to form the full `URL`. 11 | var path: String { get } 12 | 13 | /// The HTTP method used in the request. 14 | var method: Moya.Method { get } 15 | 16 | /// The parameters to be encoded in the request. 17 | var parameters: [String: Any]? { get } 18 | 19 | /// The method used for parameter encoding. 20 | var parameterEncoding: ParameterEncoding { get } 21 | 22 | /// Provides stub data for use in testing. 23 | var sampleData: Data { get } 24 | 25 | /// The type of HTTP task to be performed. 26 | var task: Task { get } 27 | 28 | /// Whether or not to perform Alamofire validation. Defaults to `false`. 29 | var validate: Bool { get } 30 | } 31 | 32 | public extension TargetType { 33 | var validate: Bool { 34 | return false 35 | } 36 | } 37 | 38 | /// Represents a type of upload task. 39 | public enum UploadType { 40 | 41 | /// Upload a file. 42 | case file(URL) 43 | 44 | /// Upload "multipart/form-data" 45 | case multipart([MultipartFormData]) 46 | } 47 | 48 | /// Represents a type of download task. 49 | public enum DownloadType { 50 | 51 | /// Download a file to a destination. 52 | case request(DownloadDestination) 53 | } 54 | 55 | /// Represents an HTTP task. 56 | public enum Task { 57 | 58 | /// A basic request task. 59 | case request 60 | 61 | /// An upload task. 62 | case upload(UploadType) 63 | 64 | /// A download task. 65 | case download(DownloadType) 66 | } 67 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2014 Hearst 3 | 4 | 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: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | 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. 9 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/CustomDateFormatTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomDateFormatTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Dan McCracken on 3/8/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class CustomDateFormatTransform: DateFormatterTransform { 32 | 33 | public init(formatString: String) { 34 | let formatter = DateFormatter() 35 | formatter.locale = Locale(identifier: "en_US_POSIX") 36 | formatter.dateFormat = formatString 37 | 38 | super.init(dateFormatter: formatter) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/DataTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DataTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Yagrushkin, Evgeny on 8/30/16. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class DataTransform: TransformType { 32 | public typealias Object = Data 33 | public typealias JSON = String 34 | 35 | public init() {} 36 | 37 | open func transformFromJSON(_ value: Any?) -> Data? { 38 | guard let string = value as? String else{ 39 | return nil 40 | } 41 | return Data(base64Encoded: string) 42 | } 43 | 44 | open func transformToJSON(_ value: Data?) -> String? { 45 | guard let data = value else{ 46 | return nil 47 | } 48 | return data.base64EncodedString() 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/DateFormatterTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DateFormatterTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Tristan Himmelman on 2015-03-09. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class DateFormatterTransform: TransformType { 32 | public typealias Object = Date 33 | public typealias JSON = String 34 | 35 | public let dateFormatter: DateFormatter 36 | 37 | public init(dateFormatter: DateFormatter) { 38 | self.dateFormatter = dateFormatter 39 | } 40 | 41 | open func transformFromJSON(_ value: Any?) -> Date? { 42 | if let dateString = value as? String { 43 | return dateFormatter.date(from: dateString) 44 | } 45 | return nil 46 | } 47 | 48 | open func transformToJSON(_ value: Date?) -> String? { 49 | if let date = value { 50 | return dateFormatter.string(from: date) 51 | } 52 | return nil 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/DateTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DateTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Tristan Himmelman on 2014-10-13. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class DateTransform: TransformType { 32 | public typealias Object = Date 33 | public typealias JSON = Double 34 | 35 | public init() {} 36 | 37 | open func transformFromJSON(_ value: Any?) -> Date? { 38 | if let timeInt = value as? Double { 39 | return Date(timeIntervalSince1970: TimeInterval(timeInt)) 40 | } 41 | 42 | if let timeStr = value as? String { 43 | return Date(timeIntervalSince1970: TimeInterval(atof(timeStr))) 44 | } 45 | 46 | return nil 47 | } 48 | 49 | open func transformToJSON(_ value: Date?) -> Double? { 50 | if let date = value { 51 | return Double(date.timeIntervalSince1970) 52 | } 53 | return nil 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/DictionaryTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DictionaryTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Milen Halachev on 7/20/16. 6 | // Copyright © 2016 hearst. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | ///Transforms [String: AnyObject] <-> [Key: Value] where Key is RawRepresentable as String, Value is Mappable 12 | public struct DictionaryTransform: TransformType where Key: Hashable, Key: RawRepresentable, Key.RawValue == String, Value: Mappable { 13 | 14 | public init() { 15 | 16 | } 17 | 18 | public func transformFromJSON(_ value: Any?) -> [Key: Value]? { 19 | 20 | guard let json = value as? [String: Any] else { 21 | 22 | return nil 23 | } 24 | 25 | let result = json.reduce([:]) { (result, element) -> [Key: Value] in 26 | 27 | guard 28 | let key = Key(rawValue: element.0), 29 | let valueJSON = element.1 as? [String: Any], 30 | let value = Value(JSON: valueJSON) 31 | else { 32 | 33 | return result 34 | } 35 | 36 | var result = result 37 | result[key] = value 38 | return result 39 | } 40 | 41 | return result 42 | } 43 | 44 | public func transformToJSON(_ value: [Key: Value]?) -> Any? { 45 | 46 | let result = value?.reduce([:]) { (result, element) -> [String: Any] in 47 | 48 | let key = element.0.rawValue 49 | let value = element.1.toJSON() 50 | 51 | var result = result 52 | result[key] = value 53 | return result 54 | } 55 | 56 | return result 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/EnumTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EnumTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Kaan Dedeoglu on 3/20/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class EnumTransform: TransformType { 32 | public typealias Object = T 33 | public typealias JSON = T.RawValue 34 | 35 | public init() {} 36 | 37 | open func transformFromJSON(_ value: Any?) -> T? { 38 | if let raw = value as? T.RawValue { 39 | return T(rawValue: raw) 40 | } 41 | return nil 42 | } 43 | 44 | open func transformToJSON(_ value: T?) -> T.RawValue? { 45 | if let obj = value { 46 | return obj.rawValue 47 | } 48 | return nil 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/ISO8601DateTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ISO8601DateTransform.swift 3 | // ObjectMapper 4 | // 5 | // Created by Jean-Pierre Mouilleseaux on 21 Nov 2014. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class ISO8601DateTransform: DateFormatterTransform { 32 | 33 | public init() { 34 | let formatter = DateFormatter() 35 | formatter.locale = Locale(identifier: "en_US_POSIX") 36 | formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" 37 | 38 | super.init(dateFormatter: formatter) 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/NSDecimalNumberTransform.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransformOf.swift 3 | // ObjectMapper 4 | // 5 | // Created by Tristan Himmelman on 8/22/16. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | import Foundation 30 | 31 | open class NSDecimalNumberTransform: TransformType { 32 | public typealias Object = NSDecimalNumber 33 | public typealias JSON = String 34 | 35 | public init() {} 36 | 37 | open func transformFromJSON(_ value: Any?) -> NSDecimalNumber? { 38 | if let string = value as? String { 39 | return NSDecimalNumber(string: string) 40 | } else if let number = value as? NSNumber { 41 | return NSDecimalNumber(decimal: number.decimalValue) 42 | } else if let double = value as? Double { 43 | return NSDecimalNumber(floatLiteral: double) 44 | } 45 | return nil 46 | } 47 | 48 | open func transformToJSON(_ value: NSDecimalNumber?) -> String? { 49 | guard let value = value else { return nil } 50 | return value.description 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/TransformOf.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransformOf.swift 3 | // ObjectMapper 4 | // 5 | // Created by Syo Ikeda on 1/23/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | open class TransformOf: TransformType { 30 | public typealias Object = ObjectType 31 | public typealias JSON = JSONType 32 | 33 | private let fromJSON: (JSONType?) -> ObjectType? 34 | private let toJSON: (ObjectType?) -> JSONType? 35 | 36 | public init(fromJSON: @escaping(JSONType?) -> ObjectType?, toJSON: @escaping(ObjectType?) -> JSONType?) { 37 | self.fromJSON = fromJSON 38 | self.toJSON = toJSON 39 | } 40 | 41 | open func transformFromJSON(_ value: Any?) -> ObjectType? { 42 | return fromJSON(value as? JSONType) 43 | } 44 | 45 | open func transformToJSON(_ value: ObjectType?) -> JSONType? { 46 | return toJSON(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/Sources/TransformType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransformType.swift 3 | // ObjectMapper 4 | // 5 | // Created by Syo Ikeda on 2/4/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2014-2016 Hearst 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | public protocol TransformType { 30 | associatedtype Object 31 | associatedtype JSON 32 | 33 | func transformFromJSON(_ value: Any?) -> Object? 34 | func transformToJSON(_ value: Object?) -> JSON? 35 | } 36 | -------------------------------------------------------------------------------- /Pods/Result/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Rob Rix 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /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/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/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 func Foundation.OSAtomicCompareAndSwap32Barrier 14 | import func Foundation.OSAtomicIncrement32Barrier 15 | import func Foundation.OSAtomicDecrement32Barrier 16 | import protocol Foundation.NSCopying 17 | 18 | typealias AtomicInt = Int32 19 | 20 | fileprivate func castToUInt32Pointer(_ pointer: UnsafeMutablePointer) -> UnsafeMutablePointer { 21 | let raw = UnsafeMutableRawPointer(pointer) 22 | return raw.assumingMemoryBound(to: UInt32.self) 23 | } 24 | 25 | let AtomicCompareAndSwap = OSAtomicCompareAndSwap32Barrier 26 | let AtomicIncrement = OSAtomicIncrement32Barrier 27 | let AtomicDecrement = OSAtomicDecrement32Barrier 28 | func AtomicOr(_ mask: UInt32, _ theValue : UnsafeMutablePointer) -> Int32 { 29 | return OSAtomicOr32OrigBarrier(mask, castToUInt32Pointer(theValue)) 30 | } 31 | func AtomicFlagSet(_ mask: UInt32, _ theValue : UnsafeMutablePointer) -> Bool { 32 | // just used to create a barrier 33 | OSAtomicXor32OrigBarrier(0, castToUInt32Pointer(theValue)) 34 | return (theValue.pointee & Int32(mask)) != 0 35 | } 36 | 37 | extension Thread { 38 | 39 | static func setThreadLocalStorageValue(_ value: T?, forKey key: NSCopying 40 | ) { 41 | let currentThread = Thread.current 42 | let threadDictionary = currentThread.threadDictionary 43 | 44 | if let newValue = value { 45 | threadDictionary[key] = newValue 46 | } 47 | else { 48 | threadDictionary[key] = nil 49 | } 50 | 51 | } 52 | static func getThreadLocalStorageValueForKey(_ key: NSCopying) -> T? { 53 | let currentThread = Thread.current 54 | let threadDictionary = currentThread.threadDictionary 55 | 56 | return threadDictionary[key] as? T 57 | } 58 | } 59 | 60 | extension AtomicInt { 61 | func valueSnapshot() -> Int32 { 62 | return self 63 | } 64 | } 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /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/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/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 | lock(); defer { unlock() } 21 | action() 22 | } 23 | 24 | @inline(__always) 25 | final func calculateLocked(_ action: () -> T) -> T { 26 | lock(); defer { unlock() } 27 | return action() 28 | } 29 | 30 | @inline(__always) 31 | final func calculateLockedOrFail(_ action: () throws -> T) throws -> T { 32 | lock(); defer { 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 | _lock.lock() 16 | } 17 | 18 | func unlock() { 19 | _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 | lock(); defer { unlock() } 16 | _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 | lock(); defer { unlock() } 16 | _synchronized_on(event) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedSubscribeType.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 SynchronizedSubscribeType : class, ObservableType, Lock { 10 | func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == E 11 | } 12 | 13 | extension SynchronizedSubscribeType { 14 | func synchronizedSubscribe(_ observer: O) -> Disposable where O.E == E { 15 | lock(); defer { unlock() } 16 | return _synchronized_subscribe(observer) 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/Deprecated.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Deprecated.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/5/17. 6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension Observable { 10 | /** 11 | Converts a optional to an observable sequence. 12 | 13 | - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) 14 | 15 | - parameter optional: Optional element in the resulting observable sequence. 16 | - returns: An observable sequence containing the wrapped value or not from given optional. 17 | */ 18 | @available(*, deprecated, message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.", renamed: "from(optional:)") 19 | public static func from(_ optional: E?) -> Observable { 20 | return Observable.from(optional: optional) 21 | } 22 | 23 | /** 24 | Converts a optional to an observable sequence. 25 | 26 | - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) 27 | 28 | - parameter optional: Optional element in the resulting observable sequence. 29 | - parameter: Scheduler to send the optional element on. 30 | - returns: An observable sequence containing the wrapped value or not from given optional. 31 | */ 32 | @available(*, deprecated, message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.", renamed: "from(optional:scheduler:)") 33 | public static func from(_ optional: E?, scheduler: ImmediateSchedulerType) -> Observable { 34 | return Observable.from(optional: optional, scheduler: scheduler) 35 | } 36 | } 37 | 38 | extension Disposable { 39 | /// Deprecated in favor of `disposed(by:)` 40 | /// 41 | /// **@available(\*, deprecated, message="use disposed(by:) instead")** 42 | /// 43 | /// Adds `self` to `bag`. 44 | /// 45 | /// - parameter bag: `DisposeBag` to add `self` to. 46 | public func addDisposableTo(_ bag: DisposeBag) { 47 | disposed(by: bag) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /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 | /// Respresents 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 var _isDisposed: AtomicInt = 0 16 | private var _disposeAction: DisposeAction? 17 | 18 | /// - returns: Was resource disposed. 19 | public var isDisposed: Bool { 20 | return _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 | _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 | _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 AtomicCompareAndSwap(0, 1, &_isDisposed) { 42 | assert(_isDisposed == 1) 43 | 44 | if let action = _disposeAction { 45 | _disposeAction = nil 46 | action() 47 | } 48 | } 49 | } 50 | } 51 | 52 | extension Disposables { 53 | 54 | /// Constructs a new disposable with the given action used for disposal. 55 | /// 56 | /// - parameter dispose: Disposal action which will be run upon calling `dispose`. 57 | public static func create(with dispose: @escaping () -> ()) -> Cancelable { 58 | return AnonymousDisposable(disposeAction: dispose) 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /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 var _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 _isDisposed > 0 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 | _disposable1 = disposable1 29 | _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 AtomicCompareAndSwap(0, 1, &_isDisposed) { 38 | _disposable1?.dispose() 39 | _disposable2?.dispose() 40 | _disposable1 = nil 41 | _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 _isDisposed 27 | } 28 | 29 | /// Sets the status to disposed, which can be observer through the `isDisposed` property. 30 | public func dispose() { 31 | _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/DisposeBag.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DisposeBag.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | extension Disposable { 10 | /// Adds `self` to `bag` 11 | /// 12 | /// - parameter bag: `DisposeBag` to add `self` to. 13 | public func disposed(by bag: DisposeBag) { 14 | bag.insert(self) 15 | } 16 | } 17 | 18 | /** 19 | Thread safe bag that disposes added disposables on `deinit`. 20 | 21 | This returns ARC (RAII) like resource management to `RxSwift`. 22 | 23 | In case contained disposables need to be disposed, just put a different dispose bag 24 | or create a new one in its place. 25 | 26 | self.existingDisposeBag = DisposeBag() 27 | 28 | In case explicit disposal is necessary, there is also `CompositeDisposable`. 29 | */ 30 | public final class DisposeBag: DisposeBase { 31 | 32 | private var _lock = SpinLock() 33 | 34 | // state 35 | private var _disposables = [Disposable]() 36 | private var _isDisposed = false 37 | 38 | /// Constructs new empty dispose bag. 39 | public override init() { 40 | super.init() 41 | } 42 | 43 | /// Adds `disposable` to be disposed when dispose bag is being deinited. 44 | /// 45 | /// - parameter disposable: Disposable to add. 46 | public func insert(_ disposable: Disposable) { 47 | _insert(disposable)?.dispose() 48 | } 49 | 50 | private func _insert(_ disposable: Disposable) -> Disposable? { 51 | _lock.lock(); defer { _lock.unlock() } 52 | if _isDisposed { 53 | return disposable 54 | } 55 | 56 | _disposables.append(disposable) 57 | 58 | return nil 59 | } 60 | 61 | /// This is internal on purpose, take a look at `CompositeDisposable` instead. 62 | private func dispose() { 63 | let oldDisposables = _dispose() 64 | 65 | for disposable in oldDisposables { 66 | disposable.dispose() 67 | } 68 | } 69 | 70 | private func _dispose() -> [Disposable] { 71 | _lock.lock(); defer { _lock.unlock() } 72 | 73 | let disposables = _disposables 74 | 75 | _disposables.removeAll(keepingCapacity: false) 76 | _isDisposed = true 77 | 78 | return disposables 79 | } 80 | 81 | deinit { 82 | dispose() 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /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 | let _ = Resources.incrementTotal() 14 | #endif 15 | } 16 | 17 | deinit { 18 | #if TRACE_RESOURCES 19 | let _ = 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 var _isDisposed: AtomicInt = 0 19 | 20 | // state 21 | private var _disposable: Disposable? 22 | 23 | /// - returns: Was resource disposed. 24 | public var isDisposed: Bool { 25 | return _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 | _disposable = disposable 37 | } 38 | 39 | /// Disposes the wrapped disposable on the provided scheduler. 40 | public func dispose() { 41 | let _ = scheduler.schedule(self, action: disposeScheduledDisposable) 42 | } 43 | 44 | func disposeInner() { 45 | if AtomicCompareAndSwap(0, 1, &_isDisposed) { 46 | _disposable!.dispose() 47 | _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 _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 _lock.calculateLocked { 37 | return self.disposable 38 | } 39 | } 40 | set (newDisposable) { 41 | let disposable: Disposable? = _lock.calculateLocked { 42 | if _isDisposed { 43 | return newDisposable 44 | } 45 | else { 46 | let toDispose = _current 47 | _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 | _dispose()?.dispose() 61 | } 62 | 63 | private func _dispose() -> Disposable? { 64 | _lock.lock(); defer { _lock.unlock() } 65 | if _isDisposed { 66 | return nil 67 | } 68 | else { 69 | _isDisposed = true 70 | let current = _current 71 | _current = nil 72 | return current 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /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 | _owner = owner 15 | _key = key 16 | } 17 | 18 | func dispose() { 19 | _owner?.synchronizedUnsubscribe(_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/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) -> ()>, _ event: Event) { 14 | if bag._onlyFastPath { 15 | bag._value0?(event) 16 | return 17 | } 18 | 19 | let value0 = bag._value0 20 | let dictionary = bag._dictionary 21 | 22 | if let value0 = value0 { 23 | value0(event) 24 | } 25 | 26 | let pairs = bag._pairs 27 | for i in 0 ..< pairs.count { 28 | pairs[i].value(event) 29 | } 30 | 31 | if let dictionary = dictionary { 32 | for element in dictionary.values { 33 | element(event) 34 | } 35 | } 36 | } 37 | 38 | /// Dispatches `dispose` to all disposables contained inside bag. 39 | func disposeAll(in bag: Bag) { 40 | if bag._onlyFastPath { 41 | bag._value0?.dispose() 42 | return 43 | } 44 | 45 | let value0 = bag._value0 46 | let dictionary = bag._dictionary 47 | 48 | if let value0 = value0 { 49 | value0.dispose() 50 | } 51 | 52 | let pairs = bag._pairs 53 | for i in 0 ..< pairs.count { 54 | pairs[i].value.dispose() 55 | } 56 | 57 | if let dictionary = dictionary { 58 | for element in dictionary.values { 59 | element.dispose() 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /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 = endIndex 13 | while index > 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 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) -> ()) -> ()) -> 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 | let _ = 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 | let _ = 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 (`Observer`). 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 | /// Type of elements in sequence. 12 | associatedtype E 13 | 14 | /** 15 | Subscribes `observer` to receive events for this sequence. 16 | 17 | ### Grammar 18 | 19 | **Next\* (Error | Completed)?** 20 | 21 | * sequences can produce zero or more elements so zero or more `Next` events can be sent to `observer` 22 | * once an `Error` or `Completed` event is sent, the sequence terminates and can't produce any other elements 23 | 24 | It is possible that events are sent from different threads, but no two events can be sent concurrently to 25 | `observer`. 26 | 27 | ### Resource Management 28 | 29 | When sequence sends `Complete` or `Error` event all internal resources that compute sequence elements 30 | will be freed. 31 | 32 | To cancel production of sequence elements and free resources immediately, call `dispose` on returned 33 | subscription. 34 | 35 | - returns: Subscription for `observer` that can be used to cancel production of sequence elements and free resources. 36 | */ 37 | func subscribe(_ observer: O) -> Disposable where O.E == E 38 | } 39 | 40 | extension ObservableType { 41 | 42 | /// Default implementation of converting `ObservableType` to `Observable`. 43 | public func asObservable() -> Observable { 44 | // temporary workaround 45 | //return Observable.create(subscribe: self.subscribe) 46 | return Observable.create { o in 47 | return self.subscribe(o) 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /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 | forwardOn(event) 20 | case .completed, .error(_): 21 | forwardOn(event) 22 | dispose() 23 | } 24 | } 25 | } 26 | 27 | final class AddRef : Producer { 28 | typealias EventHandler = (Event) throws -> Void 29 | 30 | private let _source: Observable 31 | private let _refCount: RefCountDisposable 32 | 33 | init(source: Observable, refCount: RefCountDisposable) { 34 | _source = source 35 | _refCount = refCount 36 | } 37 | 38 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 39 | let releaseDisposable = _refCount.retain() 40 | let sink = AddRefSink(observer: observer, cancel: cancel) 41 | let subscription = Disposables.create(releaseDisposable, _source.subscribe(sink)) 42 | 43 | return (sink: sink, subscription: subscription) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /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? = nil 14 | 15 | func on(_ event: Event) { 16 | switch event { 17 | case .next: 18 | if _element != nil { 19 | forwardOn(.error(RxError.moreThanOneElement)) 20 | dispose() 21 | } 22 | 23 | _element = event 24 | case .error: 25 | forwardOn(event) 26 | dispose() 27 | case .completed: 28 | if let element = _element { 29 | forwardOn(element) 30 | } 31 | forwardOn(.completed) 32 | dispose() 33 | } 34 | } 35 | } 36 | 37 | final class AsMaybe: Producer { 38 | fileprivate let _source: Observable 39 | 40 | init(source: Observable) { 41 | _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 = _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? = nil 14 | 15 | func on(_ event: Event) { 16 | switch event { 17 | case .next: 18 | if _element != nil { 19 | forwardOn(.error(RxError.moreThanOneElement)) 20 | dispose() 21 | } 22 | 23 | _element = event 24 | case .error: 25 | forwardOn(event) 26 | dispose() 27 | case .completed: 28 | if let element = _element { 29 | forwardOn(element) 30 | forwardOn(.completed) 31 | } 32 | else { 33 | forwardOn(.error(RxError.noElements)) 34 | } 35 | dispose() 36 | } 37 | } 38 | } 39 | 40 | final class AsSingle: Producer { 41 | fileprivate let _source: Observable 42 | 43 | init(source: Observable) { 44 | _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 = _source.subscribe(sink) 50 | return (sink: sink, subscription: subscription) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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 fileprivate 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 | _default = `default` 31 | super.init(observer: observer, cancel: cancel) 32 | } 33 | 34 | func on(_ event: Event) { 35 | switch event { 36 | case .next(_): 37 | _isEmpty = false 38 | forwardOn(event) 39 | case .error(_): 40 | forwardOn(event) 41 | dispose() 42 | case .completed: 43 | if _isEmpty { 44 | forwardOn(.next(_default)) 45 | } 46 | forwardOn(.completed) 47 | dispose() 48 | } 49 | } 50 | } 51 | 52 | final fileprivate class DefaultIfEmpty: Producer { 53 | private let _source: Observable 54 | private let _default: SourceType 55 | 56 | init(source: Observable, `default`: SourceType) { 57 | _source = source 58 | _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: _default, observer: observer, cancel: cancel) 63 | let subscription = _source.subscribe(sink) 64 | return (sink: sink, subscription: subscription) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /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 fileprivate class DelaySubscriptionSink 27 | : Sink, ObserverType { 28 | typealias E = O.E 29 | typealias Parent = DelaySubscription 30 | 31 | private let _parent: Parent 32 | 33 | init(parent: Parent, observer: O, cancel: Cancelable) { 34 | _parent = parent 35 | super.init(observer: observer, cancel: cancel) 36 | } 37 | 38 | func on(_ event: Event) { 39 | forwardOn(event) 40 | if event.isStopEvent { 41 | dispose() 42 | } 43 | } 44 | 45 | } 46 | 47 | final fileprivate class DelaySubscription: Producer { 48 | private let _source: Observable 49 | private let _dueTime: RxTimeInterval 50 | private let _scheduler: SchedulerType 51 | 52 | init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { 53 | _source = source 54 | _dueTime = dueTime 55 | _scheduler = scheduler 56 | } 57 | 58 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 59 | let sink = DelaySubscriptionSink(parent: self, observer: observer, cancel: cancel) 60 | let subscription = _scheduler.scheduleRelative((), dueTime: _dueTime) { _ in 61 | return self._source.subscribe(sink) 62 | } 63 | 64 | return (sink: sink, subscription: subscription) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /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 | forwardOn(element.event) 26 | if element.event.isStopEvent { 27 | dispose() 28 | } 29 | case .completed: 30 | forwardOn(.completed) 31 | dispose() 32 | case .error(let error): 33 | forwardOn(.error(error)) 34 | dispose() 35 | } 36 | } 37 | } 38 | 39 | final fileprivate class Dematerialize: Producer { 40 | private let _source: Observable 41 | 42 | init(source: Observable) { 43 | _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 = _source.subscribe(sink) 49 | return (sink: sink, subscription: subscription) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /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 Observable { 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 fileprivate 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/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 Observable { 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 fileprivate class ErrorProducer : Producer { 23 | private let _error: Swift.Error 24 | 25 | init(error: Swift.Error) { 26 | _error = error 27 | } 28 | 29 | override func subscribe(_ observer: O) -> Disposable where O.E == Element { 30 | observer.on(.error(_error)) 31 | return Disposables.create() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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 | forwardOn(.next(event)) 24 | if event.isStopEvent { 25 | forwardOn(.completed) 26 | dispose() 27 | } 28 | } 29 | } 30 | 31 | final fileprivate class Materialize: Producer> { 32 | private let _source: Observable 33 | 34 | init(source: Observable) { 35 | _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 = _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 Observable { 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 fileprivate 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/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 Observable { 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 fileprivate class RepeatElement : Producer { 25 | fileprivate let _element: Element 26 | fileprivate let _scheduler: ImmediateSchedulerType 27 | 28 | init(element: Element, scheduler: ImmediateSchedulerType) { 29 | _element = element 30 | _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 fileprivate class RepeatElementSink : Sink { 42 | typealias Parent = RepeatElement 43 | 44 | private let _parent: Parent 45 | 46 | init(parent: Parent, observer: O, cancel: Cancelable) { 47 | _parent = parent 48 | super.init(observer: observer, cancel: cancel) 49 | } 50 | 51 | func run() -> Disposable { 52 | return _parent._scheduler.scheduleRecursive(_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 var _disposed: Bool 13 | 14 | #if DEBUG 15 | fileprivate let _synchronizationTracker = SynchronizationTracker() 16 | #endif 17 | 18 | init(observer: O, cancel: Cancelable) { 19 | #if TRACE_RESOURCES 20 | let _ = Resources.incrementTotal() 21 | #endif 22 | _observer = observer 23 | _cancel = cancel 24 | _disposed = false 25 | } 26 | 27 | final func forwardOn(_ event: Event) { 28 | #if DEBUG 29 | _synchronizationTracker.register(synchronizationErrorMessage: .default) 30 | defer { _synchronizationTracker.unregister() } 31 | #endif 32 | if _disposed { 33 | return 34 | } 35 | _observer.on(event) 36 | } 37 | 38 | final func forwarder() -> SinkForward { 39 | return SinkForward(forward: self) 40 | } 41 | 42 | final var disposed: Bool { 43 | return _disposed 44 | } 45 | 46 | func dispose() { 47 | _disposed = true 48 | _cancel.dispose() 49 | } 50 | 51 | deinit { 52 | #if TRACE_RESOURCES 53 | let _ = Resources.decrementTotal() 54 | #endif 55 | } 56 | } 57 | 58 | final class SinkForward: ObserverType { 59 | typealias E = O.E 60 | 61 | private let _forward: Sink 62 | 63 | init(forward: Sink) { 64 | _forward = forward 65 | } 66 | 67 | final func on(_ event: Event) { 68 | switch event { 69 | case .next: 70 | _forward._observer.on(event) 71 | case .error, .completed: 72 | _forward._observer.on(event) 73 | _forward._cancel.dispose() 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /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 fileprivate 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 elements { 37 | observer.on(.next(e)) 38 | } 39 | 40 | return (sink: Disposables.create(), subscription: source.subscribe(observer)) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /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 fileprivate class ToArraySink : Sink, ObserverType where O.E == [SourceType] { 28 | typealias Parent = ToArray 29 | 30 | let _parent: Parent 31 | var _list = Array() 32 | 33 | init(parent: Parent, observer: O, cancel: Cancelable) { 34 | _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 | forwardOn(.error(e)) 45 | self.dispose() 46 | case .completed: 47 | forwardOn(.next(_list)) 48 | forwardOn(.completed) 49 | self.dispose() 50 | } 51 | } 52 | } 53 | 54 | final fileprivate class ToArray : Producer<[SourceType]> { 55 | let _source: Observable 56 | 57 | init(source: Observable) { 58 | _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 = _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 final func onNext(_ element: E) { 27 | on(.next(element)) 28 | } 29 | 30 | /// Convenience method equivalent to `on(.completed)` 31 | public final func onCompleted() { 32 | 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 final func onError(_ error: Swift.Error) { 38 | 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 | let _ = Resources.incrementTotal() 19 | #endif 20 | _eventHandler = eventHandler 21 | } 22 | 23 | override func onCore(_ event: Event) { 24 | return _eventHandler(event) 25 | } 26 | 27 | #if TRACE_RESOURCES 28 | deinit { 29 | let _ = 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 var _isStopped: AtomicInt = 0 13 | 14 | func on(_ event: Event) { 15 | switch event { 16 | case .next: 17 | if _isStopped == 0 { 18 | onCore(event) 19 | } 20 | case .error, .completed: 21 | if AtomicCompareAndSwap(0, 1, &_isStopped) { 22 | onCore(event) 23 | } 24 | } 25 | } 26 | 27 | func onCore(_ event: Event) { 28 | rxAbstractMethod() 29 | } 30 | 31 | func dispose() { 32 | _ = AtomicCompareAndSwap(0, 1, &_isStopped) 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/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/ImmediateScheduler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImmediateScheduler.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 10/17/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Represents an object that schedules units of work to run immediately on the current thread. 10 | private final class ImmediateScheduler : ImmediateSchedulerType { 11 | 12 | private let _asyncLock = AsyncLock() 13 | 14 | /** 15 | Schedules an action to be executed immediately. 16 | 17 | In case `schedule` is called recursively from inside of `action` callback, scheduled `action` will be enqueued 18 | and executed after current `action`. (`AsyncLock` behavior) 19 | 20 | - parameter state: State passed to the action to be executed. 21 | - parameter action: Action to be executed. 22 | - returns: The disposable object used to cancel the scheduled action (best effort). 23 | */ 24 | func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { 25 | let disposable = SingleAssignmentDisposable() 26 | _asyncLock.invoke(AnonymousInvocable { 27 | if disposable.isDisposed { 28 | return 29 | } 30 | disposable.setDisposable(action(state)) 31 | }) 32 | 33 | return disposable 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnonymousInvocable.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 AnonymousInvocable : InvocableType { 10 | private let _action: () -> () 11 | 12 | init(_ action: @escaping () -> ()) { 13 | _action = action 14 | } 15 | 16 | func invoke() { 17 | _action() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /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 | _invocable = invocable 16 | _state = state 17 | } 18 | 19 | func invoke() { 20 | _invocable.invoke(_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 _disposable.isDisposed 21 | } 22 | 23 | init(action: @escaping Action, state: T) { 24 | _action = action 25 | _state = state 26 | } 27 | 28 | func invoke() { 29 | _disposable.setDisposable(_action(_state)) 30 | } 31 | 32 | func dispose() { 33 | _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.OperationQueue 10 | import class Foundation.BlockOperation 11 | import Dispatch 12 | 13 | /// Abstracts the work that needs to be performed on a specific `NSOperationQueue`. 14 | /// 15 | /// 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`. 16 | public class OperationQueueScheduler: ImmediateSchedulerType { 17 | public let operationQueue: OperationQueue 18 | 19 | /// Constructs new instance of `OperationQueueScheduler` that performs work on `operationQueue`. 20 | /// 21 | /// - parameter operationQueue: Operation queue targeted to perform work on. 22 | public init(operationQueue: OperationQueue) { 23 | self.operationQueue = operationQueue 24 | } 25 | 26 | /** 27 | Schedules an action to be executed recursively. 28 | 29 | - parameter state: State passed to the action to be executed. 30 | - 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. 31 | - returns: The disposable object used to cancel the scheduled action (best effort). 32 | */ 33 | public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { 34 | let cancel = SingleAssignmentDisposable() 35 | 36 | let operation = BlockOperation { 37 | if cancel.isDisposed { 38 | return 39 | } 40 | 41 | 42 | cancel.setDisposable(action(state)) 43 | } 44 | 45 | self.operationQueue.addOperation(operation) 46 | 47 | return cancel 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /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 var _pendingTickCount: AtomicInt = 0 25 | 26 | init(scheduler: SchedulerType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping RecursiveAction, state: State) { 27 | _scheduler = scheduler 28 | _startAfter = startAfter 29 | _period = period 30 | _action = action 31 | _state = state 32 | } 33 | 34 | func start() -> Disposable { 35 | return _scheduler.scheduleRecursive(SchedulePeriodicRecursiveCommand.tick, dueTime: _startAfter, action: self.tick) 36 | } 37 | 38 | func tick(_ command: SchedulePeriodicRecursiveCommand, scheduler: RecursiveScheduler) -> Void { 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: _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 AtomicIncrement(&_pendingTickCount) == 1 { 49 | self.tick(.dispatchStart, scheduler: scheduler) 50 | } 51 | 52 | case .dispatchStart: 53 | _state = _action(_state) 54 | // Start work and schedule check is this last batch of work 55 | if AtomicDecrement(&_pendingTickCount) > 0 { 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/Subjects/Variable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Variable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/28/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | /// Variable is a wrapper for `BehaviorSubject`. 10 | /// 11 | /// Unlike `BehaviorSubject` it can't terminate with error, and when variable is deallocated 12 | /// it will complete its observable sequence (`asObservable`). 13 | public final class Variable { 14 | 15 | public typealias E = Element 16 | 17 | private let _subject: BehaviorSubject 18 | 19 | private var _lock = SpinLock() 20 | 21 | // state 22 | private var _value: E 23 | 24 | #if DEBUG 25 | fileprivate let _synchronizationTracker = SynchronizationTracker() 26 | #endif 27 | 28 | /// Gets or sets current value of variable. 29 | /// 30 | /// Whenever a new value is set, all the observers are notified of the change. 31 | /// 32 | /// Even if the newly set value is same as the old value, observers are still notified for change. 33 | public var value: E { 34 | get { 35 | _lock.lock(); defer { _lock.unlock() } 36 | return _value 37 | } 38 | set(newValue) { 39 | #if DEBUG 40 | _synchronizationTracker.register(synchronizationErrorMessage: .variable) 41 | defer { _synchronizationTracker.unregister() } 42 | #endif 43 | _lock.lock() 44 | _value = newValue 45 | _lock.unlock() 46 | 47 | _subject.on(.next(newValue)) 48 | } 49 | } 50 | 51 | /// Initializes variable with initial value. 52 | /// 53 | /// - parameter value: Initial variable value. 54 | public init(_ value: Element) { 55 | _value = value 56 | _subject = BehaviorSubject(value: value) 57 | } 58 | 59 | /// - returns: Canonical interface for push style sequence 60 | public func asObservable() -> Observable { 61 | return _subject 62 | } 63 | 64 | deinit { 65 | _subject.on(.completed) 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Alamofire : NSObject 3 | @end 4 | @implementation PodsDummy_Alamofire 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-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/Alamofire/Alamofire-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 AlamofireVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Alamofire 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/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.4.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/HandyJSON/HandyJSON-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_HandyJSON : NSObject 3 | @end 4 | @implementation PodsDummy_HandyJSON 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/HandyJSON/HandyJSON-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/HandyJSON/HandyJSON-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 | #import "HandyJSON.h" 14 | 15 | FOUNDATION_EXPORT double HandyJSONVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char HandyJSONVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/HandyJSON/HandyJSON.modulemap: -------------------------------------------------------------------------------- 1 | framework module HandyJSON { 2 | umbrella header "HandyJSON-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/HandyJSON/HandyJSON.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/HandyJSON 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/HandyJSON 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | SWIFT_VERSION = 3.0 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/HandyJSON/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.7.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Moya/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 | 8.0.5 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Moya/Moya-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Moya : NSObject 3 | @end 4 | @implementation PodsDummy_Moya 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Moya/Moya-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/Moya/Moya-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 MoyaVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char MoyaVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Moya/Moya.modulemap: -------------------------------------------------------------------------------- 1 | framework module Moya { 2 | umbrella header "Moya-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Moya/Moya.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Moya 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_LDFLAGS = -framework "Foundation" 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_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Moya 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ObjectMapper/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 | 2.2.7 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ObjectMapper/ObjectMapper-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_ObjectMapper : NSObject 3 | @end 4 | @implementation PodsDummy_ObjectMapper 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ObjectMapper/ObjectMapper-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/ObjectMapper/ObjectMapper-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 ObjectMapperVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char ObjectMapperVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ObjectMapper/ObjectMapper.modulemap: -------------------------------------------------------------------------------- 1 | framework module ObjectMapper { 2 | umbrella header "ObjectMapper-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ObjectMapper/ObjectMapper.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ObjectMapper 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/ObjectMapper 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | SWIFT_VERSION = 3.1 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExample/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-RxMoyaExample/Pods-RxMoyaExample-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_RxMoyaExample : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_RxMoyaExample 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExample/Pods-RxMoyaExample-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_RxMoyaExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_RxMoyaExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExample/Pods-RxMoyaExample.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$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/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON/HandyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper/ObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxSwift/RxSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "HandyJSON" -framework "Moya" -framework "ObjectMapper" -framework "Result" -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-RxMoyaExample/Pods-RxMoyaExample.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_RxMoyaExample { 2 | umbrella header "Pods-RxMoyaExample-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExample/Pods-RxMoyaExample.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$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/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON/HandyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper/ObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxSwift/RxSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "HandyJSON" -framework "Moya" -framework "ObjectMapper" -framework "Result" -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-RxMoyaExampleTests/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-RxMoyaExampleTests/Pods-RxMoyaExampleTests-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-RxMoyaExampleTests/Pods-RxMoyaExampleTests-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-RxMoyaExampleTests/Pods-RxMoyaExampleTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_RxMoyaExampleTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_RxMoyaExampleTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExampleTests/Pods-RxMoyaExampleTests-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_RxMoyaExampleTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_RxMoyaExampleTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExampleTests/Pods-RxMoyaExampleTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$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/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON/HandyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper/ObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -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-RxMoyaExampleTests/Pods-RxMoyaExampleTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_RxMoyaExampleTests { 2 | umbrella header "Pods-RxMoyaExampleTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExampleTests/Pods-RxMoyaExampleTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$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/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON/HandyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper/ObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -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-RxMoyaExampleUITests/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-RxMoyaExampleUITests/Pods-RxMoyaExampleUITests-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-RxMoyaExampleUITests/Pods-RxMoyaExampleUITests-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-RxMoyaExampleUITests/Pods-RxMoyaExampleUITests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_RxMoyaExampleUITests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_RxMoyaExampleUITests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExampleUITests/Pods-RxMoyaExampleUITests-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_RxMoyaExampleUITestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_RxMoyaExampleUITestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExampleUITests/Pods-RxMoyaExampleUITests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$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/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON/HandyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper/ObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -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-RxMoyaExampleUITests/Pods-RxMoyaExampleUITests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_RxMoyaExampleUITests { 2 | umbrella header "Pods-RxMoyaExampleUITests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxMoyaExampleUITests/Pods-RxMoyaExampleUITests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$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/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/HandyJSON/HandyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper/ObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -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/Result/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 | 3.2.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Result/Result-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Result : NSObject 3 | @end 4 | @implementation PodsDummy_Result 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Result/Result-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/Result/Result-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 ResultVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char ResultVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Result/Result.modulemap: -------------------------------------------------------------------------------- 1 | framework module Result { 2 | umbrella header "Result-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Result/Result.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Result 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Result 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /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 | 3.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 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/RxSwift 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RxMoyaExample 2 | Moya + RxSwift + ObjectMapper / HandyJson 3 | -------------------------------------------------------------------------------- /RxMoyaExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RxMoyaExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /RxMoyaExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // RxMoyaExample 4 | // 5 | // Created by chendi li on 2017/7/4. 6 | // Copyright © 2017年 dcubot. 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: [UIApplicationLaunchOptionsKey: 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 | -------------------------------------------------------------------------------- /RxMoyaExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /RxMoyaExample/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 | 27 | 28 | -------------------------------------------------------------------------------- /RxMoyaExample/Base.lproj/Main.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 | 27 | -------------------------------------------------------------------------------- /RxMoyaExample/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 | 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 | 38 | 39 | -------------------------------------------------------------------------------- /RxMoyaExample/Moya.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Moya.swift 3 | // RxMoyaExample 4 | // 5 | // Created by chendi li on 2017/7/4. 6 | // Copyright © 2017年 dcubot. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Moya 11 | 12 | import Moya 13 | 14 | 15 | enum MyAPI { 16 | case login(username: String, password: String) 17 | } 18 | 19 | 20 | 21 | extension MyAPI: TargetType { 22 | public var task: Task { 23 | return .request 24 | } 25 | var parameterEncoding: ParameterEncoding { return URLEncoding.default } 26 | public var baseURL: URL { return URL(string: "https://baseurl.com/v1")! } 27 | 28 | public var path: String { 29 | switch self { 30 | case .login: 31 | return "/login" 32 | } 33 | } 34 | 35 | var method: Moya.Method { 36 | switch self { 37 | case .login: 38 | return .post 39 | } 40 | } 41 | var parameters: [String: Any]? { 42 | switch self { 43 | case .login(let username, let password): 44 | return ["username" : username, "password" : password] 45 | 46 | } 47 | 48 | } 49 | 50 | public var validate: Bool { 51 | return true 52 | } 53 | public var sampleData: Data { 54 | return "[{\"name\": \"Repo Name\"}]".data(using: String.Encoding.utf8)! 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /RxMoyaExample/Router.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Router.swift 3 | // RxMoyaExample 4 | // 5 | // Created by chendi li on 2017/7/4. 6 | // Copyright © 2017年 dcubot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Alamofire 11 | 12 | public enum Router: URLRequestConvertible { 13 | static let baseURLPath = "http://example.com/v1" 14 | 15 | // 假设一个get请求,只需要传 uid 和 token 16 | case getInfo(uid: String, token: String) 17 | 18 | // 假设一个post请求,只需要传 uid 和 info 19 | case postInfo(uid: String, info: String) 20 | 21 | var method: HTTPMethod { 22 | switch self { 23 | case .getInfo: 24 | return .get 25 | case .postInfo: 26 | return .post 27 | } 28 | } 29 | 30 | var path: String { 31 | switch self { 32 | case .getInfo: 33 | return "/getInfo" 34 | case .postInfo: 35 | return "/postInfo" 36 | } 37 | } 38 | 39 | public func asURLRequest() throws -> URLRequest { 40 | let parameters: [String: Any] = { 41 | switch self { 42 | case .getInfo(let uid, let token): 43 | return ["uid": uid, "token" : token] 44 | case .postInfo(let uid, let info): 45 | return ["uid": uid, "info": info] 46 | default: 47 | return [:] 48 | } 49 | }() 50 | 51 | let url = try Router.baseURLPath.asURL() 52 | 53 | var request = URLRequest(url: url.appendingPathComponent(path)) 54 | request.httpMethod = method.rawValue 55 | request.timeoutInterval = TimeInterval(10 * 1000) 56 | 57 | return try URLEncoding.default.encode(request, with: parameters) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /RxMoyaExample/User.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // RxMoyaExample 4 | // 5 | // Created by chendi li on 2017/7/4. 6 | // Copyright © 2017年 dcubot. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import ObjectMapper 11 | import HandyJSON 12 | class User: Mappable { 13 | /// This function is where all variable mappings should occur. It is executed by Mapper during the mapping (serialization and deserialization) process. 14 | func mapping(map: Map) { 15 | // <#code#> 16 | } 17 | 18 | required /// This function can be used to validate JSON prior to mapping. Return nil to cancel mapping at this point 19 | init?(map: Map) { 20 | // <#code#> 21 | } 22 | 23 | 24 | } 25 | 26 | struct People: HandyJSON { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /RxMoyaExampleTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /RxMoyaExampleTests/RxMoyaExampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxMoyaExampleTests.swift 3 | // RxMoyaExampleTests 4 | // 5 | // Created by chendi li on 2017/7/4. 6 | // Copyright © 2017年 dcubot. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import RxMoyaExample 11 | 12 | class RxMoyaExampleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /RxMoyaExampleUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /RxMoyaExampleUITests/RxMoyaExampleUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxMoyaExampleUITests.swift 3 | // RxMoyaExampleUITests 4 | // 5 | // Created by chendi li on 2017/7/4. 6 | // Copyright © 2017年 dcubot. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class RxMoyaExampleUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | --------------------------------------------------------------------------------