├── .gitignore ├── Examples ├── blueprint.apib └── blueprint.swift ├── 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 ├── AlamofireObjectMapper │ ├── AlamofireObjectMapper │ │ └── AlamofireObjectMapper.swift │ ├── LICENSE │ └── README.md ├── Manifest.lock ├── Nimble │ ├── LICENSE.md │ ├── README.md │ └── Sources │ │ ├── Nimble │ │ ├── Adapters │ │ │ ├── AdapterProtocols.swift │ │ │ ├── AssertionDispatcher.swift │ │ │ ├── AssertionRecorder.swift │ │ │ ├── NMBExpectation.swift │ │ │ ├── NMBObjCMatcher.swift │ │ │ ├── NimbleEnvironment.swift │ │ │ └── NimbleXCTestHandler.swift │ │ ├── DSL+Wait.swift │ │ ├── DSL.swift │ │ ├── Expectation.swift │ │ ├── Expression.swift │ │ ├── FailureMessage.swift │ │ ├── Matchers │ │ │ ├── AllPass.swift │ │ │ ├── AsyncMatcherWrapper.swift │ │ │ ├── BeAKindOf.swift │ │ │ ├── BeAnInstanceOf.swift │ │ │ ├── BeCloseTo.swift │ │ │ ├── BeEmpty.swift │ │ │ ├── BeGreaterThan.swift │ │ │ ├── BeGreaterThanOrEqualTo.swift │ │ │ ├── BeIdenticalTo.swift │ │ │ ├── BeLessThan.swift │ │ │ ├── BeLessThanOrEqual.swift │ │ │ ├── BeLogical.swift │ │ │ ├── BeNil.swift │ │ │ ├── BeVoid.swift │ │ │ ├── BeginWith.swift │ │ │ ├── Contain.swift │ │ │ ├── EndWith.swift │ │ │ ├── Equal.swift │ │ │ ├── HaveCount.swift │ │ │ ├── Match.swift │ │ │ ├── MatchError.swift │ │ │ ├── MatcherFunc.swift │ │ │ ├── MatcherProtocols.swift │ │ │ ├── PostNotification.swift │ │ │ ├── RaisesException.swift │ │ │ ├── SatisfyAnyOf.swift │ │ │ └── ThrowError.swift │ │ ├── Nimble.h │ │ └── Utils │ │ │ ├── Async.swift │ │ │ ├── Errors.swift │ │ │ ├── Functional.swift │ │ │ ├── SourceLocation.swift │ │ │ └── Stringers.swift │ │ └── NimbleObjectiveC │ │ ├── CurrentTestCaseTracker.h │ │ ├── DSL.h │ │ ├── DSL.m │ │ ├── NMBExceptionCapture.h │ │ ├── NMBExceptionCapture.m │ │ ├── NMBStringify.h │ │ ├── NMBStringify.m │ │ └── XCTestObservationCenter+Register.m ├── ObjectMapper │ ├── LICENSE │ ├── ObjectMapper │ │ ├── Core │ │ │ ├── FromJSON.swift │ │ │ ├── Map.swift │ │ │ ├── Mappable.swift │ │ │ ├── Mapper.swift │ │ │ ├── Operators.swift │ │ │ └── ToJSON.swift │ │ └── Transforms │ │ │ ├── CustomDateFormatTransform.swift │ │ │ ├── DataTransform.swift │ │ │ ├── DateFormatterTransform.swift │ │ │ ├── DateTransform.swift │ │ │ ├── DictionaryTransform.swift │ │ │ ├── EnumTransform.swift │ │ │ ├── ISO8601DateTransform.swift │ │ │ ├── NSDecimalNumberTransform.swift │ │ │ ├── TransformOf.swift │ │ │ ├── TransformType.swift │ │ │ └── URLTransform.swift │ └── README.md ├── Pods.xcodeproj │ └── project.pbxproj ├── Quick │ ├── LICENSE │ ├── README.md │ └── Sources │ │ ├── Quick │ │ ├── Callsite.swift │ │ ├── Configuration │ │ │ └── Configuration.swift │ │ ├── DSL │ │ │ ├── DSL.swift │ │ │ └── World+DSL.swift │ │ ├── ErrorUtility.swift │ │ ├── Example.swift │ │ ├── ExampleGroup.swift │ │ ├── ExampleMetadata.swift │ │ ├── Filter.swift │ │ ├── Hooks │ │ │ ├── Closures.swift │ │ │ ├── ExampleHooks.swift │ │ │ ├── HooksPhase.swift │ │ │ └── SuiteHooks.swift │ │ ├── NSBundle+CurrentTestBundle.swift │ │ ├── QuickSelectedTestSuiteBuilder.swift │ │ ├── QuickTestSuite.swift │ │ ├── String+FileName.swift │ │ └── World.swift │ │ └── QuickObjectiveC │ │ ├── Configuration │ │ ├── QuickConfiguration.h │ │ └── QuickConfiguration.m │ │ ├── DSL │ │ ├── QCKDSL.h │ │ ├── QCKDSL.m │ │ └── World+DSL.h │ │ ├── NSString+QCKSelectorName.h │ │ ├── NSString+QCKSelectorName.m │ │ ├── Quick.h │ │ ├── QuickSpec.h │ │ ├── QuickSpec.m │ │ ├── World.h │ │ └── XCTestSuite+QuickTestSuiteBuilder.m ├── RxSwift │ ├── LICENSE.md │ ├── Platform │ │ ├── DataStructures │ │ │ ├── Bag.swift │ │ │ ├── InfiniteSequence.swift │ │ │ ├── PriorityQueue.swift │ │ │ └── Queue.swift │ │ ├── DispatchQueue+Extensions.swift │ │ ├── Platform.Darwin.swift │ │ └── Platform.Linux.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 │ │ ├── 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 │ │ ├── ImmediateSchedulerType.swift │ │ ├── Observable.swift │ │ ├── ObservableConvertibleType.swift │ │ ├── ObservableType+Extensions.swift │ │ ├── ObservableType.swift │ │ ├── Observables │ │ ├── Implementations │ │ │ ├── AddRef.swift │ │ │ ├── Amb.swift │ │ │ ├── AnonymousObservable.swift │ │ │ ├── Buffer.swift │ │ │ ├── Catch.swift │ │ │ ├── CombineLatest+Collection.swift │ │ │ ├── CombineLatest+arity.swift │ │ │ ├── CombineLatest.swift │ │ │ ├── Concat.swift │ │ │ ├── ConnectableObservable.swift │ │ │ ├── Debug.swift │ │ │ ├── Debunce.swift │ │ │ ├── Deferred.swift │ │ │ ├── Delay.swift │ │ │ ├── DelaySubscription.swift │ │ │ ├── DistinctUntilChanged.swift │ │ │ ├── Do.swift │ │ │ ├── ElementAt.swift │ │ │ ├── Empty.swift │ │ │ ├── Error.swift │ │ │ ├── Filter.swift │ │ │ ├── Generate.swift │ │ │ ├── Just.swift │ │ │ ├── Map.swift │ │ │ ├── Merge.swift │ │ │ ├── Multicast.swift │ │ │ ├── Never.swift │ │ │ ├── ObserveOn.swift │ │ │ ├── ObserveOnSerialDispatchQueue.swift │ │ │ ├── Optional.swift │ │ │ ├── Producer.swift │ │ │ ├── Range.swift │ │ │ ├── Reduce.swift │ │ │ ├── RefCount.swift │ │ │ ├── Repeat.swift │ │ │ ├── RetryWhen.swift │ │ │ ├── Sample.swift │ │ │ ├── Scan.swift │ │ │ ├── Sequence.swift │ │ │ ├── ShareReplay1.swift │ │ │ ├── ShareReplay1WhileConnected.swift │ │ │ ├── SingleAsync.swift │ │ │ ├── Sink.swift │ │ │ ├── Skip.swift │ │ │ ├── SkipUntil.swift │ │ │ ├── SkipWhile.swift │ │ │ ├── StartWith.swift │ │ │ ├── SubscribeOn.swift │ │ │ ├── Switch.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 │ │ ├── Observable+Aggregate.swift │ │ ├── Observable+Binding.swift │ │ ├── Observable+Concurrency.swift │ │ ├── Observable+Creation.swift │ │ ├── Observable+Debug.swift │ │ ├── Observable+Multiple.swift │ │ ├── Observable+Single.swift │ │ ├── Observable+StandardSequenceOperators.swift │ │ └── Observable+Time.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 │ │ ├── BehaviorSubject.swift │ │ ├── PublishSubject.swift │ │ ├── ReplaySubject.swift │ │ ├── SubjectType.swift │ │ └── Variable.swift ├── SwiftyJSON │ ├── LICENSE │ ├── README.md │ └── Source │ │ └── SwiftyJSON.swift └── Target Support Files │ ├── Alamofire │ ├── Alamofire-dummy.m │ ├── Alamofire-prefix.pch │ ├── Alamofire-umbrella.h │ ├── Alamofire.modulemap │ ├── Alamofire.xcconfig │ └── Info.plist │ ├── AlamofireObjectMapper │ ├── AlamofireObjectMapper-dummy.m │ ├── AlamofireObjectMapper-prefix.pch │ ├── AlamofireObjectMapper-umbrella.h │ ├── AlamofireObjectMapper.modulemap │ ├── AlamofireObjectMapper.xcconfig │ └── Info.plist │ ├── Nimble │ ├── Info.plist │ ├── Nimble-dummy.m │ ├── Nimble-prefix.pch │ ├── Nimble-umbrella.h │ ├── Nimble.modulemap │ └── Nimble.xcconfig │ ├── ObjectMapper │ ├── Info.plist │ ├── ObjectMapper-dummy.m │ ├── ObjectMapper-prefix.pch │ ├── ObjectMapper-umbrella.h │ ├── ObjectMapper.modulemap │ └── ObjectMapper.xcconfig │ ├── Pods-SwiftAPIBuilder │ ├── Info.plist │ ├── Pods-SwiftAPIBuilder-acknowledgements.markdown │ ├── Pods-SwiftAPIBuilder-acknowledgements.plist │ ├── Pods-SwiftAPIBuilder-dummy.m │ ├── Pods-SwiftAPIBuilder-frameworks.sh │ ├── Pods-SwiftAPIBuilder-resources.sh │ ├── Pods-SwiftAPIBuilder-umbrella.h │ ├── Pods-SwiftAPIBuilder.debug.xcconfig │ ├── Pods-SwiftAPIBuilder.modulemap │ └── Pods-SwiftAPIBuilder.release.xcconfig │ ├── Pods-SwiftAPITest │ ├── Info.plist │ ├── Pods-SwiftAPITest-acknowledgements.markdown │ ├── Pods-SwiftAPITest-acknowledgements.plist │ ├── Pods-SwiftAPITest-dummy.m │ ├── Pods-SwiftAPITest-frameworks.sh │ ├── Pods-SwiftAPITest-resources.sh │ ├── Pods-SwiftAPITest-umbrella.h │ ├── Pods-SwiftAPITest.debug.xcconfig │ ├── Pods-SwiftAPITest.modulemap │ └── Pods-SwiftAPITest.release.xcconfig │ ├── Quick │ ├── Info.plist │ ├── Quick-dummy.m │ ├── Quick-prefix.pch │ ├── Quick-umbrella.h │ ├── Quick.modulemap │ └── Quick.xcconfig │ ├── RxSwift │ ├── Info.plist │ ├── RxSwift-dummy.m │ ├── RxSwift-prefix.pch │ ├── RxSwift-umbrella.h │ ├── RxSwift.modulemap │ └── RxSwift.xcconfig │ ├── SwiftyJSON-OSX │ ├── Info.plist │ ├── SwiftyJSON-OSX-dummy.m │ ├── SwiftyJSON-OSX-prefix.pch │ ├── SwiftyJSON-OSX-umbrella.h │ ├── SwiftyJSON-OSX.modulemap │ └── SwiftyJSON-OSX.xcconfig │ └── SwiftyJSON-iOS │ ├── Info.plist │ ├── SwiftyJSON-iOS-dummy.m │ ├── SwiftyJSON-iOS-prefix.pch │ ├── SwiftyJSON-iOS-umbrella.h │ ├── SwiftyJSON-iOS.modulemap │ └── SwiftyJSON-iOS.xcconfig ├── README.md ├── SwiftAPIBuilder.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── SwiftAPIBuilder.xcworkspace └── contents.xcworkspacedata ├── SwiftAPIBuilder ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── swiftLogo的副本-1.png │ │ ├── swiftLogo的副本-2.png │ │ ├── swiftLogo的副本-3.png │ │ ├── swiftLogo的副本-4.png │ │ ├── swiftLogo的副本-5.png │ │ ├── swiftLogo的副本-6.png │ │ ├── swiftLogo的副本-7.png │ │ ├── swiftLogo的副本-8.png │ │ ├── swiftLogo的副本-9.png │ │ └── swiftLogo的副本.png ├── Base.lproj │ └── Main.storyboard ├── Info.plist ├── Sources │ ├── APITemplate │ ├── CodeBuilder.swift │ ├── Coolie.swift │ ├── DataBuilder.swift │ ├── Extensions.swift │ └── Render.swift ├── ThirdParties │ ├── FileWatcher │ │ ├── Common.swift │ │ ├── Local │ │ │ └── Local.swift │ │ └── Remote │ │ │ └── Remote.swift │ └── SwiftShell │ │ ├── Bash.swift │ │ ├── Command.swift │ │ ├── Context.swift │ │ ├── FileHandle.swift │ │ ├── Files.swift │ │ ├── General │ │ ├── Array.swift │ │ └── Lazy-split.swift │ │ ├── Stream.swift │ │ └── String.swift └── ViewController.swift └── SwiftAPITest ├── BaseService.swift ├── Info.plist └── SwiftAPITest.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | .DS_Store 4 | .idea/ 5 | Project/Phoenix/remote/.git 6 | build/ 7 | *.pbxuser 8 | !default.pbxuser 9 | *.mode1v3 10 | !default.mode1v3 11 | *.mode2v3 12 | !default.mode2v3 13 | *.perspectivev3 14 | !default.perspectivev3 15 | xcuserdata 16 | *.xccheckout 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | *.xcuserstate 22 | # CocoaPods 23 | # 24 | # We recommend against adding the Pods directory to your .gitignore. However 25 | # you should judge for yourself, the pros and cons are mentioned at: 26 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 27 | # 28 | # Pods/ 29 | Project/Phoenix/Images.xcassets/food/img_douguo.imageset/Contents.json 30 | Project/Phoenix/Images.xcassets/food/img_douguo.imageset/img_douguo.png 31 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'SwiftAPIBuilder' do 5 | use_frameworks! 6 | pod 'SwiftyJSON' 7 | end 8 | 9 | target 'SwiftAPITest' do 10 | use_frameworks! 11 | pod 'Alamofire' 12 | pod 'SwiftyJSON' 13 | pod 'ObjectMapper' 14 | pod 'AlamofireObjectMapper' 15 | pod 'RxSwift', '~> 3.1.0' 16 | pod 'Quick' 17 | pod 'Nimble' 18 | 19 | end 20 | 21 | post_install do |installer| 22 | installer.pods_project.targets.each do |target| 23 | target.build_configurations.each do |config| 24 | config.build_settings['SWIFT_VERSION'] = '3.0' 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.0.1) 3 | - AlamofireObjectMapper (4.0.0): 4 | - Alamofire (~> 4.0) 5 | - ObjectMapper (~> 2.0) 6 | - Nimble (5.0.0) 7 | - ObjectMapper (2.0.0) 8 | - Quick (0.10.0) 9 | - RxSwift (3.1.0) 10 | - SwiftyJSON (3.1.0) 11 | 12 | DEPENDENCIES: 13 | - Alamofire 14 | - AlamofireObjectMapper 15 | - Nimble 16 | - ObjectMapper 17 | - Quick 18 | - RxSwift (~> 3.1.0) 19 | - SwiftyJSON 20 | 21 | SPEC CHECKSUMS: 22 | Alamofire: 7682d43245de14874acd142ec137b144aa1dd335 23 | AlamofireObjectMapper: 9faa3ce5a240efda1b209009a2d6e1e949227abc 24 | Nimble: 56fc9f5020effa2206de22c3dd910f4fb011b92f 25 | ObjectMapper: aed2570edabbd3c9b26c939e1cabdb6558f933e0 26 | Quick: 5d290df1c69d5ee2f0729956dcf0fd9a30447eaa 27 | RxSwift: 83ff553e7593fdfdcb2562933a64c0284dffdadc 28 | SwiftyJSON: 29b9f2a64f118c07e691667c2ba1efe536acfe0b 29 | 30 | PODFILE CHECKSUM: 0605716336b2be1f473cf4df5f006300c81c3f0f 31 | 32 | COCOAPODS: 1.1.1 33 | -------------------------------------------------------------------------------- /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 | func syncResult(_ closure: () -> T) -> T { 39 | var result: T! 40 | sync { result = closure() } 41 | return result 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Pods/AlamofireObjectMapper/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Tristan Himmelman 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 | 23 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.0.1) 3 | - AlamofireObjectMapper (4.0.0): 4 | - Alamofire (~> 4.0) 5 | - ObjectMapper (~> 2.0) 6 | - Nimble (5.0.0) 7 | - ObjectMapper (2.0.0) 8 | - Quick (0.10.0) 9 | - RxSwift (3.1.0) 10 | - SwiftyJSON (3.1.0) 11 | 12 | DEPENDENCIES: 13 | - Alamofire 14 | - AlamofireObjectMapper 15 | - Nimble 16 | - ObjectMapper 17 | - Quick 18 | - RxSwift (~> 3.1.0) 19 | - SwiftyJSON 20 | 21 | SPEC CHECKSUMS: 22 | Alamofire: 7682d43245de14874acd142ec137b144aa1dd335 23 | AlamofireObjectMapper: 9faa3ce5a240efda1b209009a2d6e1e949227abc 24 | Nimble: 56fc9f5020effa2206de22c3dd910f4fb011b92f 25 | ObjectMapper: aed2570edabbd3c9b26c939e1cabdb6558f933e0 26 | Quick: 5d290df1c69d5ee2f0729956dcf0fd9a30447eaa 27 | RxSwift: 83ff553e7593fdfdcb2562933a64c0284dffdadc 28 | SwiftyJSON: 29b9f2a64f118c07e691667c2ba1efe536acfe0b 29 | 30 | PODFILE CHECKSUM: 0605716336b2be1f473cf4df5f006300c81c3f0f 31 | 32 | COCOAPODS: 1.1.1 33 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Adapters/AdapterProtocols.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Protocol for the assertion handler that Nimble uses for all expectations. 4 | public protocol AssertionHandler { 5 | func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) 6 | } 7 | 8 | /// Global backing interface for assertions that Nimble creates. 9 | /// Defaults to a private test handler that passes through to XCTest. 10 | /// 11 | /// If XCTest is not available, you must assign your own assertion handler 12 | /// before using any matchers, otherwise Nimble will abort the program. 13 | /// 14 | /// @see AssertionHandler 15 | public var NimbleAssertionHandler: AssertionHandler = { () -> AssertionHandler in 16 | return isXCTestAvailable() ? NimbleXCTestHandler() : NimbleXCTestUnavailableHandler() 17 | }() 18 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Adapters/AssertionDispatcher.swift: -------------------------------------------------------------------------------- 1 | 2 | /// AssertionDispatcher allows multiple AssertionHandlers to receive 3 | /// assertion messages. 4 | /// 5 | /// @warning Does not fully dispatch if one of the handlers raises an exception. 6 | /// This is possible with XCTest-based assertion handlers. 7 | /// 8 | public class AssertionDispatcher: AssertionHandler { 9 | let handlers: [AssertionHandler] 10 | 11 | public init(handlers: [AssertionHandler]) { 12 | self.handlers = handlers 13 | } 14 | 15 | public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) { 16 | for handler in handlers { 17 | handler.assert(assertion, message: message, location: location) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Adapters/NimbleEnvironment.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// "Global" state of Nimble is stored here. Only DSL functions should access / be aware of this 4 | /// class' existance 5 | internal class NimbleEnvironment { 6 | static var activeInstance: NimbleEnvironment { 7 | get { 8 | let env = Thread.current.threadDictionary["NimbleEnvironment"] 9 | if let env = env as? NimbleEnvironment { 10 | return env 11 | } else { 12 | let newEnv = NimbleEnvironment() 13 | self.activeInstance = newEnv 14 | return newEnv 15 | } 16 | } 17 | set { 18 | Thread.current.threadDictionary["NimbleEnvironment"] = newValue 19 | } 20 | } 21 | 22 | // TODO: eventually migrate the global to this environment value 23 | var assertionHandler: AssertionHandler { 24 | get { return NimbleAssertionHandler } 25 | set { NimbleAssertionHandler = newValue } 26 | } 27 | 28 | #if _runtime(_ObjC) 29 | var awaiter: Awaiter 30 | 31 | init() { 32 | let timeoutQueue: DispatchQueue 33 | if #available(OSX 10.10, *) { 34 | timeoutQueue = DispatchQueue.global(qos: .userInitiated) 35 | } else { 36 | timeoutQueue = DispatchQueue.global(priority: .high) 37 | } 38 | 39 | awaiter = Awaiter( 40 | waitLock: AssertionWaitLock(), 41 | asyncQueue: .main, 42 | timeoutQueue: timeoutQueue) 43 | } 44 | #endif 45 | } 46 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/BeAKindOf.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | #if _runtime(_ObjC) 4 | 5 | // A Nimble matcher that catches attempts to use beAKindOf with non Objective-C types 6 | public func beAKindOf(_ expectedClass: Any) -> NonNilMatcherFunc { 7 | return NonNilMatcherFunc {actualExpression, failureMessage in 8 | failureMessage.stringValue = "beAKindOf only works on Objective-C types since" 9 | + " the Swift compiler will automatically type check Swift-only types." 10 | + " This expectation is redundant." 11 | return false 12 | } 13 | } 14 | 15 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class. 16 | /// @see beAnInstanceOf if you want to match against the exact class 17 | public func beAKindOf(_ expectedClass: AnyClass) -> NonNilMatcherFunc { 18 | return NonNilMatcherFunc { actualExpression, failureMessage in 19 | let instance = try actualExpression.evaluate() 20 | if let validInstance = instance { 21 | failureMessage.actualValue = "<\(String(describing: type(of: validInstance))) instance>" 22 | } else { 23 | failureMessage.actualValue = "" 24 | } 25 | failureMessage.postfixMessage = "be a kind of \(String(describing: expectedClass))" 26 | return instance != nil && instance!.isKind(of: expectedClass) 27 | } 28 | } 29 | 30 | extension NMBObjCMatcher { 31 | public class func beAKindOfMatcher(_ expected: AnyClass) -> NMBMatcher { 32 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 33 | return try! beAKindOf(expected).matches(actualExpression, failureMessage: failureMessage) 34 | } 35 | } 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/BeAnInstanceOf.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // A Nimble matcher that catches attempts to use beAnInstanceOf with non Objective-C types 4 | public func beAnInstanceOf(_ expectedClass: Any) -> NonNilMatcherFunc { 5 | return NonNilMatcherFunc {actualExpression, failureMessage in 6 | failureMessage.stringValue = "beAnInstanceOf only works on Objective-C types since" 7 | + " the Swift compiler will automatically type check Swift-only types." 8 | + " This expectation is redundant." 9 | return false 10 | } 11 | } 12 | 13 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class. 14 | /// @see beAKindOf if you want to match against subclasses 15 | public func beAnInstanceOf(_ expectedClass: AnyClass) -> NonNilMatcherFunc { 16 | return NonNilMatcherFunc { actualExpression, failureMessage in 17 | let instance = try actualExpression.evaluate() 18 | if let validInstance = instance { 19 | failureMessage.actualValue = "<\(String(describing: type(of: validInstance))) instance>" 20 | } else { 21 | failureMessage.actualValue = "" 22 | } 23 | failureMessage.postfixMessage = "be an instance of \(String(describing: expectedClass))" 24 | #if _runtime(_ObjC) 25 | return instance != nil && instance!.isMember(of: expectedClass) 26 | #else 27 | return instance != nil && type(of: instance!) == expectedClass 28 | #endif 29 | } 30 | } 31 | 32 | #if _runtime(_ObjC) 33 | extension NMBObjCMatcher { 34 | public class func beAnInstanceOfMatcher(_ expected: AnyClass) -> NMBMatcher { 35 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 36 | return try! beAnInstanceOf(expected).matches(actualExpression, failureMessage: failureMessage) 37 | } 38 | } 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThan.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | 4 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value. 5 | public func beGreaterThan(_ expectedValue: T?) -> NonNilMatcherFunc { 6 | return NonNilMatcherFunc { actualExpression, failureMessage in 7 | failureMessage.postfixMessage = "be greater than <\(stringify(expectedValue))>" 8 | if let actual = try actualExpression.evaluate(), let expected = expectedValue { 9 | return actual > expected 10 | } 11 | return false 12 | } 13 | } 14 | 15 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value. 16 | public func beGreaterThan(_ expectedValue: NMBComparable?) -> NonNilMatcherFunc { 17 | return NonNilMatcherFunc { actualExpression, failureMessage in 18 | failureMessage.postfixMessage = "be greater than <\(stringify(expectedValue))>" 19 | let actualValue = try actualExpression.evaluate() 20 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedDescending 21 | return matches 22 | } 23 | } 24 | 25 | public func >(lhs: Expectation, rhs: T) { 26 | lhs.to(beGreaterThan(rhs)) 27 | } 28 | 29 | public func >(lhs: Expectation, rhs: NMBComparable?) { 30 | lhs.to(beGreaterThan(rhs)) 31 | } 32 | 33 | #if _runtime(_ObjC) 34 | extension NMBObjCMatcher { 35 | public class func beGreaterThanMatcher(_ expected: NMBComparable?) -> NMBObjCMatcher { 36 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 37 | let expr = actualExpression.cast { $0 as? NMBComparable } 38 | return try! beGreaterThan(expected).matches(expr, failureMessage: failureMessage) 39 | } 40 | } 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is greater than 4 | /// or equal to the expected value. 5 | public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> NonNilMatcherFunc { 6 | return NonNilMatcherFunc { actualExpression, failureMessage in 7 | failureMessage.postfixMessage = "be greater than or equal to <\(stringify(expectedValue))>" 8 | let actualValue = try actualExpression.evaluate() 9 | if let actual = actualValue, let expected = expectedValue { 10 | return actual >= expected 11 | } 12 | return false 13 | } 14 | } 15 | 16 | /// A Nimble matcher that succeeds when the actual value is greater than 17 | /// or equal to the expected value. 18 | public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> NonNilMatcherFunc { 19 | return NonNilMatcherFunc { actualExpression, failureMessage in 20 | failureMessage.postfixMessage = "be greater than or equal to <\(stringify(expectedValue))>" 21 | let actualValue = try actualExpression.evaluate() 22 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) != ComparisonResult.orderedAscending 23 | return matches 24 | } 25 | } 26 | 27 | public func >=(lhs: Expectation, rhs: T) { 28 | lhs.to(beGreaterThanOrEqualTo(rhs)) 29 | } 30 | 31 | public func >=(lhs: Expectation, rhs: T) { 32 | lhs.to(beGreaterThanOrEqualTo(rhs)) 33 | } 34 | 35 | #if _runtime(_ObjC) 36 | extension NMBObjCMatcher { 37 | public class func beGreaterThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBObjCMatcher { 38 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 39 | let expr = actualExpression.cast { $0 as? NMBComparable } 40 | return try! beGreaterThanOrEqualTo(expected).matches(expr, failureMessage: failureMessage) 41 | } 42 | } 43 | } 44 | #endif 45 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/BeIdenticalTo.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | 4 | /// A Nimble matcher that succeeds when the actual value is the same instance 5 | /// as the expected instance. 6 | public func beIdenticalTo(_ expected: Any?) -> NonNilMatcherFunc { 7 | return NonNilMatcherFunc { actualExpression, failureMessage in 8 | #if os(Linux) 9 | let actual = try actualExpression.evaluate() as? AnyObject 10 | #else 11 | let actual = try actualExpression.evaluate() as AnyObject? 12 | #endif 13 | failureMessage.actualValue = "\(identityAsString(actual))" 14 | failureMessage.postfixMessage = "be identical to \(identityAsString(expected))" 15 | #if os(Linux) 16 | return actual === (expected as? AnyObject) && actual !== nil 17 | #else 18 | return actual === (expected as AnyObject?) && actual !== nil 19 | #endif 20 | } 21 | } 22 | 23 | public func ===(lhs: Expectation, rhs: Any?) { 24 | lhs.to(beIdenticalTo(rhs)) 25 | } 26 | public func !==(lhs: Expectation, rhs: Any?) { 27 | lhs.toNot(beIdenticalTo(rhs)) 28 | } 29 | 30 | /// A Nimble matcher that succeeds when the actual value is the same instance 31 | /// as the expected instance. 32 | /// 33 | /// Alias for "beIdenticalTo". 34 | public func be(_ expected: Any?) -> NonNilMatcherFunc { 35 | return beIdenticalTo(expected) 36 | } 37 | 38 | #if _runtime(_ObjC) 39 | extension NMBObjCMatcher { 40 | public class func beIdenticalToMatcher(_ expected: NSObject?) -> NMBObjCMatcher { 41 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 42 | let aExpr = actualExpression.cast { $0 as Any? } 43 | return try! beIdenticalTo(expected).matches(aExpr, failureMessage: failureMessage) 44 | } 45 | } 46 | } 47 | #endif 48 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/BeLessThan.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is less than the expected value. 4 | public func beLessThan(_ expectedValue: T?) -> NonNilMatcherFunc { 5 | return NonNilMatcherFunc { actualExpression, failureMessage in 6 | failureMessage.postfixMessage = "be less than <\(stringify(expectedValue))>" 7 | if let actual = try actualExpression.evaluate(), let expected = expectedValue { 8 | return actual < expected 9 | } 10 | return false 11 | } 12 | } 13 | 14 | /// A Nimble matcher that succeeds when the actual value is less than the expected value. 15 | public func beLessThan(_ expectedValue: NMBComparable?) -> NonNilMatcherFunc { 16 | return NonNilMatcherFunc { actualExpression, failureMessage in 17 | failureMessage.postfixMessage = "be less than <\(stringify(expectedValue))>" 18 | let actualValue = try actualExpression.evaluate() 19 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedAscending 20 | return matches 21 | } 22 | } 23 | 24 | public func <(lhs: Expectation, rhs: T) { 25 | lhs.to(beLessThan(rhs)) 26 | } 27 | 28 | public func <(lhs: Expectation, rhs: NMBComparable?) { 29 | lhs.to(beLessThan(rhs)) 30 | } 31 | 32 | #if _runtime(_ObjC) 33 | extension NMBObjCMatcher { 34 | public class func beLessThanMatcher(_ expected: NMBComparable?) -> NMBObjCMatcher { 35 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 36 | let expr = actualExpression.cast { $0 as! NMBComparable? } 37 | return try! beLessThan(expected).matches(expr, failureMessage: failureMessage) 38 | } 39 | } 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/BeLessThanOrEqual.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is less than 4 | /// or equal to the expected value. 5 | public func beLessThanOrEqualTo(_ expectedValue: T?) -> NonNilMatcherFunc { 6 | return NonNilMatcherFunc { actualExpression, failureMessage in 7 | failureMessage.postfixMessage = "be less than or equal to <\(stringify(expectedValue))>" 8 | if let actual = try actualExpression.evaluate(), let expected = expectedValue { 9 | return actual <= expected 10 | } 11 | return false 12 | } 13 | } 14 | 15 | /// A Nimble matcher that succeeds when the actual value is less than 16 | /// or equal to the expected value. 17 | public func beLessThanOrEqualTo(_ expectedValue: T?) -> NonNilMatcherFunc { 18 | return NonNilMatcherFunc { actualExpression, failureMessage in 19 | failureMessage.postfixMessage = "be less than or equal to <\(stringify(expectedValue))>" 20 | let actualValue = try actualExpression.evaluate() 21 | return actualValue != nil && actualValue!.NMB_compare(expectedValue) != ComparisonResult.orderedDescending 22 | } 23 | } 24 | 25 | public func <=(lhs: Expectation, rhs: T) { 26 | lhs.to(beLessThanOrEqualTo(rhs)) 27 | } 28 | 29 | public func <=(lhs: Expectation, rhs: T) { 30 | lhs.to(beLessThanOrEqualTo(rhs)) 31 | } 32 | 33 | #if _runtime(_ObjC) 34 | extension NMBObjCMatcher { 35 | public class func beLessThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBObjCMatcher { 36 | return NMBObjCMatcher(canMatchNil:false) { actualExpression, failureMessage in 37 | let expr = actualExpression.cast { $0 as? NMBComparable } 38 | return try! beLessThanOrEqualTo(expected).matches(expr, failureMessage: failureMessage) 39 | } 40 | } 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/BeNil.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is nil. 4 | public func beNil() -> MatcherFunc { 5 | return MatcherFunc { actualExpression, failureMessage in 6 | failureMessage.postfixMessage = "be nil" 7 | let actualValue = try actualExpression.evaluate() 8 | return actualValue == nil 9 | } 10 | } 11 | 12 | #if _runtime(_ObjC) 13 | extension NMBObjCMatcher { 14 | public class func beNilMatcher() -> NMBObjCMatcher { 15 | return NMBObjCMatcher { actualExpression, failureMessage in 16 | return try! beNil().matches(actualExpression, failureMessage: failureMessage) 17 | } 18 | } 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/BeVoid.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is Void. 4 | public func beVoid() -> MatcherFunc<()> { 5 | return MatcherFunc { actualExpression, failureMessage in 6 | failureMessage.postfixMessage = "be void" 7 | let actualValue: ()? = try actualExpression.evaluate() 8 | return actualValue != nil 9 | } 10 | } 11 | 12 | public func ==(lhs: Expectation<()>, rhs: ()) { 13 | lhs.to(beVoid()) 14 | } 15 | 16 | public func !=(lhs: Expectation<()>, rhs: ()) { 17 | lhs.toNot(beVoid()) 18 | } -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/Match.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | #if _runtime(_ObjC) 4 | 5 | /// A Nimble matcher that succeeds when the actual string satisfies the regular expression 6 | /// described by the expected string. 7 | public func match(_ expectedValue: String?) -> NonNilMatcherFunc { 8 | return NonNilMatcherFunc { actualExpression, failureMessage in 9 | failureMessage.postfixMessage = "match <\(stringify(expectedValue))>" 10 | 11 | if let actual = try actualExpression.evaluate() { 12 | if let regexp = expectedValue { 13 | return actual.range(of: regexp, options: .regularExpression) != nil 14 | } 15 | } 16 | 17 | return false 18 | } 19 | } 20 | 21 | extension NMBObjCMatcher { 22 | public class func matchMatcher(_ expected: NSString) -> NMBMatcher { 23 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 24 | let actual = actualExpression.cast { $0 as? String } 25 | return try! match(expected.description).matches(actual, failureMessage: failureMessage) 26 | } 27 | } 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Matchers/MatchError.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual expression evaluates to an 4 | /// error from the specified case. 5 | /// 6 | /// Errors are tried to be compared by their implementation of Equatable, 7 | /// otherwise they fallback to comparision by _domain and _code. 8 | public func matchError(_ error: T) -> NonNilMatcherFunc { 9 | return NonNilMatcherFunc { actualExpression, failureMessage in 10 | let actualError: Error? = try actualExpression.evaluate() 11 | 12 | setFailureMessageForError(failureMessage, postfixMessageVerb: "match", actualError: actualError, error: error) 13 | return errorMatchesNonNilFieldsOrClosure(actualError, error: error) 14 | } 15 | } 16 | 17 | /// A Nimble matcher that succeeds when the actual expression evaluates to an 18 | /// error of the specified type 19 | public func matchError(_ errorType: T.Type) -> NonNilMatcherFunc { 20 | return NonNilMatcherFunc { actualExpression, failureMessage in 21 | let actualError: Error? = try actualExpression.evaluate() 22 | 23 | setFailureMessageForError(failureMessage, postfixMessageVerb: "match", actualError: actualError, errorType: errorType) 24 | return errorMatchesNonNilFieldsOrClosure(actualError, errorType: errorType) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Nimble.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "NMBExceptionCapture.h" 3 | #import "NMBStringify.h" 4 | #import "DSL.h" 5 | 6 | FOUNDATION_EXPORT double NimbleVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[]; 8 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Utils/Functional.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Sequence { 4 | internal func all(_ fn: (Iterator.Element) -> Bool) -> Bool { 5 | for item in self { 6 | if !fn(item) { 7 | return false 8 | } 9 | } 10 | return true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/Nimble/Utils/SourceLocation.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // Ideally we would always use `StaticString` as the type for tracking the file name 4 | // that expectations originate from, for consistency with `assert` etc. from the 5 | // stdlib, and because recent versions of the XCTest overlay require `StaticString` 6 | // when calling `XCTFail`. Under the Objective-C runtime (i.e. building on Mac), we 7 | // have to use `String` instead because StaticString can't be generated from Objective-C 8 | #if _runtime(_ObjC) 9 | public typealias FileString = String 10 | #else 11 | public typealias FileString = StaticString 12 | #endif 13 | 14 | public final class SourceLocation : NSObject { 15 | public let file: FileString 16 | public let line: UInt 17 | 18 | override init() { 19 | file = "Unknown File" 20 | line = 0 21 | } 22 | 23 | init(file: FileString, line: UInt) { 24 | self.file = file 25 | self.line = line 26 | } 27 | 28 | override public var description: String { 29 | return "\(file):\(line)" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/NimbleObjectiveC/CurrentTestCaseTracker.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | SWIFT_CLASS("_TtC6Nimble22CurrentTestCaseTracker") 5 | @interface CurrentTestCaseTracker : NSObject 6 | + (CurrentTestCaseTracker *)sharedInstance; 7 | @end 8 | 9 | @interface CurrentTestCaseTracker (Register) @end 10 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface NMBExceptionCapture : NSObject 5 | 6 | - (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)())finally; 7 | - (void)tryBlock:(void(^ _Nonnull)())unsafeBlock NS_SWIFT_NAME(tryBlock(_:)); 8 | 9 | @end 10 | 11 | typedef void(^NMBSourceCallbackBlock)(BOOL successful); 12 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.m: -------------------------------------------------------------------------------- 1 | #import "NMBExceptionCapture.h" 2 | 3 | @interface NMBExceptionCapture () 4 | @property (nonatomic, copy) void(^ _Nullable handler)(NSException * _Nullable); 5 | @property (nonatomic, copy) void(^ _Nullable finally)(); 6 | @end 7 | 8 | @implementation NMBExceptionCapture 9 | 10 | - (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)())finally { 11 | self = [super init]; 12 | if (self) { 13 | self.handler = handler; 14 | self.finally = finally; 15 | } 16 | return self; 17 | } 18 | 19 | - (void)tryBlock:(void(^ _Nonnull)())unsafeBlock { 20 | @try { 21 | unsafeBlock(); 22 | } 23 | @catch (NSException *exception) { 24 | if (self.handler) { 25 | self.handler(exception); 26 | } 27 | } 28 | @finally { 29 | if (self.finally) { 30 | self.finally(); 31 | } 32 | } 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.h: -------------------------------------------------------------------------------- 1 | @class NSString; 2 | 3 | /** 4 | * Returns a string appropriate for displaying in test output 5 | * from the provided value. 6 | * 7 | * @param value A value that will show up in a test's output. 8 | * 9 | * @return The string that is returned can be 10 | * customized per type by conforming a type to the `TestOutputStringConvertible` 11 | * protocol. When stringifying a non-`TestOutputStringConvertible` type, this 12 | * function will return the value's debug description and then its 13 | * normal description if available and in that order. Otherwise it 14 | * will return the result of constructing a string from the value. 15 | * 16 | * @see `TestOutputStringConvertible` 17 | */ 18 | extern NSString *_Nonnull NMBStringify(id _Nullable anyObject) __attribute__((warn_unused_result)); 19 | -------------------------------------------------------------------------------- /Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.m: -------------------------------------------------------------------------------- 1 | #import "NMBStringify.h" 2 | #import 3 | 4 | NSString *_Nonnull NMBStringify(id _Nullable anyObject) { 5 | return [NMBStringer stringify:anyObject]; 6 | } 7 | -------------------------------------------------------------------------------- /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/ObjectMapper/Transforms/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-2015 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/ObjectMapper/Transforms/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-2015 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 | public 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 | public func transformToJSON(_ value: Data?) -> String? { 45 | guard let data = value else{ 46 | return nil 47 | } 48 | return data.base64EncodedString() 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/ObjectMapper/Transforms/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-2015 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 | let dateFormatter: DateFormatter 36 | 37 | public init(dateFormatter: DateFormatter) { 38 | self.dateFormatter = dateFormatter 39 | } 40 | 41 | public 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 | public 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/ObjectMapper/Transforms/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-2015 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 | public 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 | public func transformToJSON(_ value: Date?) -> Double? { 50 | if let date = value { 51 | return Double(date.timeIntervalSince1970) 52 | } 53 | return nil 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/ObjectMapper/Transforms/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/ObjectMapper/Transforms/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-2015 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 | public 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 | public func transformToJSON(_ value: T?) -> T.RawValue? { 45 | if let obj = value { 46 | return obj.rawValue 47 | } 48 | return nil 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/ObjectMapper/Transforms/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-2015 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/ObjectMapper/Transforms/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-2015 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 | public 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 | public func transformToJSON(_ value: NSDecimalNumber?) -> String? { 48 | guard let value = value else { return nil } 49 | return value.description 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/ObjectMapper/Transforms/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-2015 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 | public func transformFromJSON(_ value: Any?) -> ObjectType? { 42 | return fromJSON(value as? JSONType) 43 | } 44 | 45 | public func transformToJSON(_ value: ObjectType?) -> JSONType? { 46 | return toJSON(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Pods/ObjectMapper/ObjectMapper/Transforms/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-2015 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/Quick/Sources/Quick/Callsite.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /** 4 | An object encapsulating the file and line number at which 5 | a particular example is defined. 6 | */ 7 | final public class Callsite: NSObject { 8 | /** 9 | The absolute path of the file in which an example is defined. 10 | */ 11 | public let file: String 12 | 13 | /** 14 | The line number on which an example is defined. 15 | */ 16 | public let line: UInt 17 | 18 | internal init(file: String, line: UInt) { 19 | self.file = file 20 | self.line = line 21 | } 22 | } 23 | 24 | /** 25 | Returns a boolean indicating whether two Callsite objects are equal. 26 | If two callsites are in the same file and on the same line, they must be equal. 27 | */ 28 | public func ==(lhs: Callsite, rhs: Callsite) -> Bool { 29 | return lhs.file == rhs.file && lhs.line == rhs.line 30 | } 31 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/ErrorUtility.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | internal func raiseError(_ message: String) -> Never { 4 | #if _runtime(_ObjC) 5 | NSException(name: .internalInconsistencyException, reason: message, userInfo: nil).raise() 6 | #endif 7 | 8 | // This won't be reached when ObjC is available and the exception above is raisd 9 | fatalError(message) 10 | } 11 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/ExampleMetadata.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /** 4 | A class that encapsulates information about an example, 5 | including the index at which the example was executed, as 6 | well as the example itself. 7 | */ 8 | final public class ExampleMetadata: NSObject { 9 | /** 10 | The example for which this metadata was collected. 11 | */ 12 | public let example: Example 13 | 14 | /** 15 | The index at which this example was executed in the 16 | test suite. 17 | */ 18 | public let exampleIndex: Int 19 | 20 | internal init(example: Example, exampleIndex: Int) { 21 | self.example = example 22 | self.exampleIndex = exampleIndex 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Filter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /** 4 | A mapping of string keys to booleans that can be used to 5 | filter examples or example groups. For example, a "focused" 6 | example would have the flags [Focused: true]. 7 | */ 8 | public typealias FilterFlags = [String: Bool] 9 | 10 | /** 11 | A namespace for filter flag keys, defined primarily to make the 12 | keys available in Objective-C. 13 | */ 14 | final public class Filter: NSObject { 15 | /** 16 | Example and example groups with [Focused: true] are included in test runs, 17 | excluding all other examples without this flag. Use this to only run one or 18 | two tests that you're currently focusing on. 19 | */ 20 | public class var focused: String { 21 | return "focused" 22 | } 23 | 24 | /** 25 | Example and example groups with [Pending: true] are excluded from test runs. 26 | Use this to temporarily suspend examples that you know do not pass yet. 27 | */ 28 | public class var pending: String { 29 | return "pending" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Hooks/Closures.swift: -------------------------------------------------------------------------------- 1 | // MARK: Example Hooks 2 | 3 | /** 4 | A closure executed before an example is run. 5 | */ 6 | public typealias BeforeExampleClosure = () -> () 7 | 8 | /** 9 | A closure executed before an example is run. The closure is given example metadata, 10 | which contains information about the example that is about to be run. 11 | */ 12 | public typealias BeforeExampleWithMetadataClosure = (_ exampleMetadata: ExampleMetadata) -> () 13 | 14 | /** 15 | A closure executed after an example is run. 16 | */ 17 | public typealias AfterExampleClosure = BeforeExampleClosure 18 | 19 | /** 20 | A closure executed after an example is run. The closure is given example metadata, 21 | which contains information about the example that has just finished running. 22 | */ 23 | public typealias AfterExampleWithMetadataClosure = BeforeExampleWithMetadataClosure 24 | 25 | // MARK: Suite Hooks 26 | 27 | /** 28 | A closure executed before any examples are run. 29 | */ 30 | public typealias BeforeSuiteClosure = () -> () 31 | 32 | /** 33 | A closure executed after all examples have finished running. 34 | */ 35 | public typealias AfterSuiteClosure = BeforeSuiteClosure 36 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Hooks/ExampleHooks.swift: -------------------------------------------------------------------------------- 1 | /** 2 | A container for closures to be executed before and after each example. 3 | */ 4 | final internal class ExampleHooks { 5 | internal var befores: [BeforeExampleWithMetadataClosure] = [] 6 | internal var afters: [AfterExampleWithMetadataClosure] = [] 7 | internal var phase: HooksPhase = .nothingExecuted 8 | 9 | internal func appendBefore(_ closure: @escaping BeforeExampleWithMetadataClosure) { 10 | befores.append(closure) 11 | } 12 | 13 | internal func appendBefore(_ closure: @escaping BeforeExampleClosure) { 14 | befores.append { (exampleMetadata: ExampleMetadata) in closure() } 15 | } 16 | 17 | internal func appendAfter(_ closure: @escaping AfterExampleWithMetadataClosure) { 18 | afters.append(closure) 19 | } 20 | 21 | internal func appendAfter(_ closure: @escaping AfterExampleClosure) { 22 | afters.append { (exampleMetadata: ExampleMetadata) in closure() } 23 | } 24 | 25 | internal func executeBefores(_ exampleMetadata: ExampleMetadata) { 26 | phase = .beforesExecuting 27 | for before in befores { 28 | before(exampleMetadata) 29 | } 30 | 31 | phase = .beforesFinished 32 | } 33 | 34 | internal func executeAfters(_ exampleMetadata: ExampleMetadata) { 35 | phase = .aftersExecuting 36 | for after in afters { 37 | after(exampleMetadata) 38 | } 39 | 40 | phase = .aftersFinished 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Hooks/HooksPhase.swift: -------------------------------------------------------------------------------- 1 | /** 2 | A description of the execution cycle of the current example with 3 | respect to the hooks of that example. 4 | */ 5 | internal enum HooksPhase { 6 | case nothingExecuted 7 | case beforesExecuting 8 | case beforesFinished 9 | case aftersExecuting 10 | case aftersFinished 11 | } 12 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Hooks/SuiteHooks.swift: -------------------------------------------------------------------------------- 1 | /** 2 | A container for closures to be executed before and after all examples. 3 | */ 4 | final internal class SuiteHooks { 5 | internal var befores: [BeforeSuiteClosure] = [] 6 | internal var afters: [AfterSuiteClosure] = [] 7 | internal var phase: HooksPhase = .nothingExecuted 8 | 9 | internal func appendBefore(_ closure: @escaping BeforeSuiteClosure) { 10 | befores.append(closure) 11 | } 12 | 13 | internal func appendAfter(_ closure: @escaping AfterSuiteClosure) { 14 | afters.append(closure) 15 | } 16 | 17 | internal func executeBefores() { 18 | phase = .beforesExecuting 19 | for before in befores { 20 | before() 21 | } 22 | phase = .beforesFinished 23 | } 24 | 25 | internal func executeAfters() { 26 | phase = .aftersExecuting 27 | for after in afters { 28 | after() 29 | } 30 | phase = .aftersFinished 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift: -------------------------------------------------------------------------------- 1 | #if os(OSX) || os(iOS) || os(watchOS) || os(tvOS) 2 | 3 | import Foundation 4 | 5 | extension Bundle { 6 | 7 | /** 8 | Locates the first bundle with a '.xctest' file extension. 9 | */ 10 | internal static var currentTestBundle: Bundle? { 11 | return allBundles.first { $0.bundlePath.hasSuffix(".xctest") } 12 | } 13 | 14 | } 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/QuickTestSuite.swift: -------------------------------------------------------------------------------- 1 | #if os(OSX) || os(iOS) || os(watchOS) || os(tvOS) 2 | 3 | import XCTest 4 | 5 | /** 6 | This protocol defines the role of an object that builds test suites. 7 | */ 8 | internal protocol QuickTestSuiteBuilder { 9 | 10 | /** 11 | Construct a `QuickTestSuite` instance with the appropriate test cases added as tests. 12 | 13 | Subsequent calls to this method should return equivalent test suites. 14 | */ 15 | func buildTestSuite() -> QuickTestSuite 16 | 17 | } 18 | 19 | /** 20 | A base class for a class cluster of Quick test suites, that should correctly 21 | build dynamic test suites for XCTest to execute. 22 | */ 23 | public class QuickTestSuite: XCTestSuite { 24 | 25 | private static var builtTestSuites: Set = Set() 26 | 27 | /** 28 | Construct a test suite for a specific, selected subset of test cases (rather 29 | than the default, which as all test cases). 30 | 31 | If this method is called multiple times for the same test case class, e.g.. 32 | 33 | FooSpec/testFoo 34 | FooSpec/testBar 35 | 36 | It is expected that the first call should return a valid test suite, and 37 | all subsequent calls should return `nil`. 38 | */ 39 | public static func selectedTestSuite(forTestCaseWithName name: String) -> QuickTestSuite? { 40 | guard let builder = QuickSelectedTestSuiteBuilder(forTestCaseWithName: name) else { return nil } 41 | 42 | if builtTestSuites.contains(builder.testSuiteClassName) { 43 | return nil 44 | } else { 45 | builtTestSuites.insert(builder.testSuiteClassName) 46 | return builder.buildTestSuite() 47 | } 48 | } 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/String+FileName.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension String { 4 | 5 | /** 6 | If the receiver represents a path, returns its file name with a file extension. 7 | */ 8 | var fileName: String? { 9 | return NSURL(string: self)?.deletingPathExtension?.lastPathComponent 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class Configuration; 4 | 5 | /** 6 | Subclass QuickConfiguration and override the +[QuickConfiguration configure:] 7 | method in order to configure how Quick behaves when running specs, or to define 8 | shared examples that are used across spec files. 9 | */ 10 | @interface QuickConfiguration : NSObject 11 | 12 | /** 13 | This method is executed on each subclass of this class before Quick runs 14 | any examples. You may override this method on as many subclasses as you like, but 15 | there is no guarantee as to the order in which these methods are executed. 16 | 17 | You can override this method in order to: 18 | 19 | 1. Configure how Quick behaves, by modifying properties on the Configuration object. 20 | Setting the same properties in several methods has undefined behavior. 21 | 22 | 2. Define shared examples using `sharedExamples`. 23 | 24 | @param configuration A mutable object that is used to configure how Quick behaves on 25 | a framework level. For details on all the options, see the 26 | documentation in Configuration.swift. 27 | */ 28 | + (void)configure:(Configuration *)configuration; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/DSL/World+DSL.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface World (SWIFT_EXTENSION(Quick)) 4 | - (void)beforeSuite:(void (^ __nonnull)(void))closure; 5 | - (void)afterSuite:(void (^ __nonnull)(void))closure; 6 | - (void)sharedExamples:(NSString * __nonnull)name closure:(void (^ __nonnull)(NSDictionary * __nonnull (^ __nonnull)(void)))closure; 7 | - (void)describe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 8 | - (void)context:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 9 | - (void)fdescribe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 10 | - (void)xdescribe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 11 | - (void)beforeEach:(void (^ __nonnull)(void))closure; 12 | - (void)beforeEachWithMetadata:(void (^ __nonnull)(ExampleMetadata * __nonnull))closure; 13 | - (void)afterEach:(void (^ __nonnull)(void))closure; 14 | - (void)afterEachWithMetadata:(void (^ __nonnull)(ExampleMetadata * __nonnull))closure; 15 | - (void)itWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure; 16 | - (void)fitWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure; 17 | - (void)xitWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure; 18 | - (void)itBehavesLikeSharedExampleNamed:(NSString * __nonnull)name sharedExampleContext:(NSDictionary * __nonnull (^ __nonnull)(void))sharedExampleContext flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line; 19 | - (void)pending:(NSString * __nonnull)description closure:(void (^ __nonnull)(void))closure; 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/NSString+QCKSelectorName.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | QuickSpec converts example names into test methods. 5 | Those test methods need valid selector names, which means no whitespace, 6 | control characters, etc. This category gives NSString objects an easy way 7 | to replace those illegal characters with underscores. 8 | */ 9 | @interface NSString (QCKSelectorName) 10 | 11 | /** 12 | Returns a string with underscores in place of all characters that cannot 13 | be included in a selector (SEL) name. 14 | */ 15 | @property (nonatomic, readonly) NSString *qck_selectorName; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/NSString+QCKSelectorName.m: -------------------------------------------------------------------------------- 1 | #import "NSString+QCKSelectorName.h" 2 | 3 | @implementation NSString (QCKSelectorName) 4 | 5 | - (NSString *)qck_selectorName { 6 | static NSMutableCharacterSet *invalidCharacters = nil; 7 | static dispatch_once_t onceToken; 8 | dispatch_once(&onceToken, ^{ 9 | invalidCharacters = [NSMutableCharacterSet new]; 10 | 11 | NSCharacterSet *whitespaceCharacterSet = [NSCharacterSet whitespaceCharacterSet]; 12 | NSCharacterSet *newlineCharacterSet = [NSCharacterSet newlineCharacterSet]; 13 | NSCharacterSet *illegalCharacterSet = [NSCharacterSet illegalCharacterSet]; 14 | NSCharacterSet *controlCharacterSet = [NSCharacterSet controlCharacterSet]; 15 | NSCharacterSet *punctuationCharacterSet = [NSCharacterSet punctuationCharacterSet]; 16 | NSCharacterSet *nonBaseCharacterSet = [NSCharacterSet nonBaseCharacterSet]; 17 | NSCharacterSet *symbolCharacterSet = [NSCharacterSet symbolCharacterSet]; 18 | 19 | [invalidCharacters formUnionWithCharacterSet:whitespaceCharacterSet]; 20 | [invalidCharacters formUnionWithCharacterSet:newlineCharacterSet]; 21 | [invalidCharacters formUnionWithCharacterSet:illegalCharacterSet]; 22 | [invalidCharacters formUnionWithCharacterSet:controlCharacterSet]; 23 | [invalidCharacters formUnionWithCharacterSet:punctuationCharacterSet]; 24 | [invalidCharacters formUnionWithCharacterSet:nonBaseCharacterSet]; 25 | [invalidCharacters formUnionWithCharacterSet:symbolCharacterSet]; 26 | }); 27 | 28 | NSArray *validComponents = [self componentsSeparatedByCharactersInSet:invalidCharacters]; 29 | 30 | NSString *result = [validComponents componentsJoinedByString:@"_"]; 31 | 32 | return ([result length] == 0 33 | ? @"_" 34 | : result); 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/Quick.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for Quick. 4 | FOUNDATION_EXPORT double QuickVersionNumber; 5 | 6 | //! Project version string for Quick. 7 | FOUNDATION_EXPORT const unsigned char QuickVersionString[]; 8 | 9 | #import "QuickSpec.h" 10 | #import "QCKDSL.h" 11 | #import "QuickConfiguration.h" 12 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/QuickSpec.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | QuickSpec is a base class all specs written in Quick inherit from. 5 | They need to inherit from QuickSpec, a subclass of XCTestCase, in 6 | order to be discovered by the XCTest framework. 7 | 8 | XCTest automatically compiles a list of XCTestCase subclasses included 9 | in the test target. It iterates over each class in that list, and creates 10 | a new instance of that class for each test method. It then creates an 11 | "invocation" to execute that test method. The invocation is an instance of 12 | NSInvocation, which represents a single message send in Objective-C. 13 | The invocation is set on the XCTestCase instance, and the test is run. 14 | 15 | Most of the code in QuickSpec is dedicated to hooking into XCTest events. 16 | First, when the spec is first loaded and before it is sent any messages, 17 | the +[NSObject initialize] method is called. QuickSpec overrides this method 18 | to call +[QuickSpec spec]. This builds the example group stacks and 19 | registers them with Quick.World, a global register of examples. 20 | 21 | Then, XCTest queries QuickSpec for a list of test methods. Normally, XCTest 22 | automatically finds all methods whose selectors begin with the string "test". 23 | However, QuickSpec overrides this default behavior by implementing the 24 | +[XCTestCase testInvocations] method. This method iterates over each example 25 | registered in Quick.World, defines a new method for that example, and 26 | returns an invocation to call that method to XCTest. Those invocations are 27 | the tests that are run by XCTest. Their selector names are displayed in 28 | the Xcode test navigation bar. 29 | */ 30 | @interface QuickSpec : XCTestCase 31 | 32 | /** 33 | Override this method in your spec to define a set of example groups 34 | and examples. 35 | 36 | @code 37 | override func spec() { 38 | describe("winter") { 39 | it("is coming") { 40 | // ... 41 | } 42 | } 43 | } 44 | @endcode 45 | 46 | See DSL.swift for more information on what syntax is available. 47 | */ 48 | - (void)spec; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/World.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class ExampleGroup; 4 | @class ExampleMetadata; 5 | 6 | SWIFT_CLASS("_TtC5Quick5World") 7 | @interface World 8 | 9 | @property (nonatomic) ExampleGroup * __nullable currentExampleGroup; 10 | @property (nonatomic) ExampleMetadata * __nullable currentExampleMetadata; 11 | @property (nonatomic) BOOL isRunningAdditionalSuites; 12 | + (World * __nonnull)sharedWorld; 13 | - (void)configure:(void (^ __nonnull)(Configuration * __nonnull))closure; 14 | - (void)finalizeConfiguration; 15 | - (ExampleGroup * __nonnull)rootExampleGroupForSpecClass:(Class __nonnull)cls; 16 | - (NSArray * __nonnull)examplesForSpecClass:(Class __nonnull)specClass; 17 | - (void)performWithCurrentExampleGroup:(ExampleGroup * __nonnull)group closure:(void (^ __nonnull)(void))closure; 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | 5 | @interface XCTestSuite (QuickTestSuiteBuilder) 6 | @end 7 | 8 | @implementation XCTestSuite (QuickTestSuiteBuilder) 9 | 10 | /** 11 | In order to ensure we can correctly build dynamic test suites, we need to 12 | replace some of the default test suite constructors. 13 | */ 14 | + (void)load { 15 | Method testCaseWithName = class_getClassMethod(self, @selector(testSuiteForTestCaseWithName:)); 16 | Method hooked_testCaseWithName = class_getClassMethod(self, @selector(qck_hooked_testSuiteForTestCaseWithName:)); 17 | method_exchangeImplementations(testCaseWithName, hooked_testCaseWithName); 18 | } 19 | 20 | /** 21 | The `+testSuiteForTestCaseWithName:` method is called when a specific test case 22 | class is run from the Xcode test navigator. If the built test suite is `nil`, 23 | Xcode will not run any tests for that test case. 24 | 25 | Given if the following test case class is run from the Xcode test navigator: 26 | 27 | FooSpec 28 | testFoo 29 | testBar 30 | 31 | XCTest will invoke this once per test case, with test case names following this format: 32 | 33 | FooSpec/testFoo 34 | FooSpec/testBar 35 | */ 36 | + (nullable instancetype)qck_hooked_testSuiteForTestCaseWithName:(nonnull NSString *)name { 37 | return [QuickTestSuite selectedTestSuiteForTestCaseWithName:name]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Sequence that repeats `repeatedValue` infinite number of times. 12 | struct InfiniteSequence : Sequence { 13 | typealias Element = E 14 | typealias Iterator = AnyIterator 15 | 16 | private let _repeatedValue: E 17 | 18 | init(repeatedValue: E) { 19 | _repeatedValue = repeatedValue 20 | } 21 | 22 | func makeIterator() -> Iterator { 23 | let repeatedValue = _repeatedValue 24 | return AnyIterator { 25 | return repeatedValue 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /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 Foundation 10 | import Dispatch 11 | 12 | extension DispatchQueue { 13 | private static var token: DispatchSpecificKey<()> = { 14 | let key = DispatchSpecificKey<()>() 15 | DispatchQueue.main.setSpecific(key: key, value: ()) 16 | return key 17 | }() 18 | 19 | static var isMain: Bool { 20 | return DispatchQueue.getSpecific(key: token) != nil 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /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 Foundation 13 | 14 | typealias AtomicInt = Int32 15 | 16 | let AtomicCompareAndSwap = OSAtomicCompareAndSwap32Barrier 17 | let AtomicIncrement = OSAtomicIncrement32Barrier 18 | let AtomicDecrement = OSAtomicDecrement32Barrier 19 | 20 | extension Thread { 21 | 22 | static func setThreadLocalStorageValue(_ value: T?, forKey key: String 23 | ) { 24 | let currentThread = Thread.current 25 | let threadDictionary = currentThread.threadDictionary 26 | 27 | if let newValue = value { 28 | threadDictionary[key] = newValue 29 | } 30 | else { 31 | threadDictionary[key] = nil 32 | } 33 | 34 | } 35 | static func getThreadLocalStorageValueForKey(_ key: String) -> T? { 36 | let currentThread = Thread.current 37 | let threadDictionary = currentThread.threadDictionary 38 | 39 | return threadDictionary[key] as? T 40 | } 41 | } 42 | 43 | extension AtomicInt { 44 | func valueSnapshot() -> Int32 { 45 | return self 46 | } 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Represents disposable resource with state tracking. 12 | public protocol Cancelable : Disposable { 13 | /// Was resource disposed. 14 | var isDisposed: Bool { get } 15 | } 16 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | protocol Lock { 12 | func lock() 13 | func unlock() 14 | } 15 | 16 | // https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html 17 | typealias SpinLock = NSRecursiveLock 18 | 19 | extension NSRecursiveLock : Lock { 20 | @inline(__always) 21 | func performLocked(_ action: () -> Void) { 22 | lock(); defer { unlock() } 23 | action() 24 | } 25 | 26 | @inline(__always) 27 | func calculateLocked(_ action: () -> T) -> T { 28 | lock(); defer { unlock() } 29 | return action() 30 | } 31 | 32 | @inline(__always) 33 | func calculateLockedOrFail(_ action: () throws -> T) throws -> T { 34 | lock(); defer { unlock() } 35 | let result = try action() 36 | return result 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | protocol LockOwnerType : class, Lock { 12 | var _lock: NSRecursiveLock { get } 13 | } 14 | 15 | extension LockOwnerType { 16 | func lock() { 17 | _lock.lock() 18 | } 19 | 20 | func unlock() { 21 | _lock.unlock() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | protocol SynchronizedDisposeType : class, Disposable, Lock { 12 | func _synchronized_dispose() 13 | } 14 | 15 | extension SynchronizedDisposeType { 16 | func synchronizedDispose() { 17 | lock(); defer { unlock() } 18 | _synchronized_dispose() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | protocol SynchronizedOnType : class, ObserverType, Lock { 12 | func _synchronized_on(_ event: Event) 13 | } 14 | 15 | extension SynchronizedOnType { 16 | func synchronizedOn(_ event: Event) { 17 | lock(); defer { unlock() } 18 | _synchronized_on(event) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | protocol SynchronizedSubscribeType : class, ObservableType, Lock { 12 | func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == E 13 | } 14 | 15 | extension SynchronizedSubscribeType { 16 | func synchronizedSubscribe(_ observer: O) -> Disposable where O.E == E { 17 | lock(); defer { unlock() } 18 | return _synchronized_subscribe(observer) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | protocol SynchronizedUnsubscribeType : class { 12 | associatedtype DisposeKey 13 | 14 | func synchronizedUnsubscribe(_ disposeKey: DisposeKey) 15 | } 16 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /** 12 | Represents an observable sequence wrapper that can be connected and disconnected from its underlying observable sequence. 13 | */ 14 | public protocol ConnectableObservableType : ObservableType { 15 | /** 16 | 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. 17 | 18 | - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence. 19 | */ 20 | func connect() -> Disposable 21 | } 22 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Respresents a disposable resource. 12 | public protocol Disposable { 13 | /// Dispose resource. 14 | func dispose() 15 | } 16 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Represents an Action-based disposable. 12 | /// 13 | /// When dispose method is called, disposal action will be dereferenced. 14 | fileprivate final class AnonymousDisposable : DisposeBase, Cancelable { 15 | public typealias DisposeAction = () -> Void 16 | 17 | private var _isDisposed: AtomicInt = 0 18 | private var _disposeAction: DisposeAction? 19 | 20 | /// - returns: Was resource disposed. 21 | public var isDisposed: Bool { 22 | return _isDisposed == 1 23 | } 24 | 25 | /// Constructs a new disposable with the given action used for disposal. 26 | /// 27 | /// - parameter disposeAction: Disposal action which will be run upon calling `dispose`. 28 | fileprivate init(_ disposeAction: @escaping DisposeAction) { 29 | _disposeAction = disposeAction 30 | super.init() 31 | } 32 | 33 | // Non-deprecated version of the constructor, used by `Disposables.create(with:)` 34 | fileprivate init(disposeAction: @escaping DisposeAction) { 35 | _disposeAction = disposeAction 36 | super.init() 37 | } 38 | 39 | /// Calls the disposal action if and only if the current instance hasn't been disposed yet. 40 | /// 41 | /// After invoking disposal action, disposal action will be dereferenced. 42 | fileprivate func dispose() { 43 | if AtomicCompareAndSwap(0, 1, &_isDisposed) { 44 | assert(_isDisposed == 1) 45 | 46 | if let action = _disposeAction { 47 | _disposeAction = nil 48 | action() 49 | } 50 | } 51 | } 52 | } 53 | 54 | extension Disposables { 55 | 56 | /// Constructs a new disposable with the given action used for disposal. 57 | /// 58 | /// - parameter dispose: Disposal action which will be run upon calling `dispose`. 59 | public static func create(with dispose: @escaping () -> ()) -> Cancelable { 60 | return AnonymousDisposable(disposeAction: dispose) 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Represents two disposable resources that are disposed together. 12 | private final class BinaryDisposable : DisposeBase, Cancelable { 13 | 14 | private var _isDisposed: AtomicInt = 0 15 | 16 | // state 17 | private var _disposable1: Disposable? 18 | private var _disposable2: Disposable? 19 | 20 | /// - returns: Was resource disposed. 21 | var isDisposed: Bool { 22 | return _isDisposed > 0 23 | } 24 | 25 | /// Constructs new binary disposable from two disposables. 26 | /// 27 | /// - parameter disposable1: First disposable 28 | /// - parameter disposable2: Second disposable 29 | init(_ disposable1: Disposable, _ disposable2: Disposable) { 30 | _disposable1 = disposable1 31 | _disposable2 = disposable2 32 | super.init() 33 | } 34 | 35 | /// Calls the disposal action if and only if the current instance hasn't been disposed yet. 36 | /// 37 | /// After invoking disposal action, disposal action will be dereferenced. 38 | func dispose() { 39 | if AtomicCompareAndSwap(0, 1, &_isDisposed) { 40 | _disposable1?.dispose() 41 | _disposable2?.dispose() 42 | _disposable1 = nil 43 | _disposable2 = nil 44 | } 45 | } 46 | } 47 | 48 | extension Disposables { 49 | 50 | /// Creates a disposable with the given disposables. 51 | public static func create(_ disposable1: Disposable, _ disposable2: Disposable) -> Cancelable { 52 | return BinaryDisposable(disposable1, disposable2) 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Represents a disposable resource that can be checked for disposal status. 12 | public final class BooleanDisposable : Disposable, Cancelable { 13 | 14 | internal static let BooleanDisposableTrue = BooleanDisposable(isDisposed: true) 15 | private var _isDisposed = false 16 | 17 | /// Initializes a new instance of the `BooleanDisposable` class 18 | public init() { 19 | } 20 | 21 | /// Initializes a new instance of the `BooleanDisposable` class with given value 22 | public init(isDisposed: Bool) { 23 | self._isDisposed = isDisposed 24 | } 25 | 26 | /// - returns: Was resource disposed. 27 | public var isDisposed: Bool { 28 | return _isDisposed 29 | } 30 | 31 | /// Sets the status to disposed, which can be observer through the `isDisposed` property. 32 | public func dispose() { 33 | _isDisposed = true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// A collection of utility methods for common disposable operations. 12 | public struct Disposables { 13 | private init() {} 14 | } 15 | 16 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Base class for all disposables. 12 | public class DisposeBase { 13 | init() { 14 | #if TRACE_RESOURCES 15 | let _ = Resources.incrementTotal() 16 | #endif 17 | } 18 | 19 | deinit { 20 | #if TRACE_RESOURCES 21 | let _ = Resources.decrementTotal() 22 | #endif 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Represents a disposable that does nothing on disposal. 12 | /// 13 | /// Nop = No Operation 14 | fileprivate struct NopDisposable : Disposable { 15 | 16 | fileprivate static let noOp: Disposable = NopDisposable() 17 | 18 | fileprivate init() { 19 | 20 | } 21 | 22 | /// Does nothing. 23 | public func dispose() { 24 | } 25 | } 26 | 27 | extension Disposables { 28 | /** 29 | Creates a disposable that does nothing on disposal. 30 | */ 31 | static public func create() -> Disposable { 32 | return NopDisposable.noOp 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | private let disposeScheduledDisposable: (ScheduledDisposable) -> Disposable = { sd in 12 | sd.disposeInner() 13 | return Disposables.create() 14 | } 15 | 16 | /// Represents a disposable resource whose disposal invocation will be scheduled on the specified scheduler. 17 | public final class ScheduledDisposable : Cancelable { 18 | public let scheduler: ImmediateSchedulerType 19 | 20 | private var _isDisposed: AtomicInt = 0 21 | 22 | // state 23 | private var _disposable: Disposable? 24 | 25 | /// - returns: Was resource disposed. 26 | public var isDisposed: Bool { 27 | return _isDisposed == 1 28 | } 29 | 30 | /** 31 | Initializes a new instance of the `ScheduledDisposable` that uses a `scheduler` on which to dispose the `disposable`. 32 | 33 | - parameter scheduler: Scheduler where the disposable resource will be disposed on. 34 | - parameter disposable: Disposable resource to dispose on the given scheduler. 35 | */ 36 | public init(scheduler: ImmediateSchedulerType, disposable: Disposable) { 37 | self.scheduler = scheduler 38 | _disposable = disposable 39 | } 40 | 41 | /// Disposes the wrapped disposable on the provided scheduler. 42 | public func dispose() { 43 | let _ = scheduler.schedule(self, action: disposeScheduledDisposable) 44 | } 45 | 46 | func disposeInner() { 47 | if AtomicCompareAndSwap(0, 1, &_isDisposed) { 48 | _disposable!.dispose() 49 | _disposable = nil 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | struct SubscriptionDisposable : Disposable { 12 | private let _key: T.DisposeKey 13 | private weak var _owner: T? 14 | 15 | init(owner: T, key: T.DisposeKey) { 16 | _owner = owner 17 | _key = key 18 | } 19 | 20 | func dispose() { 21 | _owner?.synchronizedUnsubscribe(_key) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | let RxErrorDomain = "RxErrorDomain" 12 | let RxCompositeFailures = "RxCompositeFailures" 13 | 14 | /// Generic Rx error codes. 15 | public enum RxError 16 | : Swift.Error 17 | , CustomDebugStringConvertible { 18 | /// Unknown error occured. 19 | case unknown 20 | /// Performing an action on disposed object. 21 | case disposed(object: AnyObject) 22 | /// Aritmetic overflow error. 23 | case overflow 24 | /// Argument out of range error. 25 | case argumentOutOfRange 26 | /// Sequence doesn't contain any elements. 27 | case noElements 28 | /// Sequence contains more than one element. 29 | case moreThanOneElement 30 | /// Timeout error. 31 | case timeout 32 | } 33 | 34 | extension RxError { 35 | /// A textual representation of `self`, suitable for debugging. 36 | public var debugDescription: String { 37 | switch self { 38 | case .unknown: 39 | return "Unknown error occured." 40 | case .disposed(let object): 41 | return "Object `\(object)` was already disposed." 42 | case .overflow: 43 | return "Arithmetic overflow occured." 44 | case .argumentOutOfRange: 45 | return "Argument out of range." 46 | case .noElements: 47 | return "Sequence doesn't contain any elements." 48 | case .moreThanOneElement: 49 | return "Sequence contains more than one element." 50 | case .timeout: 51 | return "Sequence timeout." 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Event.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Event.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Represents a sequence event. 12 | /// 13 | /// Sequence grammar: 14 | /// **next\* (error | completed)** 15 | public enum Event { 16 | /// Next element is produced. 17 | case next(Element) 18 | 19 | /// Sequence terminated with an error. 20 | case error(Swift.Error) 21 | 22 | /// Sequence completed successfully. 23 | case completed 24 | } 25 | 26 | extension Event : CustomDebugStringConvertible { 27 | /// - returns: Description of event. 28 | public var debugDescription: String { 29 | switch self { 30 | case .next(let value): 31 | return "next(\(value))" 32 | case .error(let error): 33 | return "error(\(error))" 34 | case .completed: 35 | return "completed" 36 | } 37 | } 38 | } 39 | 40 | extension Event { 41 | /// Is `Completed` or `Error` event. 42 | public var isStopEvent: Bool { 43 | switch self { 44 | case .next: return false 45 | case .error, .completed: return true 46 | } 47 | } 48 | 49 | /// If `Next` event, returns element value. 50 | public var element: Element? { 51 | if case .next(let value) = self { 52 | return value 53 | } 54 | return nil 55 | } 56 | 57 | /// If `Error` event, returns error. 58 | public var error: Swift.Error? { 59 | if case .error(let error) = self { 60 | return error 61 | } 62 | return nil 63 | } 64 | } 65 | 66 | extension Event { 67 | /// Maps sequence elements using transform. If error happens during the transform .error 68 | /// will be returned as value 69 | public func map(_ transform: (Element) throws -> Result) -> Event { 70 | do { 71 | switch self { 72 | case let .next(element): 73 | return .next(try transform(element)) 74 | case let .error(error): 75 | return .error(error) 76 | case .completed: 77 | return .completed 78 | } 79 | } 80 | catch let e { 81 | return .error(e) 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | 12 | // MARK: forEach 13 | 14 | extension Bag where T: ObserverType { 15 | /// Dispatches `event` to app observers contained inside bag. 16 | /// 17 | /// - parameter action: Enumeration closure. 18 | func on(_ event: Event) { 19 | if _onlyFastPath { 20 | _value0?.on(event) 21 | return 22 | } 23 | 24 | let value0 = _value0 25 | let dictionary = _dictionary 26 | 27 | if let value0 = value0 { 28 | value0.on(event) 29 | } 30 | 31 | if let dictionary = dictionary { 32 | for element in dictionary.values { 33 | element.on(event) 34 | } 35 | } 36 | } 37 | } 38 | 39 | /// Dispatches `dispose` to all disposables contained inside bag. 40 | func disposeAll(in bag: Bag) { 41 | if bag._onlyFastPath { 42 | bag._value0?.dispose() 43 | return 44 | } 45 | 46 | let value0 = bag._value0 47 | let dictionary = bag._dictionary 48 | 49 | if let value0 = value0 { 50 | value0.dispose() 51 | } 52 | 53 | if let dictionary = dictionary { 54 | for element in dictionary.values { 55 | element.dispose() 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | extension String { 12 | /// This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)` 13 | func lastIndexOf(_ character: Character) -> Index? { 14 | var index = endIndex 15 | while index > startIndex { 16 | index = self.index(before: index) 17 | if self[index] == character { 18 | return index 19 | } 20 | } 21 | 22 | return nil 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Represents an object that immediately schedules units of work. 12 | public protocol ImmediateSchedulerType { 13 | /** 14 | Schedules an action to be executed immediatelly. 15 | 16 | - parameter state: State passed to the action to be executed. 17 | - parameter action: Action to be executed. 18 | - returns: The disposable object used to cancel the scheduled action (best effort). 19 | */ 20 | func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable 21 | } 22 | 23 | extension ImmediateSchedulerType { 24 | /** 25 | Schedules an action to be executed recursively. 26 | 27 | - parameter state: State passed to the action to be executed. 28 | - 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. 29 | - returns: The disposable object used to cancel the scheduled action (best effort). 30 | */ 31 | public func scheduleRecursive(_ state: State, action: @escaping (_ state: State, _ recurse: (State) -> ()) -> ()) -> Disposable { 32 | let recursiveScheduler = RecursiveImmediateScheduler(action: action, scheduler: self) 33 | 34 | recursiveScheduler.schedule(state) 35 | 36 | return Disposables.create(with: recursiveScheduler.dispose) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// A type-erased `ObservableType`. 12 | /// 13 | /// It represents a push style sequence. 14 | public class Observable : ObservableType { 15 | /// Type of elements in sequence. 16 | public typealias E = Element 17 | 18 | init() { 19 | #if TRACE_RESOURCES 20 | let _ = Resources.incrementTotal() 21 | #endif 22 | } 23 | 24 | public func subscribe(_ observer: O) -> Disposable where O.E == E { 25 | abstractMethod() 26 | } 27 | 28 | public func asObservable() -> Observable { 29 | return self 30 | } 31 | 32 | deinit { 33 | #if TRACE_RESOURCES 34 | let _ = Resources.decrementTotal() 35 | #endif 36 | } 37 | 38 | // this is kind of ugly I know :( 39 | // Swift compiler reports "Not supported yet" when trying to override protocol extensions, so ¯\_(ツ)_/¯ 40 | 41 | /// Optimizations for map operator 42 | internal func composeMap(_ selector: @escaping (Element) throws -> R) -> Observable { 43 | return Map(source: self, transform: selector) 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Type that can be converted to observable sequence (`Observer`). 12 | public protocol ObservableConvertibleType { 13 | /// Type of elements in sequence. 14 | associatedtype E 15 | 16 | /// Converts `self` to `Observable` sequence. 17 | /// 18 | /// - returns: Observable sequence that represents `self`. 19 | func asObservable() -> Observable 20 | } 21 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Represents a push style sequence. 12 | public protocol ObservableType : ObservableConvertibleType { 13 | /// Type of elements in sequence. 14 | associatedtype E 15 | 16 | /** 17 | Subscribes `observer` to receive events for this sequence. 18 | 19 | ### Grammar 20 | 21 | **Next\* (Error | Completed)?** 22 | 23 | * sequences can produce zero or more elements so zero or more `Next` events can be sent to `observer` 24 | * once an `Error` or `Completed` event is sent, the sequence terminates and can't produce any other elements 25 | 26 | It is possible that events are sent from different threads, but no two events can be sent concurrently to 27 | `observer`. 28 | 29 | ### Resource Management 30 | 31 | When sequence sends `Complete` or `Error` event all internal resources that compute sequence elements 32 | will be freed. 33 | 34 | To cancel production of sequence elements and free resources immediatelly, call `dispose` on returned 35 | subscription. 36 | 37 | - returns: Subscription for `observer` that can be used to cancel production of sequence elements and free resources. 38 | */ 39 | func subscribe(_ observer: O) -> Disposable where O.E == E 40 | } 41 | 42 | extension ObservableType { 43 | 44 | /// Default implementation of converting `ObservableType` to `Observable`. 45 | public func asObservable() -> Observable { 46 | // temporary workaround 47 | //return Observable.create(subscribe: self.subscribe) 48 | return Observable.create { o in 49 | return self.subscribe(o) 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/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 | import Foundation 10 | 11 | class AddRefSink : Sink, ObserverType { 12 | typealias Element = O.E 13 | 14 | override init(observer: O, cancel: Cancelable) { 15 | super.init(observer: observer, cancel: cancel) 16 | } 17 | 18 | func on(_ event: Event) { 19 | switch event { 20 | case .next(_): 21 | forwardOn(event) 22 | case .completed, .error(_): 23 | forwardOn(event) 24 | dispose() 25 | } 26 | } 27 | } 28 | 29 | class AddRef : Producer { 30 | typealias EventHandler = (Event) throws -> Void 31 | 32 | private let _source: Observable 33 | private let _refCount: RefCountDisposable 34 | 35 | init(source: Observable, refCount: RefCountDisposable) { 36 | _source = source 37 | _refCount = refCount 38 | } 39 | 40 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 41 | let releaseDisposable = _refCount.retain() 42 | let sink = AddRefSink(observer: observer, cancel: cancel) 43 | let subscription = Disposables.create(releaseDisposable, _source.subscribeSafe(sink)) 44 | 45 | return (sink: sink, subscription: subscription) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/AnonymousObservable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnonymousObservable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class AnonymousObservableSink : Sink, ObserverType { 12 | typealias E = O.E 13 | typealias Parent = AnonymousObservable 14 | 15 | // state 16 | private var _isStopped: AtomicInt = 0 17 | 18 | override init(observer: O, cancel: Cancelable) { 19 | super.init(observer: observer, cancel: cancel) 20 | } 21 | 22 | func on(_ event: Event) { 23 | switch event { 24 | case .next: 25 | if _isStopped == 1 { 26 | return 27 | } 28 | forwardOn(event) 29 | case .error, .completed: 30 | if AtomicCompareAndSwap(0, 1, &_isStopped) { 31 | forwardOn(event) 32 | dispose() 33 | } 34 | } 35 | } 36 | 37 | func run(_ parent: Parent) -> Disposable { 38 | return parent._subscribeHandler(AnyObserver(self)) 39 | } 40 | } 41 | 42 | class AnonymousObservable : Producer { 43 | typealias SubscribeHandler = (AnyObserver) -> Disposable 44 | 45 | let _subscribeHandler: SubscribeHandler 46 | 47 | init(_ subscribeHandler: @escaping SubscribeHandler) { 48 | _subscribeHandler = subscribeHandler 49 | } 50 | 51 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 52 | let sink = AnonymousObservableSink(observer: observer, cancel: cancel) 53 | let subscription = sink.run(self) 54 | return (sink: sink, subscription: subscription) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Concat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Concat.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 3/21/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | class ConcatSink 13 | : TailRecursiveSink 14 | , ObserverType where S.Iterator.Element : ObservableConvertibleType, S.Iterator.Element.E == O.E { 15 | typealias Element = O.E 16 | 17 | override init(observer: O, cancel: Cancelable) { 18 | super.init(observer: observer, cancel: cancel) 19 | } 20 | 21 | func on(_ event: Event){ 22 | switch event { 23 | case .next: 24 | forwardOn(event) 25 | case .error: 26 | forwardOn(event) 27 | dispose() 28 | case .completed: 29 | schedule(.moveNext) 30 | } 31 | } 32 | 33 | override func subscribeToNext(_ source: Observable) -> Disposable { 34 | return source.subscribe(self) 35 | } 36 | 37 | override func extract(_ observable: Observable) -> SequenceGenerator? { 38 | if let source = observable as? Concat { 39 | return (source._sources.makeIterator(), source._count) 40 | } 41 | else { 42 | return nil 43 | } 44 | } 45 | } 46 | 47 | class Concat : Producer where S.Iterator.Element : ObservableConvertibleType { 48 | typealias Element = S.Iterator.Element.E 49 | 50 | fileprivate let _sources: S 51 | fileprivate let _count: IntMax? 52 | 53 | init(sources: S, count: IntMax?) { 54 | _sources = sources 55 | _count = count 56 | } 57 | 58 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 59 | let sink = ConcatSink(observer: observer, cancel: cancel) 60 | let subscription = sink.run((_sources.makeIterator(), _count)) 61 | return (sink: sink, subscription: subscription) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Deferred.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Deferred.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 4/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DeferredSink : Sink, ObserverType where S.E == O.E { 12 | typealias E = O.E 13 | 14 | private let _observableFactory: () throws -> S 15 | 16 | init(observableFactory: @escaping () throws -> S, observer: O, cancel: Cancelable) { 17 | _observableFactory = observableFactory 18 | super.init(observer: observer, cancel: cancel) 19 | } 20 | 21 | func run() -> Disposable { 22 | do { 23 | let result = try _observableFactory() 24 | return result.subscribe(self) 25 | } 26 | catch let e { 27 | forwardOn(.error(e)) 28 | dispose() 29 | return Disposables.create() 30 | } 31 | } 32 | 33 | func on(_ event: Event) { 34 | forwardOn(event) 35 | 36 | switch event { 37 | case .next: 38 | break 39 | case .error: 40 | dispose() 41 | case .completed: 42 | dispose() 43 | } 44 | } 45 | } 46 | 47 | class Deferred : Producer { 48 | typealias Factory = () throws -> S 49 | 50 | private let _observableFactory : Factory 51 | 52 | init(observableFactory: @escaping Factory) { 53 | _observableFactory = observableFactory 54 | } 55 | 56 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { 57 | let sink = DeferredSink(observableFactory: _observableFactory, observer: observer, cancel: cancel) 58 | let subscription = sink.run() 59 | return (sink: sink, subscription: subscription) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/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 | import Foundation 10 | 11 | class DelaySubscriptionSink 12 | : Sink, ObserverType { 13 | typealias E = O.E 14 | typealias Parent = DelaySubscription 15 | 16 | private let _parent: Parent 17 | 18 | init(parent: Parent, observer: O, cancel: Cancelable) { 19 | _parent = parent 20 | super.init(observer: observer, cancel: cancel) 21 | } 22 | 23 | func on(_ event: Event) { 24 | forwardOn(event) 25 | if event.isStopEvent { 26 | dispose() 27 | } 28 | } 29 | 30 | } 31 | 32 | class DelaySubscription: Producer { 33 | private let _source: Observable 34 | private let _dueTime: RxTimeInterval 35 | private let _scheduler: SchedulerType 36 | 37 | init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { 38 | _source = source 39 | _dueTime = dueTime 40 | _scheduler = scheduler 41 | } 42 | 43 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 44 | let sink = DelaySubscriptionSink(parent: self, observer: observer, cancel: cancel) 45 | let subscription = _scheduler.scheduleRelative((), dueTime: _dueTime) { _ in 46 | return self._source.subscribe(sink) 47 | } 48 | 49 | return (sink: sink, subscription: subscription) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Do.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Do.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/21/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DoSink : Sink, ObserverType { 12 | typealias Element = O.E 13 | typealias Parent = Do 14 | 15 | private let _parent: Parent 16 | 17 | init(parent: Parent, observer: O, cancel: Cancelable) { 18 | _parent = parent 19 | super.init(observer: observer, cancel: cancel) 20 | } 21 | 22 | func on(_ event: Event) { 23 | do { 24 | try _parent._eventHandler(event) 25 | forwardOn(event) 26 | if event.isStopEvent { 27 | dispose() 28 | } 29 | } 30 | catch let error { 31 | forwardOn(.error(error)) 32 | dispose() 33 | } 34 | } 35 | } 36 | 37 | class Do : Producer { 38 | typealias EventHandler = (Event) throws -> Void 39 | 40 | fileprivate let _source: Observable 41 | fileprivate let _eventHandler: EventHandler 42 | fileprivate let _onSubscribe: (() -> ())? 43 | fileprivate let _onDispose: (() -> ())? 44 | 45 | init(source: Observable, eventHandler: @escaping EventHandler, onSubscribe: (() -> ())?, onDispose: (() -> ())?) { 46 | _source = source 47 | _eventHandler = eventHandler 48 | _onSubscribe = onSubscribe 49 | _onDispose = onDispose 50 | } 51 | 52 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 53 | _onSubscribe?() 54 | let sink = DoSink(parent: self, observer: observer, cancel: cancel) 55 | let subscription = _source.subscribe(sink) 56 | let onDispose = _onDispose 57 | let allSubscriptions = Disposables.create { 58 | subscription.dispose() 59 | onDispose?() 60 | } 61 | return (sink: sink, subscription: allSubscriptions) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/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 | import Foundation 10 | 11 | class Empty : Producer { 12 | override func subscribe(_ observer: O) -> Disposable where O.E == Element { 13 | observer.on(.completed) 14 | return Disposables.create() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/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 | import Foundation 10 | 11 | class Error : Producer { 12 | private let _error: Swift.Error 13 | 14 | init(error: Swift.Error) { 15 | _error = error 16 | } 17 | 18 | override func subscribe(_ observer: O) -> Disposable where O.E == Element { 19 | observer.on(.error(_error)) 20 | return Disposables.create() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Filter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Filter.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/17/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class FilterSink: Sink, ObserverType { 12 | typealias Predicate = (Element) throws -> Bool 13 | typealias Element = O.E 14 | 15 | private let _predicate: Predicate 16 | 17 | init(predicate: @escaping Predicate, observer: O, cancel: Cancelable) { 18 | _predicate = predicate 19 | super.init(observer: observer, cancel: cancel) 20 | } 21 | 22 | func on(_ event: Event) { 23 | switch event { 24 | case .next(let value): 25 | do { 26 | let satisfies = try _predicate(value) 27 | if satisfies { 28 | forwardOn(.next(value)) 29 | } 30 | } 31 | catch let e { 32 | forwardOn(.error(e)) 33 | dispose() 34 | } 35 | case .completed, .error: 36 | forwardOn(event) 37 | dispose() 38 | } 39 | } 40 | } 41 | 42 | class Filter : Producer { 43 | typealias Predicate = (Element) throws -> Bool 44 | 45 | private let _source: Observable 46 | private let _predicate: Predicate 47 | 48 | init(source: Observable, predicate: @escaping Predicate) { 49 | _source = source 50 | _predicate = predicate 51 | } 52 | 53 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 54 | let sink = FilterSink(predicate: _predicate, observer: observer, cancel: cancel) 55 | let subscription = _source.subscribe(sink) 56 | return (sink: sink, subscription: subscription) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Just.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Just.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 8/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class JustScheduledSink : Sink { 12 | typealias Parent = JustScheduled 13 | 14 | private let _parent: Parent 15 | 16 | init(parent: Parent, observer: O, cancel: Cancelable) { 17 | _parent = parent 18 | super.init(observer: observer, cancel: cancel) 19 | } 20 | 21 | func run() -> Disposable { 22 | let scheduler = _parent._scheduler 23 | return scheduler.schedule(_parent._element) { element in 24 | self.forwardOn(.next(element)) 25 | return scheduler.schedule(()) { _ in 26 | self.forwardOn(.completed) 27 | return Disposables.create() 28 | } 29 | } 30 | } 31 | } 32 | 33 | class JustScheduled : Producer { 34 | fileprivate let _scheduler: ImmediateSchedulerType 35 | fileprivate let _element: Element 36 | 37 | init(element: Element, scheduler: ImmediateSchedulerType) { 38 | _scheduler = scheduler 39 | _element = element 40 | } 41 | 42 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { 43 | let sink = JustScheduledSink(parent: self, observer: observer, cancel: cancel) 44 | let subscription = sink.run() 45 | return (sink: sink, subscription: subscription) 46 | } 47 | } 48 | 49 | class Just : Producer { 50 | private let _element: Element 51 | 52 | init(element: Element) { 53 | _element = element 54 | } 55 | 56 | override func subscribe(_ observer: O) -> Disposable where O.E == Element { 57 | observer.on(.next(_element)) 58 | observer.on(.completed) 59 | return Disposables.create() 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/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 | import Foundation 10 | 11 | class Never : Producer { 12 | override func subscribe(_ observer: O) -> Disposable where O.E == Element { 13 | return Disposables.create() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Optional.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Optional.swift 3 | // RxSwift 4 | // 5 | // Created by tarunon on 2016/12/13. 6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ObservableOptionalScheduledSink : Sink { 12 | typealias E = O.E 13 | typealias Parent = ObservableOptionalScheduled 14 | 15 | private let _parent: Parent 16 | 17 | init(parent: Parent, observer: O, cancel: Cancelable) { 18 | _parent = parent 19 | super.init(observer: observer, cancel: cancel) 20 | } 21 | 22 | func run() -> Disposable { 23 | return _parent._scheduler.schedule(_parent._optional) { (optional: E?) -> Disposable in 24 | if let next = optional { 25 | self.forwardOn(.next(next)) 26 | return self._parent._scheduler.schedule(()) { _ in 27 | self.forwardOn(.completed) 28 | return Disposables.create() 29 | } 30 | } else { 31 | self.forwardOn(.completed) 32 | return Disposables.create() 33 | } 34 | } 35 | } 36 | } 37 | 38 | class ObservableOptionalScheduled : Producer { 39 | fileprivate let _optional: E? 40 | fileprivate let _scheduler: ImmediateSchedulerType 41 | 42 | init(optional: E?, scheduler: ImmediateSchedulerType) { 43 | _optional = optional 44 | _scheduler = scheduler 45 | } 46 | 47 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { 48 | let sink = ObservableOptionalScheduledSink(parent: self, observer: observer, cancel: cancel) 49 | let subscription = sink.run() 50 | return (sink: sink, subscription: subscription) 51 | } 52 | } 53 | 54 | class ObservableOptional: Producer { 55 | private let _optional: E? 56 | 57 | init(optional: E?) { 58 | _optional = optional 59 | } 60 | 61 | override func subscribe(_ observer: O) -> Disposable where O.E == E { 62 | if let element = _optional { 63 | observer.on(.next(element)) 64 | } 65 | observer.on(.completed) 66 | return Disposables.create() 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Range.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Range.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 9/13/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class RangeProducer : Producer { 12 | fileprivate let _start: E 13 | fileprivate let _count: E 14 | fileprivate let _scheduler: ImmediateSchedulerType 15 | 16 | init(start: E, count: E, scheduler: ImmediateSchedulerType) { 17 | if count < 0 { 18 | rxFatalError("count can't be negative") 19 | } 20 | 21 | if start &+ (count - 1) < start { 22 | rxFatalError("overflow of count") 23 | } 24 | 25 | _start = start 26 | _count = count 27 | _scheduler = scheduler 28 | } 29 | 30 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { 31 | let sink = RangeSink(parent: self, observer: observer, cancel: cancel) 32 | let subscription = sink.run() 33 | return (sink: sink, subscription: subscription) 34 | } 35 | } 36 | 37 | class RangeSink : Sink where O.E: SignedInteger { 38 | typealias Parent = RangeProducer 39 | 40 | private let _parent: Parent 41 | 42 | init(parent: Parent, observer: O, cancel: Cancelable) { 43 | _parent = parent 44 | super.init(observer: observer, cancel: cancel) 45 | } 46 | 47 | func run() -> Disposable { 48 | return _parent._scheduler.scheduleRecursive(0 as O.E) { i, recurse in 49 | if i < self._parent._count { 50 | self.forwardOn(.next(self._parent._start + i)) 51 | recurse(i + 1) 52 | } 53 | else { 54 | self.forwardOn(.completed) 55 | self.dispose() 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/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 | import Foundation 10 | 11 | class RepeatElement : Producer { 12 | fileprivate let _element: Element 13 | fileprivate let _scheduler: ImmediateSchedulerType 14 | 15 | init(element: Element, scheduler: ImmediateSchedulerType) { 16 | _element = element 17 | _scheduler = scheduler 18 | } 19 | 20 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 21 | let sink = RepeatElementSink(parent: self, observer: observer, cancel: cancel) 22 | let subscription = sink.run() 23 | 24 | return (sink: sink, subscription: subscription) 25 | } 26 | } 27 | 28 | class RepeatElementSink : Sink { 29 | typealias Parent = RepeatElement 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 run() -> Disposable { 39 | return _parent._scheduler.scheduleRecursive(_parent._element) { e, recurse in 40 | self.forwardOn(.next(e)) 41 | recurse(e) 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Scan.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Scan.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ScanSink : Sink, ObserverType { 12 | typealias Accumulate = O.E 13 | typealias Parent = Scan 14 | typealias E = ElementType 15 | 16 | fileprivate let _parent: Parent 17 | fileprivate var _accumulate: Accumulate 18 | 19 | init(parent: Parent, observer: O, cancel: Cancelable) { 20 | _parent = parent 21 | _accumulate = parent._seed 22 | super.init(observer: observer, cancel: cancel) 23 | } 24 | 25 | func on(_ event: Event) { 26 | switch event { 27 | case .next(let element): 28 | do { 29 | _accumulate = try _parent._accumulator(_accumulate, element) 30 | forwardOn(.next(_accumulate)) 31 | } 32 | catch let error { 33 | forwardOn(.error(error)) 34 | dispose() 35 | } 36 | case .error(let error): 37 | forwardOn(.error(error)) 38 | dispose() 39 | case .completed: 40 | forwardOn(.completed) 41 | dispose() 42 | } 43 | } 44 | 45 | } 46 | 47 | class Scan: Producer { 48 | typealias Accumulator = (Accumulate, Element) throws -> Accumulate 49 | 50 | fileprivate let _source: Observable 51 | fileprivate let _seed: Accumulate 52 | fileprivate let _accumulator: Accumulator 53 | 54 | init(source: Observable, seed: Accumulate, accumulator: @escaping Accumulator) { 55 | _source = source 56 | _seed = seed 57 | _accumulator = accumulator 58 | } 59 | 60 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Accumulate { 61 | let sink = ScanSink(parent: self, observer: observer, cancel: cancel) 62 | let subscription = _source.subscribe(sink) 63 | return (sink: sink, subscription: subscription) 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Sequence.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Sequence.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 11/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ObservableSequenceSink : Sink where S.Iterator.Element == O.E { 12 | typealias Parent = ObservableSequence 13 | 14 | private let _parent: Parent 15 | 16 | init(parent: Parent, observer: O, cancel: Cancelable) { 17 | _parent = parent 18 | super.init(observer: observer, cancel: cancel) 19 | } 20 | 21 | func run() -> Disposable { 22 | return _parent._scheduler.scheduleRecursive((_parent._elements.makeIterator(), _parent._elements)) { (iterator, recurse) in 23 | var mutableIterator = iterator 24 | if let next = mutableIterator.0.next() { 25 | self.forwardOn(.next(next)) 26 | recurse(mutableIterator) 27 | } 28 | else { 29 | self.forwardOn(.completed) 30 | } 31 | } 32 | } 33 | } 34 | 35 | class ObservableSequence : Producer { 36 | fileprivate let _elements: S 37 | fileprivate let _scheduler: ImmediateSchedulerType 38 | 39 | init(elements: S, scheduler: ImmediateSchedulerType) { 40 | _elements = elements 41 | _scheduler = scheduler 42 | } 43 | 44 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { 45 | let sink = ObservableSequenceSink(parent: self, observer: observer, cancel: cancel) 46 | let subscription = sink.run() 47 | return (sink: sink, subscription: subscription) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/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 | import Foundation 10 | 11 | class Sink : Disposable { 12 | fileprivate let _observer: O 13 | fileprivate let _cancel: Cancelable 14 | fileprivate var _disposed: Bool 15 | 16 | init(observer: O, cancel: Cancelable) { 17 | #if TRACE_RESOURCES 18 | let _ = Resources.incrementTotal() 19 | #endif 20 | _observer = observer 21 | _cancel = cancel 22 | _disposed = false 23 | } 24 | 25 | final func forwardOn(_ event: Event) { 26 | if _disposed { 27 | return 28 | } 29 | _observer.on(event) 30 | } 31 | 32 | final func forwarder() -> SinkForward { 33 | return SinkForward(forward: self) 34 | } 35 | 36 | var disposed: Bool { 37 | return _disposed 38 | } 39 | 40 | func dispose() { 41 | _disposed = true 42 | _cancel.dispose() 43 | } 44 | 45 | deinit { 46 | #if TRACE_RESOURCES 47 | let _ = Resources.decrementTotal() 48 | #endif 49 | } 50 | } 51 | 52 | class SinkForward: ObserverType { 53 | typealias E = O.E 54 | 55 | private let _forward: Sink 56 | 57 | init(forward: Sink) { 58 | _forward = forward 59 | } 60 | 61 | func on(_ event: Event) { 62 | switch event { 63 | case .next: 64 | _forward._observer.on(event) 65 | case .error, .completed: 66 | _forward._observer.on(event) 67 | _forward._cancel.dispose() 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/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 | import Foundation 10 | 11 | class StartWith: Producer { 12 | let elements: [Element] 13 | let source: Observable 14 | 15 | init(source: Observable, elements: [Element]) { 16 | self.source = source 17 | self.elements = elements 18 | super.init() 19 | } 20 | 21 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 22 | for e in elements { 23 | observer.on(.next(e)) 24 | } 25 | 26 | return (sink: Disposables.create(), subscription: source.subscribe(observer)) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/SubscribeOn.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SubscribeOn.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class SubscribeOnSink : Sink, ObserverType where Ob.E == O.E { 12 | typealias Element = O.E 13 | typealias Parent = SubscribeOn 14 | 15 | let parent: Parent 16 | 17 | init(parent: Parent, observer: O, cancel: Cancelable) { 18 | self.parent = parent 19 | super.init(observer: observer, cancel: cancel) 20 | } 21 | 22 | func on(_ event: Event) { 23 | forwardOn(event) 24 | 25 | if event.isStopEvent { 26 | self.dispose() 27 | } 28 | } 29 | 30 | func run() -> Disposable { 31 | let disposeEverything = SerialDisposable() 32 | let cancelSchedule = SingleAssignmentDisposable() 33 | 34 | disposeEverything.disposable = cancelSchedule 35 | 36 | let disposeSchedule = parent.scheduler.schedule(()) { (_) -> Disposable in 37 | let subscription = self.parent.source.subscribe(self) 38 | disposeEverything.disposable = ScheduledDisposable(scheduler: self.parent.scheduler, disposable: subscription) 39 | return Disposables.create() 40 | } 41 | 42 | cancelSchedule.setDisposable(disposeSchedule) 43 | 44 | return disposeEverything 45 | } 46 | } 47 | 48 | class SubscribeOn : Producer { 49 | let source: Ob 50 | let scheduler: ImmediateSchedulerType 51 | 52 | init(source: Ob, scheduler: ImmediateSchedulerType) { 53 | self.source = source 54 | self.scheduler = scheduler 55 | } 56 | 57 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Ob.E { 58 | let sink = SubscribeOnSink(parent: self, observer: observer, cancel: cancel) 59 | let subscription = sink.run() 60 | return (sink: sink, subscription: subscription) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/TakeLast.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TakeLast.swift 3 | // RxSwift 4 | // 5 | // Created by Tomi Koskinen on 25/10/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | class TakeLastSink : Sink, ObserverType { 13 | typealias E = O.E 14 | typealias Parent = TakeLast 15 | 16 | private let _parent: Parent 17 | 18 | private var _elements: Queue 19 | 20 | init(parent: Parent, observer: O, cancel: Cancelable) { 21 | _parent = parent 22 | _elements = Queue(capacity: parent._count + 1) 23 | super.init(observer: observer, cancel: cancel) 24 | } 25 | 26 | func on(_ event: Event) { 27 | switch event { 28 | case .next(let value): 29 | _elements.enqueue(value) 30 | if _elements.count > self._parent._count { 31 | let _ = _elements.dequeue() 32 | } 33 | case .error: 34 | forwardOn(event) 35 | dispose() 36 | case .completed: 37 | for e in _elements { 38 | forwardOn(.next(e)) 39 | } 40 | forwardOn(.completed) 41 | dispose() 42 | } 43 | } 44 | } 45 | 46 | class TakeLast: Producer { 47 | fileprivate let _source: Observable 48 | fileprivate let _count: Int 49 | 50 | init(source: Observable, count: Int) { 51 | if count < 0 { 52 | rxFatalError("count can't be negative") 53 | } 54 | _source = source 55 | _count = count 56 | } 57 | 58 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { 59 | let sink = TakeLastSink(parent: self, observer: observer, cancel: cancel) 60 | let subscription = _source.subscribe(sink) 61 | return (sink: sink, subscription: subscription) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/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 | import Foundation 10 | 11 | class ToArraySink : Sink, ObserverType where O.E == [SourceType] { 12 | typealias Parent = ToArray 13 | 14 | let _parent: Parent 15 | var _list = Array() 16 | 17 | init(parent: Parent, observer: O, cancel: Cancelable) { 18 | _parent = parent 19 | 20 | super.init(observer: observer, cancel: cancel) 21 | } 22 | 23 | func on(_ event: Event) { 24 | switch event { 25 | case .next(let value): 26 | self._list.append(value) 27 | case .error(let e): 28 | forwardOn(.error(e)) 29 | self.dispose() 30 | case .completed: 31 | forwardOn(.next(_list)) 32 | forwardOn(.completed) 33 | self.dispose() 34 | } 35 | } 36 | } 37 | 38 | class ToArray : Producer<[SourceType]> { 39 | let _source: Observable 40 | 41 | init(source: Observable) { 42 | _source = source 43 | } 44 | 45 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == [SourceType] { 46 | let sink = ToArraySink(parent: self, observer: observer, cancel: cancel) 47 | let subscription = _source.subscribe(sink) 48 | return (sink: sink, subscription: subscription) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Observable+Debug.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Observable+Debug.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 5/2/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: debug 12 | 13 | extension ObservableType { 14 | 15 | /** 16 | Prints received events for all observers on standard output. 17 | 18 | - seealso: [do operator on reactivex.io](http://reactivex.io/documentation/operators/do.html) 19 | 20 | - parameter identifier: Identifier that is printed together with event description to standard output. 21 | - parameter trimOutput: Should output be trimmed to max 40 characters. 22 | - returns: An observable sequence whose events are printed to standard output. 23 | */ 24 | public func debug(_ identifier: String? = nil, trimOutput: Bool = false, file: String = #file, line: UInt = #line, function: String = #function) 25 | -> Observable { 26 | return Debug(source: self, identifier: identifier, trimOutput: trimOutput, file: file, line: line, function: function) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Supports push-style iteration over an observable sequence. 12 | public protocol ObserverType { 13 | /// The type of elements in sequence that observer can observe. 14 | associatedtype E 15 | 16 | /// Notify observer about sequence event. 17 | /// 18 | /// - parameter event: Event that occured. 19 | func on(_ event: Event) 20 | } 21 | 22 | /// Convenience API extensions to provide alternate next, error, completed events 23 | extension ObserverType { 24 | 25 | /// Convenience method equivalent to `on(.next(element: E))` 26 | /// 27 | /// - parameter element: Next element to send to observer(s) 28 | public final func onNext(_ element: E) { 29 | on(.next(element)) 30 | } 31 | 32 | /// Convenience method equivalent to `on(.completed)` 33 | public final func onCompleted() { 34 | on(.completed) 35 | } 36 | 37 | /// Convenience method equivalent to `on(.error(Swift.Error))` 38 | /// - parameter error: Swift.Error to send to observer(s) 39 | public final func onError(_ error: Swift.Error) { 40 | on(.error(error)) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | class AnonymousObserver : ObserverBase { 12 | typealias Element = ElementType 13 | 14 | typealias EventHandler = (Event) -> Void 15 | 16 | private let _eventHandler : EventHandler 17 | 18 | init(_ eventHandler: @escaping EventHandler) { 19 | #if TRACE_RESOURCES 20 | let _ = Resources.incrementTotal() 21 | #endif 22 | _eventHandler = eventHandler 23 | } 24 | 25 | override func onCore(_ event: Event) { 26 | return _eventHandler(event) 27 | } 28 | 29 | #if TRACE_RESOURCES 30 | deinit { 31 | let _ = Resources.decrementTotal() 32 | } 33 | #endif 34 | } 35 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | class ObserverBase : Disposable, ObserverType { 12 | typealias E = ElementType 13 | 14 | private var _isStopped: AtomicInt = 0 15 | 16 | func on(_ event: Event) { 17 | switch event { 18 | case .next: 19 | if _isStopped == 0 { 20 | onCore(event) 21 | } 22 | case .error, .completed: 23 | 24 | if !AtomicCompareAndSwap(0, 1, &_isStopped) { 25 | return 26 | } 27 | 28 | onCore(event) 29 | } 30 | } 31 | 32 | func onCore(_ event: Event) { 33 | abstractMethod() 34 | } 35 | 36 | func dispose() { 37 | _ = AtomicCompareAndSwap(0, 1, &_isStopped) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /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 Foundation 72 | 73 | /// Extend NSObject with `rx` proxy. 74 | extension NSObject: ReactiveCompatible { } 75 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Rx.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 2/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | #if TRACE_RESOURCES 12 | fileprivate var resourceCount: AtomicInt = 0 13 | 14 | /// Resource utilization information 15 | public struct Resources { 16 | /// Counts internal Rx resource allocations (Observables, Observers, Disposables, etc.). This provides a simple way to detect leaks during development. 17 | public static var total: Int32 { 18 | return resourceCount.valueSnapshot() 19 | } 20 | 21 | /// Increments `Resources.total` resource count. 22 | /// 23 | /// - returns: New resource count 24 | public static func incrementTotal() -> Int32 { 25 | return AtomicIncrement(&resourceCount) 26 | } 27 | 28 | /// Decrements `Resources.total` resource count 29 | /// 30 | /// - returns: New resource count 31 | public static func decrementTotal() -> Int32 { 32 | return AtomicDecrement(&resourceCount) 33 | } 34 | } 35 | #endif 36 | 37 | /// Swift does not implement abstract methods. This method is used as a runtime check to ensure that methods which intended to be abstract (i.e., they should be implemented in subclasses) are not called directly on the superclass. 38 | func abstractMethod() -> Swift.Never { 39 | rxFatalError("Abstract method") 40 | } 41 | 42 | func rxFatalError(_ lastMessage: String) -> Swift.Never { 43 | // The temptation to comment this line is great, but please don't, it's for your own good. The choice is yours. 44 | fatalError(lastMessage) 45 | } 46 | 47 | func incrementChecked(_ i: inout Int) throws -> Int { 48 | if i == Int.max { 49 | throw RxError.overflow 50 | } 51 | defer { i += 1 } 52 | return i 53 | } 54 | 55 | func decrementChecked(_ i: inout Int) throws -> Int { 56 | if i == Int.min { 57 | throw RxError.overflow 58 | } 59 | defer { i -= 1 } 60 | return i 61 | } 62 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Creates mutable reference wrapper for any type. 12 | class RxMutableBox : CustomDebugStringConvertible { 13 | /// Wrapped value 14 | var value : T 15 | 16 | /// Creates reference wrapper for `value`. 17 | /// 18 | /// - parameter value: Value to wrap. 19 | init (_ value: T) { 20 | self.value = value 21 | } 22 | } 23 | 24 | extension RxMutableBox { 25 | /// - returns: Box description. 26 | var debugDescription: String { 27 | return "MutatingBox(\(self.value))" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /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 Foundation 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 | import Foundation 10 | 11 | /// Represents an object that schedules units of work to run immediately on the current thread. 12 | private class ImmediateScheduler : ImmediateSchedulerType { 13 | 14 | private let _asyncLock = AsyncLock() 15 | 16 | /** 17 | Schedules an action to be executed immediatelly. 18 | 19 | In case `schedule` is called recursively from inside of `action` callback, scheduled `action` will be enqueued 20 | and executed after current `action`. (`AsyncLock` behavior) 21 | 22 | - parameter state: State passed to the action to be executed. 23 | - parameter action: Action to be executed. 24 | - returns: The disposable object used to cancel the scheduled action (best effort). 25 | */ 26 | func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { 27 | let disposable = SingleAssignmentDisposable() 28 | _asyncLock.invoke(AnonymousInvocable { 29 | if disposable.isDisposed { 30 | return 31 | } 32 | disposable.setDisposable(action(state)) 33 | }) 34 | 35 | return disposable 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | struct AnonymousInvocable : InvocableType { 12 | private let _action: () -> () 13 | 14 | init(_ action: @escaping () -> ()) { 15 | _action = action 16 | } 17 | 18 | func invoke() { 19 | _action() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | struct InvocableScheduledItem : InvocableType { 12 | 13 | let _invocable: I 14 | let _state: I.Value 15 | 16 | init(invocable: I, state: I.Value) { 17 | _invocable = invocable 18 | _state = state 19 | } 20 | 21 | func invoke() { 22 | _invocable.invoke(_state) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | protocol InvocableType { 12 | func invoke() 13 | } 14 | 15 | protocol InvocableWithValueType { 16 | associatedtype Value 17 | 18 | func invoke(_ value: Value) 19 | } 20 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | struct ScheduledItem 12 | : ScheduledItemType 13 | , InvocableType { 14 | typealias Action = (T) -> Disposable 15 | 16 | private let _action: Action 17 | private let _state: T 18 | 19 | private let _disposable = SingleAssignmentDisposable() 20 | 21 | var isDisposed: Bool { 22 | return _disposable.isDisposed 23 | } 24 | 25 | init(action: @escaping Action, state: T) { 26 | _action = action 27 | _state = state 28 | } 29 | 30 | func invoke() { 31 | _disposable.setDisposable(_action(_state)) 32 | } 33 | 34 | func dispose() { 35 | _disposable.dispose() 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | protocol ScheduledItemType 12 | : Cancelable 13 | , InvocableType { 14 | func invoke() 15 | } 16 | -------------------------------------------------------------------------------- /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 Foundation 10 | 11 | /// Abstracts the work that needs to be performed on a specific `NSOperationQueue`. 12 | /// 13 | /// 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`. 14 | public class OperationQueueScheduler: ImmediateSchedulerType { 15 | public let operationQueue: OperationQueue 16 | 17 | /// Constructs new instance of `OperationQueueScheduler` that performs work on `operationQueue`. 18 | /// 19 | /// - parameter operationQueue: Operation queue targeted to perform work on. 20 | public init(operationQueue: OperationQueue) { 21 | self.operationQueue = operationQueue 22 | } 23 | 24 | /** 25 | Schedules an action to be executed recursively. 26 | 27 | - parameter state: State passed to the action to be executed. 28 | - 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. 29 | - returns: The disposable object used to cancel the scheduled action (best effort). 30 | */ 31 | public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { 32 | let cancel = SingleAssignmentDisposable() 33 | 34 | let operation = BlockOperation { 35 | if cancel.isDisposed { 36 | return 37 | } 38 | 39 | 40 | cancel.setDisposable(action(state)) 41 | } 42 | 43 | self.operationQueue.addOperation(operation) 44 | 45 | return cancel 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Represents an object that is both an observable sequence as well as an observer. 12 | public protocol SubjectType : ObservableType { 13 | /// The type of the observer that represents this subject. 14 | /// 15 | /// Usually this type is type of subject itself, but it doesn't have to be. 16 | associatedtype SubjectObserverType : ObserverType 17 | 18 | /// Returns observer interface for subject. 19 | /// 20 | /// - returns: Observer interface for subject. 21 | func asObserver() -> SubjectObserverType 22 | 23 | } 24 | -------------------------------------------------------------------------------- /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 | import Foundation 10 | 11 | /// Variable is a wrapper for `BehaviorSubject`. 12 | /// 13 | /// Unlike `BehaviorSubject` it can't terminate with error, and when variable is deallocated 14 | /// it will complete it's observable sequence (`asObservable`). 15 | public class Variable { 16 | 17 | public typealias E = Element 18 | 19 | private let _subject: BehaviorSubject 20 | 21 | private var _lock = SpinLock() 22 | 23 | // state 24 | private var _value: E 25 | 26 | /// Gets or sets current value of variable. 27 | /// 28 | /// Whenever a new value is set, all the observers are notified of the change. 29 | /// 30 | /// Even if the newly set value is same as the old value, observers are still notified for change. 31 | public var value: E { 32 | get { 33 | _lock.lock(); defer { _lock.unlock() } 34 | return _value 35 | } 36 | set(newValue) { 37 | _lock.lock() 38 | _value = newValue 39 | _lock.unlock() 40 | 41 | _subject.on(.next(newValue)) 42 | } 43 | } 44 | 45 | /// Initializes variable with initial value. 46 | /// 47 | /// - parameter value: Initial variable value. 48 | public init(_ value: Element) { 49 | _value = value 50 | _subject = BehaviorSubject(value: value) 51 | } 52 | 53 | /// - returns: Canonical interface for push style sequence 54 | public func asObservable() -> Observable { 55 | return _subject 56 | } 57 | 58 | deinit { 59 | _subject.on(.completed) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Pods/SwiftyJSON/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Ruoyu Fu 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /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 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double AlamofireVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /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 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /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.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireObjectMapper/AlamofireObjectMapper-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AlamofireObjectMapper : NSObject 3 | @end 4 | @implementation PodsDummy_AlamofireObjectMapper 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireObjectMapper/AlamofireObjectMapper-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireObjectMapper/AlamofireObjectMapper-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double AlamofireObjectMapperVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char AlamofireObjectMapperVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireObjectMapper/AlamofireObjectMapper.modulemap: -------------------------------------------------------------------------------- 1 | framework module AlamofireObjectMapper { 2 | umbrella header "AlamofireObjectMapper-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireObjectMapper/AlamofireObjectMapper.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AlamofireObjectMapper 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireObjectMapper/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.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/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 | 5.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Nimble : NSObject 3 | @end 4 | @implementation PodsDummy_Nimble 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Nimble.h" 6 | #import "DSL.h" 7 | #import "NMBExceptionCapture.h" 8 | #import "NMBStringify.h" 9 | 10 | FOUNDATION_EXPORT double NimbleVersionNumber; 11 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[]; 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble.modulemap: -------------------------------------------------------------------------------- 1 | framework module Nimble { 2 | umbrella header "Nimble-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Nimble 2 | ENABLE_BITCODE = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 6 | OTHER_LDFLAGS = -weak-lswiftXCTest -weak_framework "XCTest" 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_ROOT = ${SRCROOT} 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.0.0 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 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ObjectMapper/ObjectMapper-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double ObjectMapperVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char ObjectMapperVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /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 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPIBuilder/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-SwiftAPIBuilder/Pods-SwiftAPIBuilder-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SwiftyJSON 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2016 Ruoyu Fu 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | 28 | Generated by CocoaPods - https://cocoapods.org 29 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPIBuilder/Pods-SwiftAPIBuilder-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftAPIBuilder : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftAPIBuilder 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPIBuilder/Pods-SwiftAPIBuilder-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double Pods_SwiftAPIBuilderVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char Pods_SwiftAPIBuilderVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPIBuilder/Pods-SwiftAPIBuilder.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CODE_SIGN_IDENTITY = 3 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-OSX" 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 7 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-OSX/SwiftyJSON.framework/Headers" 8 | OTHER_LDFLAGS = $(inherited) -framework "SwiftyJSON" 9 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 10 | PODS_BUILD_DIR = $BUILD_DIR 11 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPIBuilder/Pods-SwiftAPIBuilder.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftAPIBuilder { 2 | umbrella header "Pods-SwiftAPIBuilder-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPIBuilder/Pods-SwiftAPIBuilder.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CODE_SIGN_IDENTITY = 3 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-OSX" 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 7 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-OSX/SwiftyJSON.framework/Headers" 8 | OTHER_LDFLAGS = $(inherited) -framework "SwiftyJSON" 9 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 10 | PODS_BUILD_DIR = $BUILD_DIR 11 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPITest/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-SwiftAPITest/Pods-SwiftAPITest-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftAPITest : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftAPITest 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPITest/Pods-SwiftAPITest-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double Pods_SwiftAPITestVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char Pods_SwiftAPITestVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPITest/Pods-SwiftAPITest.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/AlamofireObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Nimble" "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Quick" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-iOS" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AlamofireObjectMapper/AlamofireObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Nimble/Nimble.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper/ObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Quick/Quick.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxSwift/RxSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-iOS/SwiftyJSON.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "AlamofireObjectMapper" -framework "Nimble" -framework "ObjectMapper" -framework "Quick" -framework "RxSwift" -framework "SwiftyJSON" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPITest/Pods-SwiftAPITest.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftAPITest { 2 | umbrella header "Pods-SwiftAPITest-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftAPITest/Pods-SwiftAPITest.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/AlamofireObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Nimble" "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper" "$PODS_CONFIGURATION_BUILD_DIR/Quick" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-iOS" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AlamofireObjectMapper/AlamofireObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Nimble/Nimble.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ObjectMapper/ObjectMapper.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Quick/Quick.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxSwift/RxSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-iOS/SwiftyJSON.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "AlamofireObjectMapper" -framework "Nimble" -framework "ObjectMapper" -framework "Quick" -framework "RxSwift" -framework "SwiftyJSON" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/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 | 0.10.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Quick : NSObject 3 | @end 4 | @implementation PodsDummy_Quick 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "QuickConfiguration.h" 6 | #import "QCKDSL.h" 7 | #import "Quick.h" 8 | #import "QuickSpec.h" 9 | 10 | FOUNDATION_EXPORT double QuickVersionNumber; 11 | FOUNDATION_EXPORT const unsigned char QuickVersionString[]; 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick.modulemap: -------------------------------------------------------------------------------- 1 | framework module Quick { 2 | umbrella header "Quick-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Quick 2 | ENABLE_BITCODE = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 6 | OTHER_LDFLAGS = -framework "XCTest" 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_ROOT = ${SRCROOT} 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | -------------------------------------------------------------------------------- /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.1.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 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double RxSwiftVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char RxSwiftVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /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 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-OSX/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.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-OSX/SwiftyJSON-OSX-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwiftyJSON_OSX : NSObject 3 | @end 4 | @implementation PodsDummy_SwiftyJSON_OSX 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-OSX/SwiftyJSON-OSX-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-OSX/SwiftyJSON-OSX-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double SwiftyJSONVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char SwiftyJSONVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-OSX/SwiftyJSON-OSX.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyJSON { 2 | umbrella header "SwiftyJSON-OSX-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-OSX/SwiftyJSON-OSX.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-OSX 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-iOS/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.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-iOS/SwiftyJSON-iOS-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwiftyJSON_iOS : NSObject 3 | @end 4 | @implementation PodsDummy_SwiftyJSON_iOS 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-iOS/SwiftyJSON-iOS-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-iOS/SwiftyJSON-iOS-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double SwiftyJSONVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char SwiftyJSONVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-iOS/SwiftyJSON-iOS.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyJSON { 2 | umbrella header "SwiftyJSON-iOS-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON-iOS/SwiftyJSON-iOS.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON-iOS 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 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /SwiftAPIBuilder.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftAPIBuilder.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SwiftAPIBuilder/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftAPIBuilder 4 | // 5 | // Created by drinking on 16/9/1. 6 | // Copyright © 2016年 drinking. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | 15 | 16 | func applicationDidFinishLaunching(aNotification: NSNotification) { 17 | // Insert code here to initialize your application 18 | } 19 | 20 | func applicationWillTerminate(aNotification: NSNotification) { 21 | // Insert code here to tear down your application 22 | } 23 | 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "swiftLogo的副本-9.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "swiftLogo的副本-8.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "swiftLogo的副本-7.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "swiftLogo的副本-6.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "swiftLogo的副本-5.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "swiftLogo的副本-4.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "swiftLogo的副本-3.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "swiftLogo的副本-2.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "swiftLogo的副本-1.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "swiftLogo的副本.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-1.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-2.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-3.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-4.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-5.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-6.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-7.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-8.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本-9.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinking/SwiftAPI/46d353fd53e699a863c22bfcd36a709fa0331a88/SwiftAPIBuilder/Assets.xcassets/AppIcon.appiconset/swiftLogo的副本.png -------------------------------------------------------------------------------- /SwiftAPIBuilder/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2016年 drinking. All rights reserved. 29 | NSMainStoryboardFile 30 | Main 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /SwiftAPIBuilder/Sources/Extensions.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import SwiftyJSON 3 | 4 | public enum APITransition { 5 | case HTTPRequest 6 | case HTTPResponse 7 | 8 | public var stringValue:String { 9 | switch self { 10 | case .HTTPRequest: 11 | return "httpRequest" 12 | case .HTTPResponse: 13 | return "httpResponse" 14 | } 15 | } 16 | } 17 | 18 | public extension JSON { 19 | 20 | public func contentsInTransition(name:APITransition)->[JSON]{ 21 | return self["content"].arrayValue.filter({ 22 | v in 23 | v["element"].string == "httpTransaction" 24 | }).flatMap{$0["content"].arrayValue}.filter({ 25 | v in 26 | v["element"].string == name.stringValue 27 | }).flatMap{$0["content"].arrayValue} 28 | } 29 | 30 | public var element:DKAPIElement { 31 | let element = self["element"].stringValue 32 | if (element == "category") { 33 | return .Category 34 | } else if (element == "resource") { 35 | return .Resource 36 | } else if (element == "transition") { 37 | return .Transition 38 | } else if (element == "dataStructure") { 39 | return .DataStructure 40 | } else if (element == "parseResult"){ 41 | return .ParseResult 42 | } else if (element == "object"){ 43 | return .Object 44 | }else if (element == "member"){ 45 | return .Member 46 | }else if (element == "asset"){ 47 | return .Asset 48 | } 49 | return .Unknown 50 | } 51 | 52 | func hasMeta(meta: String) -> Bool { 53 | let metas = self["meta"]["classes"].arrayValue 54 | for m in metas { 55 | if m.stringValue.lowercased() == meta.lowercased() { 56 | return true 57 | } 58 | } 59 | return false 60 | } 61 | 62 | func structureName()->String{ 63 | return self["meta"]["id"].stringValue 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /SwiftAPIBuilder/ThirdParties/FileWatcher/Common.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Common.swift 3 | // KZFileWatchers 4 | // 5 | // Created by Krzysztof Zabłocki on 05/08/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public enum FileWatcher { 12 | 13 | /** 14 | Errors that can be thrown from `FileWatcherProtocol`. 15 | */ 16 | public enum FWError: Error { 17 | 18 | /** 19 | Trying to perform operation on watcher that requires started state. 20 | */ 21 | case notStarted 22 | 23 | /** 24 | Trying to start watcher that's already running. 25 | */ 26 | case alreadyStarted 27 | 28 | /** 29 | Trying to stop watcher that's already stopped. 30 | */ 31 | case alreadyStopped 32 | 33 | /** 34 | Failed to start the watcher, `reason` will contain more information why. 35 | */ 36 | case failedToStart(reason: String) 37 | } 38 | 39 | /** 40 | Enum that contains status of refresh result. 41 | */ 42 | public enum RefreshResult { 43 | /** 44 | Watched file didn't change since last update. 45 | */ 46 | case noChanges 47 | 48 | /** 49 | Watched file did change. 50 | */ 51 | case updated(data: NSData) 52 | } 53 | 54 | /// Closure used for File watcher updates. 55 | public typealias UpdateClosure = (RefreshResult) -> Void 56 | } 57 | 58 | /** 59 | * Minimal interface all File Watchers have to implement. 60 | */ 61 | public protocol FileWatcherProtocol { 62 | /** 63 | Starts observing file changes, a file watcher can only have one callback. 64 | 65 | - parameter closure: Closure to use for observations. 66 | 67 | - throws: `FileWatcher.Error` 68 | */ 69 | func start(closure: @escaping FileWatcher.UpdateClosure) throws 70 | 71 | /** 72 | Stops observing file changes. 73 | 74 | - throws: `FileWatcher.Error` 75 | */ 76 | func stop() throws 77 | } 78 | -------------------------------------------------------------------------------- /SwiftAPIBuilder/ThirdParties/SwiftShell/FileHandle.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Released under the MIT License (MIT), http://opensource.org/licenses/MIT 3 | * 4 | * Copyright (c) 2015 Kåre Morstøl, NotTooBad Software (nottoobadsoftware.com) 5 | * 6 | */ 7 | 8 | import Foundation 9 | 10 | extension FileHandle { 11 | 12 | public func readSome (encoding: String.Encoding = main.encoding) -> String? { 13 | let data = self.availableData 14 | 15 | guard data.count > 0 else { return nil } 16 | guard let result = String(data: data, encoding: encoding) else { 17 | exit(errormessage: "Could not convert binary data to text.") 18 | } 19 | 20 | return result 21 | } 22 | 23 | public func read (encoding: String.Encoding = main.encoding) -> String { 24 | let data = self.readDataToEndOfFile() 25 | 26 | guard let result = String(data: data, encoding: encoding) else { 27 | exit(errormessage: "Could not convert binary data to text.") 28 | } 29 | 30 | return result 31 | } 32 | } 33 | 34 | extension FileHandle { 35 | 36 | public func write (_ x: T, encoding: String.Encoding = main.encoding) { 37 | guard let data = String(describing: x).data(using: encoding, allowLossyConversion:false) else { 38 | exit(errormessage: "Could not convert text to binary data.") 39 | } 40 | self.write(data) 41 | } 42 | 43 | public func writeln (_ x: T, encoding: String.Encoding = main.encoding) { 44 | self.write(x, encoding: encoding) 45 | self.write("\n", encoding: encoding) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /SwiftAPIBuilder/ThirdParties/SwiftShell/General/Array.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Released under the MIT License (MIT), http://opensource.org/licenses/MIT 3 | * 4 | * Copyright (c) 2015 Kåre Morstøl, NotTooBad Software (nottoobadsoftware.com) 5 | * 6 | */ 7 | 8 | private protocol AnyArrayType { 9 | var anyValues: [Any] { get } 10 | } 11 | 12 | extension Array: AnyArrayType { 13 | fileprivate var anyValues: [Any] { 14 | return self.map { $0 as Any } 15 | } 16 | } 17 | 18 | extension Array where Element: Any { 19 | 20 | func flatten () -> [Any] { 21 | return self.flatMap { x -> [Any] in 22 | if let anyarray = x as? AnyArrayType { 23 | return anyarray.anyValues.flatten() 24 | } else { 25 | return [x] 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SwiftAPIBuilder/ThirdParties/SwiftShell/String.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Released under the MIT License (MIT), http://opensource.org/licenses/MIT 3 | * 4 | * Copyright (c) 2015 Kåre Morstøl, NotTooBad Software (nottoobadsoftware.com) 5 | * 6 | */ 7 | 8 | import Foundation 9 | 10 | /** Let Strings run commands using itself as stdin. */ 11 | extension String: ShellRunnable { 12 | public var shellcontext: ShellContextType { 13 | var context = ShellContext(main) 14 | let (writer,reader) = streams() 15 | 16 | writer.write(self) 17 | writer.close() 18 | context.stdin = reader 19 | return context 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SwiftAPITest/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 | NSAppTransportSecurity 22 | 23 | NSAllowsArbitraryLoads 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SwiftAPITest/SwiftAPITest.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftAPITest.swift 3 | // SwiftAPITest 4 | // 5 | // Created by drinking on 16/9/28. 6 | // Copyright © 2016年 drinking. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import Quick 11 | import Nimble 12 | 13 | //Ref: http://www.mokacoding.com/blog/async-testing-with-quick-and-nimble/ 14 | 15 | func testor(d:String,i:String,runner:@escaping (@escaping ((Void)->Void))->()){ 16 | describe(d){ 17 | it(i){ 18 | waitUntil (timeout: 15){ done in 19 | runner(done) 20 | } 21 | } 22 | } 23 | } 24 | 25 | class TableOfContentsSpec: QuickSpec { 26 | 27 | override func spec() { 28 | 29 | GITHUBISSUE.runTest(testor ,host: "https://api.github.com",expect:{ 30 | let issues = $0.entities; 31 | expect(issues.count) == 30 32 | }) 33 | 34 | GITHUBUSER.runTest(testor, host: "https://api.github.com",argument:{ 35 | $0.fillPathArgs("drinking") 36 | return nil 37 | },expect:{ 38 | expect($0.email) == "pan49@126.com" 39 | expect($0.login) == "drinking" 40 | }) 41 | 42 | JSONIPGET.runTest(testor, host: "http://jsonip.com",expect:{ 43 | expect($0.about!) == "/about" 44 | }) 45 | 46 | } 47 | } 48 | --------------------------------------------------------------------------------