├── .github └── workflows │ └── swift.yml ├── .gitignore ├── .jazzy.yaml ├── .swiftpm └── xcode │ └── package.xcworkspace │ └── contents.xcworkspacedata ├── .travis.yml ├── Example ├── MapCache.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── MapCache-Example.xcscheme ├── MapCache.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── MapCache │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── DownloaderViewController.swift │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── ViewController.swift ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── MapCache.podspec.json │ ├── Manifest.lock │ ├── Nimble │ │ ├── Carthage │ │ │ └── Checkouts │ │ │ │ ├── CwlCatchException │ │ │ │ └── Sources │ │ │ │ │ ├── CwlCatchException │ │ │ │ │ └── CwlCatchException.swift │ │ │ │ │ └── CwlCatchExceptionSupport │ │ │ │ │ ├── CwlCatchException.m │ │ │ │ │ └── include │ │ │ │ │ └── CwlCatchException.h │ │ │ │ └── CwlPreconditionTesting │ │ │ │ └── Sources │ │ │ │ ├── CwlMachBadInstructionHandler │ │ │ │ ├── CwlMachBadInstructionHandler.m │ │ │ │ ├── include │ │ │ │ │ └── CwlMachBadInstructionHandler.h │ │ │ │ ├── mach_excServer.c │ │ │ │ └── mach_excServer.h │ │ │ │ └── CwlPreconditionTesting │ │ │ │ ├── CwlBadInstructionException.swift │ │ │ │ ├── CwlCatchBadInstruction.swift │ │ │ │ └── CwlDarwinDefinitions.swift │ │ ├── LICENSE │ │ ├── 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 │ │ │ ├── ExpectationMessage.swift │ │ │ ├── Expression.swift │ │ │ ├── FailureMessage.swift │ │ │ ├── Matchers │ │ │ │ ├── AllPass.swift │ │ │ │ ├── Async.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 │ │ │ │ ├── BeginWithPrefix.swift │ │ │ │ ├── Contain.swift │ │ │ │ ├── ContainElementSatisfying.swift │ │ │ │ ├── ElementsEqual.swift │ │ │ │ ├── EndWith.swift │ │ │ │ ├── Equal+Tuple.swift │ │ │ │ ├── Equal.swift │ │ │ │ ├── HaveCount.swift │ │ │ │ ├── Match.swift │ │ │ │ ├── MatchError.swift │ │ │ │ ├── MatcherFunc.swift │ │ │ │ ├── MatcherProtocols.swift │ │ │ │ ├── PostNotification.swift │ │ │ │ ├── Predicate.swift │ │ │ │ ├── RaisesException.swift │ │ │ │ ├── SatisfyAllOf.swift │ │ │ │ ├── SatisfyAnyOf.swift │ │ │ │ ├── ThrowAssertion.swift │ │ │ │ ├── ThrowError.swift │ │ │ │ └── ToSucceed.swift │ │ │ ├── Nimble.h │ │ │ └── Utils │ │ │ │ ├── Await.swift │ │ │ │ ├── DispatchTimeInterval.swift │ │ │ │ ├── Errors.swift │ │ │ │ ├── SourceLocation.swift │ │ │ │ └── Stringers.swift │ │ │ └── NimbleObjectiveC │ │ │ ├── DSL.h │ │ │ ├── DSL.m │ │ │ ├── NMBExceptionCapture.h │ │ │ ├── NMBExceptionCapture.m │ │ │ ├── NMBStringify.h │ │ │ ├── NMBStringify.m │ │ │ └── XCTestObservationCenter+Register.m │ ├── OHHTTPStubs │ │ ├── LICENSE │ │ ├── OHHTTPStubs │ │ │ └── Sources │ │ │ │ ├── Compatibility.h │ │ │ │ ├── JSON │ │ │ │ ├── OHHTTPStubsResponse+JSON.h │ │ │ │ └── OHHTTPStubsResponse+JSON.m │ │ │ │ ├── NSURLSession │ │ │ │ ├── NSURLRequest+HTTPBodyTesting.h │ │ │ │ ├── NSURLRequest+HTTPBodyTesting.m │ │ │ │ ├── OHHTTPStubs+NSURLSessionConfiguration.m │ │ │ │ ├── OHHTTPStubsMethodSwizzling.h │ │ │ │ └── OHHTTPStubsMethodSwizzling.m │ │ │ │ ├── OHHTTPStubs.h │ │ │ │ ├── OHHTTPStubs.m │ │ │ │ ├── OHHTTPStubsResponse.h │ │ │ │ ├── OHHTTPStubsResponse.m │ │ │ │ ├── OHPathHelpers │ │ │ │ ├── OHPathHelpers.h │ │ │ │ └── OHPathHelpers.m │ │ │ │ └── Swift │ │ │ │ └── OHHTTPStubsSwift.swift │ │ └── README.md │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── Quick │ │ ├── LICENSE │ │ ├── README.md │ │ └── Sources │ │ │ ├── Quick │ │ │ ├── Behavior.swift │ │ │ ├── Callsite.swift │ │ │ ├── Configuration │ │ │ │ ├── Configuration.swift │ │ │ │ └── QuickConfiguration.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 │ │ │ ├── QuickTestObservation.swift │ │ │ ├── QuickTestSuite.swift │ │ │ ├── String+C99ExtendedIdentifier.swift │ │ │ ├── URL+FileName.swift │ │ │ └── World.swift │ │ │ ├── QuickObjCRuntime │ │ │ ├── QuickSpecBase.m │ │ │ └── include │ │ │ │ └── QuickSpecBase.h │ │ │ └── QuickObjectiveC │ │ │ ├── Configuration │ │ │ ├── QuickConfiguration.h │ │ │ └── QuickConfiguration.m │ │ │ ├── DSL │ │ │ ├── QCKDSL.h │ │ │ └── QCKDSL.m │ │ │ ├── Quick.h │ │ │ ├── QuickSpec.h │ │ │ ├── QuickSpec.m │ │ │ └── XCTestSuite+QuickTestSuiteBuilder.m │ └── Target Support Files │ │ ├── MapCache │ │ ├── Info.plist │ │ ├── MapCache-Info.plist │ │ ├── MapCache-dummy.m │ │ ├── MapCache-prefix.pch │ │ ├── MapCache-umbrella.h │ │ ├── MapCache.debug.xcconfig │ │ ├── MapCache.modulemap │ │ ├── MapCache.release.xcconfig │ │ └── MapCache.xcconfig │ │ ├── Nimble │ │ ├── Info.plist │ │ ├── Nimble-Info.plist │ │ ├── Nimble-dummy.m │ │ ├── Nimble-prefix.pch │ │ ├── Nimble-umbrella.h │ │ ├── Nimble.debug.xcconfig │ │ ├── Nimble.modulemap │ │ ├── Nimble.release.xcconfig │ │ └── Nimble.xcconfig │ │ ├── OHHTTPStubs │ │ ├── OHHTTPStubs-Info.plist │ │ ├── OHHTTPStubs-dummy.m │ │ ├── OHHTTPStubs-prefix.pch │ │ ├── OHHTTPStubs-umbrella.h │ │ ├── OHHTTPStubs.debug.xcconfig │ │ ├── OHHTTPStubs.modulemap │ │ ├── OHHTTPStubs.release.xcconfig │ │ └── OHHTTPStubs.xcconfig │ │ ├── Pods-MapCache_Example │ │ ├── Info.plist │ │ ├── Pods-MapCache_Example-Info.plist │ │ ├── Pods-MapCache_Example-acknowledgements.markdown │ │ ├── Pods-MapCache_Example-acknowledgements.plist │ │ ├── Pods-MapCache_Example-dummy.m │ │ ├── Pods-MapCache_Example-frameworks.sh │ │ ├── Pods-MapCache_Example-resources.sh │ │ ├── Pods-MapCache_Example-umbrella.h │ │ ├── Pods-MapCache_Example.debug.xcconfig │ │ ├── Pods-MapCache_Example.modulemap │ │ └── Pods-MapCache_Example.release.xcconfig │ │ ├── Pods-MapCache_Tests │ │ ├── Info.plist │ │ ├── Pods-MapCache_Tests-Info.plist │ │ ├── Pods-MapCache_Tests-acknowledgements.markdown │ │ ├── Pods-MapCache_Tests-acknowledgements.plist │ │ ├── Pods-MapCache_Tests-dummy.m │ │ ├── Pods-MapCache_Tests-frameworks.sh │ │ ├── Pods-MapCache_Tests-resources.sh │ │ ├── Pods-MapCache_Tests-umbrella.h │ │ ├── Pods-MapCache_Tests.debug.xcconfig │ │ ├── Pods-MapCache_Tests.modulemap │ │ └── Pods-MapCache_Tests.release.xcconfig │ │ └── Quick │ │ ├── Info.plist │ │ ├── Quick-Info.plist │ │ ├── Quick-dummy.m │ │ ├── Quick-prefix.pch │ │ ├── Quick-umbrella.h │ │ ├── Quick.debug.xcconfig │ │ ├── Quick.modulemap │ │ ├── Quick.release.xcconfig │ │ └── Quick.xcconfig └── Tests │ ├── DiskCache │ ├── DiskCacheSpecs.swift │ └── String+DiskCacheSpecs.swift │ ├── Info.plist │ ├── MapCacheConfigTests.swift │ ├── MapCacheTests.swift │ ├── RegionDownloaderSpecs.swift │ ├── Tests.swift │ ├── TileCoordsSpecs.swift │ ├── TileRangeSpecs.swift │ ├── TileRegionSpecs.swift │ └── ZoomRangeSpecs.swift ├── LICENSE ├── MapCache.podspec ├── MapCache ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── CachedTileOverlay.swift │ ├── CachedTileOverlayRenderer.swift │ ├── DiskCache │ ├── DiskCache.swift │ ├── FileManager+DiskCache.swift │ ├── MD5.swift │ ├── String+DiskCache.swift │ └── URL+DiskCache.swift │ ├── LoadTileMode.swift │ ├── Log.swift │ ├── MKMapView+MapCache.swift │ ├── MKTileOverlayPath+MapCache.swift │ ├── MKZoomScale+MapCache.swift │ ├── MapCache.swift │ ├── MapCacheConfig.swift │ ├── MapCacheProtocol.swift │ ├── RegionDownloader.swift │ ├── RegionDownloaderDelegate.swift │ ├── TileCoords.swift │ ├── TileCoordsRegion.swift │ ├── TileRange.swift │ ├── TileRangeIterator.swift │ ├── ZoomRange.swift │ ├── ZoomRangeIterator.swift │ └── ZoomableTile.swift ├── Package.swift ├── README.md ├── _Pods.xcodeproj ├── docs ├── Classes.html ├── Classes │ ├── CachedTileOverlay.html │ ├── CachedTileOverlayRenderer.html │ ├── CachedTileOverlayZoomRenderer.html │ ├── DiskCache.html │ ├── HashBase.html │ ├── MD5.html │ ├── MapCache.html │ ├── RegionDownloader.html │ ├── TileCoords.html │ └── TileCoordsRegion.html ├── Enums.html ├── Enums │ ├── LatitudeError.html │ ├── LoadTileMode.html │ ├── LongitudeError.html │ ├── TileError.html │ ├── TileRangeError.html │ └── ZoomError.html ├── Extensions.html ├── Extensions │ ├── FileManager.html │ ├── FileManager │ │ ├── allocatedDiskSizeForDirectory(at:).html │ │ └── fileSizeForDirectory(at:).html │ ├── Int.html │ ├── MKMapView.html │ ├── MKTileOverlayPath.html │ ├── MKZoomScale.html │ ├── NSMutableData.html │ ├── String.html │ └── URL.html ├── Functions.html ├── Protocols.html ├── Protocols │ ├── MapCacheProtocol.html │ └── RegionDownloaderDelegate.html ├── Structs.html ├── Structs │ ├── BytesSequence.html │ ├── Log.html │ ├── Log │ │ └── Level.html │ ├── MapCacheConfig.html │ ├── TileRange.html │ ├── TileRangeIterator.html │ ├── ZoomRange.html │ ├── ZoomRangeIterator.html │ └── ZoomableTile.html ├── Typealiases.html ├── badge.svg ├── css │ ├── highlight.css │ └── jazzy.css ├── docsets │ ├── MapCache.docset │ │ └── Contents │ │ │ ├── Info.plist │ │ │ └── Resources │ │ │ ├── Documents │ │ │ ├── Classes.html │ │ │ ├── Classes │ │ │ │ ├── CachedTileOverlay.html │ │ │ │ ├── CachedTileOverlayRenderer.html │ │ │ │ ├── CachedTileOverlayZoomRenderer.html │ │ │ │ ├── DiskCache.html │ │ │ │ ├── HashBase.html │ │ │ │ ├── MD5.html │ │ │ │ ├── MapCache.html │ │ │ │ ├── RegionDownloader.html │ │ │ │ ├── TileCoords.html │ │ │ │ └── TileCoordsRegion.html │ │ │ ├── Enums.html │ │ │ ├── Enums │ │ │ │ ├── LatitudeError.html │ │ │ │ ├── LoadTileMode.html │ │ │ │ ├── LongitudeError.html │ │ │ │ ├── TileError.html │ │ │ │ ├── TileRangeError.html │ │ │ │ └── ZoomError.html │ │ │ ├── Extensions.html │ │ │ ├── Extensions │ │ │ │ ├── FileManager.html │ │ │ │ ├── FileManager │ │ │ │ │ ├── allocatedDiskSizeForDirectory(at:).html │ │ │ │ │ └── fileSizeForDirectory(at:).html │ │ │ │ ├── Int.html │ │ │ │ ├── MKMapView.html │ │ │ │ ├── MKTileOverlayPath.html │ │ │ │ ├── MKZoomScale.html │ │ │ │ ├── NSMutableData.html │ │ │ │ ├── String.html │ │ │ │ └── URL.html │ │ │ ├── Functions.html │ │ │ ├── Protocols.html │ │ │ ├── Protocols │ │ │ │ ├── MapCacheProtocol.html │ │ │ │ └── RegionDownloaderDelegate.html │ │ │ ├── Structs.html │ │ │ ├── Structs │ │ │ │ ├── BytesSequence.html │ │ │ │ ├── Log.html │ │ │ │ ├── Log │ │ │ │ │ └── Level.html │ │ │ │ ├── MapCacheConfig.html │ │ │ │ ├── TileRange.html │ │ │ │ ├── TileRangeIterator.html │ │ │ │ ├── ZoomRange.html │ │ │ │ ├── ZoomRangeIterator.html │ │ │ │ └── ZoomableTile.html │ │ │ ├── Typealiases.html │ │ │ ├── badge.svg │ │ │ ├── css │ │ │ │ ├── highlight.css │ │ │ │ └── jazzy.css │ │ │ ├── img │ │ │ │ ├── carat.png │ │ │ │ ├── dash.png │ │ │ │ ├── gh.png │ │ │ │ └── spinner.gif │ │ │ ├── index.html │ │ │ ├── js │ │ │ │ ├── jazzy.js │ │ │ │ ├── jazzy.search.js │ │ │ │ ├── jquery.min.js │ │ │ │ ├── lunr.min.js │ │ │ │ └── typeahead.jquery.js │ │ │ ├── search.json │ │ │ └── undocumented.json │ │ │ └── docSet.dsidx │ └── MapCache.tgz ├── img │ ├── carat.png │ ├── dash.png │ ├── gh.png │ └── spinner.gif ├── index.html ├── js │ ├── jazzy.js │ ├── jazzy.search.js │ ├── jquery.min.js │ ├── lunr.min.js │ └── typeahead.jquery.js ├── search.json └── undocumented.json └── images └── MapCache.png /.github/workflows/swift.yml: -------------------------------------------------------------------------------- 1 | name: Swift 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: macOS-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: install xpretty 13 | run: gem install xcpretty 14 | - name: install pods 15 | run: | 16 | cd Example 17 | pod install 18 | cd .. 19 | - name: environment info 20 | run: | 21 | xcodebuild -version 22 | xcodebuild -showsdks 23 | xcrun instruments -s devices 24 | - name: Test 25 | run: | 26 | set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MapCache.xcworkspace -scheme MapCache-Example -sdk iphonesimulator13.7 -destination 'platform=iOS Simulator,name=iPhone 11' ONLY_ACTIVE_ARCH=NO | xcpretty 27 | # TODO do not allow warnings 28 | pod lib lint --allow-warnings 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | # Pods/ 38 | -------------------------------------------------------------------------------- /.jazzy.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # MapCache - Jazzy config file 3 | # 4 | # Jazzy is a tool for generating SWIFT documentation in HTML. 5 | # More info in: https://github.com/realm/jazzy 6 | # 7 | # Install jazzy 8 | # 9 | # $ gem install jazzy 10 | # 11 | # Run jazzy 12 | # 13 | # $ cd 14 | # $ jazzy 15 | # 16 | # Note the output is ./docs 17 | # 18 | # ---------------------------------------- 19 | # xcodebuild command line to get list of targets 20 | # 21 | # xcodebuild -list 22 | # 23 | # 24 | 25 | 26 | output: ./docs 27 | 28 | author_url: https://github.com/merlos/MapCache 29 | github_url: https://github.com/merlos/MapCache 30 | theme: apple 31 | min_acl: private 32 | 33 | xcodebuild_arguments: 34 | - clean 35 | - build 36 | 37 | - -workspace 38 | - Example/MapCache.xcworkspace 39 | 40 | - -scheme 41 | - MapCache 42 | 43 | 44 | 45 | #- "CODE_SIGN_IDENTITY=" 46 | #- "CODE_SIGNING_REQUIRED=NO" 47 | #- "CODE_SIGNING_ALLOWED=NO" 48 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode12 6 | language: swift 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | - gem install xcpretty 13 | script: 14 | 15 | # Display some environment info. 16 | - xcodebuild -version 17 | - xcodebuild -showsdks 18 | - xcrun xctrace list devices 19 | 20 | # Build-a-bear 21 | 22 | #- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MapCache.xcworkspace -scheme MapCache-Example -sdk iphonesimulator14.0 -destination 'platform=iOS Simulator,name=iPhone 11' ONLY_ACTIVE_ARCH=NO | grep -E "Test Case |\[MAPCACHE\]|error:" 23 | 24 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MapCache.xcworkspace -scheme MapCache-Example -sdk iphonesimulator14.0 -destination 'platform=iOS Simulator,name=iPhone 11' ONLY_ACTIVE_ARCH=NO | xcpretty 25 | - pod lib lint --allow-warnings 26 | -------------------------------------------------------------------------------- /Example/MapCache.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/MapCache.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/MapCache.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/MapCache/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 05/12/2019. 6 | // Copyright (c) 2019 merlos. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/MapCache/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Example/MapCache/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'MapCache_Example' do 4 | pod 'MapCache', :path => '../' 5 | 6 | target 'MapCache_Tests' do 7 | inherit! :search_paths 8 | pod 'OHHTTPStubs/Swift','~> 8.0.0' 9 | pod 'Quick', '~> 3.0.0' 10 | pod 'Nimble', '~> 9.2.0' 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MapCache (0.9.0) 3 | - Nimble (9.2.1) 4 | - OHHTTPStubs/Core (8.0.0) 5 | - OHHTTPStubs/Default (8.0.0): 6 | - OHHTTPStubs/Core 7 | - OHHTTPStubs/JSON 8 | - OHHTTPStubs/NSURLSession 9 | - OHHTTPStubs/OHPathHelpers 10 | - OHHTTPStubs/JSON (8.0.0): 11 | - OHHTTPStubs/Core 12 | - OHHTTPStubs/NSURLSession (8.0.0): 13 | - OHHTTPStubs/Core 14 | - OHHTTPStubs/OHPathHelpers (8.0.0) 15 | - OHHTTPStubs/Swift (8.0.0): 16 | - OHHTTPStubs/Default 17 | - Quick (3.0.0) 18 | 19 | DEPENDENCIES: 20 | - MapCache (from `../`) 21 | - Nimble (~> 9.2.0) 22 | - OHHTTPStubs/Swift (~> 8.0.0) 23 | - Quick (~> 3.0.0) 24 | 25 | SPEC REPOS: 26 | trunk: 27 | - Nimble 28 | - OHHTTPStubs 29 | - Quick 30 | 31 | EXTERNAL SOURCES: 32 | MapCache: 33 | :path: "../" 34 | 35 | SPEC CHECKSUMS: 36 | MapCache: 1dd68aaa2d129af29596cb0a9cfb1b159deba8d8 37 | Nimble: e7e615c0335ee4bf5b0d786685451e62746117d5 38 | OHHTTPStubs: 9cbce6364bec557cc3439aa6bb7514670d780881 39 | Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2 40 | 41 | PODFILE CHECKSUM: c56222c195164b949de3caaf624bf2962e54ad2a 42 | 43 | COCOAPODS: 1.12.1 44 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/MapCache.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MapCache", 3 | "version": "0.9.0", 4 | "summary": "Map caching for iOS. Support offline maps in your app.", 5 | "description": "Cache for iOS applications for supporting offline tile maps. Downloads and keeps tiles in disk as user browses the map. Also, it can download a complete area at all different zoom levels for a complete offline experience (beta).\u0013", 6 | "homepage": "https://github.com/merlos/MapCache", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "merlos": "merlos@users.noreply.github.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/merlos/MapCache.git", 16 | "tag": "0.9.0" 17 | }, 18 | "social_media_url": "https://twitter.com/merlos", 19 | "swift_versions": "5.0", 20 | "source_files": "MapCache/Classes/**/*", 21 | "platforms": { 22 | "ios": "11.0", 23 | "osx": "10.10" 24 | }, 25 | "frameworks": [ 26 | "Foundation", 27 | "MapKit" 28 | ], 29 | "swift_version": "5.0" 30 | } 31 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MapCache (0.9.0) 3 | - Nimble (9.2.1) 4 | - OHHTTPStubs/Core (8.0.0) 5 | - OHHTTPStubs/Default (8.0.0): 6 | - OHHTTPStubs/Core 7 | - OHHTTPStubs/JSON 8 | - OHHTTPStubs/NSURLSession 9 | - OHHTTPStubs/OHPathHelpers 10 | - OHHTTPStubs/JSON (8.0.0): 11 | - OHHTTPStubs/Core 12 | - OHHTTPStubs/NSURLSession (8.0.0): 13 | - OHHTTPStubs/Core 14 | - OHHTTPStubs/OHPathHelpers (8.0.0) 15 | - OHHTTPStubs/Swift (8.0.0): 16 | - OHHTTPStubs/Default 17 | - Quick (3.0.0) 18 | 19 | DEPENDENCIES: 20 | - MapCache (from `../`) 21 | - Nimble (~> 9.2.0) 22 | - OHHTTPStubs/Swift (~> 8.0.0) 23 | - Quick (~> 3.0.0) 24 | 25 | SPEC REPOS: 26 | trunk: 27 | - Nimble 28 | - OHHTTPStubs 29 | - Quick 30 | 31 | EXTERNAL SOURCES: 32 | MapCache: 33 | :path: "../" 34 | 35 | SPEC CHECKSUMS: 36 | MapCache: 1dd68aaa2d129af29596cb0a9cfb1b159deba8d8 37 | Nimble: e7e615c0335ee4bf5b0d786685451e62746117d5 38 | OHHTTPStubs: 9cbce6364bec557cc3439aa6bb7514670d780881 39 | Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2 40 | 41 | PODFILE CHECKSUM: c56222c195164b949de3caaf624bf2962e54ad2a 42 | 43 | COCOAPODS: 1.12.1 44 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Carthage/Checkouts/CwlCatchException/Sources/CwlCatchException/CwlCatchException.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CwlCatchException.swift 3 | // CwlAssertionTesting 4 | // 5 | // Created by Matt Gallagher on 2016/01/10. 6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved. 7 | // 8 | // Permission to use, copy, modify, and/or distribute this software for any 9 | // purpose with or without fee is hereby granted, provided that the above 10 | // copyright notice and this permission notice appear in all copies. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | // 20 | 21 | import Foundation 22 | 23 | #if SWIFT_PACKAGE 24 | import CwlCatchExceptionSupport 25 | #endif 26 | 27 | private func catchReturnTypeConverter(_ type: T.Type, block: @escaping () -> Void) -> T? { 28 | return catchExceptionOfKind(type, block) as? T 29 | } 30 | 31 | extension NSException { 32 | public static func catchException(in block: @escaping () -> Void) -> Self? { 33 | return catchReturnTypeConverter(self, block: block) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Carthage/Checkouts/CwlCatchException/Sources/CwlCatchExceptionSupport/CwlCatchException.m: -------------------------------------------------------------------------------- 1 | // 2 | // CwlCatchException.m 3 | // CwlAssertionTesting 4 | // 5 | // Created by Matt Gallagher on 2016/01/10. 6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved. 7 | // 8 | // Permission to use, copy, modify, and/or distribute this software for any 9 | // purpose with or without fee is hereby granted, provided that the above 10 | // copyright notice and this permission notice appear in all copies. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | // 20 | 21 | #import "CwlCatchException.h" 22 | 23 | NSException* __nullable catchExceptionOfKind(Class __nonnull type, void (^ __nonnull inBlock)(void)) { 24 | @try { 25 | inBlock(); 26 | } @catch (NSException *exception) { 27 | if ([exception isKindOfClass:type]) { 28 | return exception; 29 | } else { 30 | @throw; 31 | } 32 | } 33 | return nil; 34 | } 35 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Carthage/Checkouts/CwlCatchException/Sources/CwlCatchExceptionSupport/include/CwlCatchException.h: -------------------------------------------------------------------------------- 1 | // 2 | // CwlCatchException.h 3 | // CwlCatchException 4 | // 5 | // Created by Matt Gallagher on 2016/01/10. 6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved. 7 | // 8 | // Permission to use, copy, modify, and/or distribute this software for any 9 | // purpose with or without fee is hereby granted, provided that the above 10 | // copyright notice and this permission notice appear in all copies. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | // 20 | 21 | #import 22 | 23 | NSException* __nullable catchExceptionOfKind(Class __nonnull type, void (^ __nonnull inBlock)(void)); 24 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CwlDarwinDefinitions.swift 3 | // CwlPreconditionTesting 4 | // 5 | // Created by Matt Gallagher on 2016/01/10. 6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved. 7 | // 8 | // Permission to use, copy, modify, and/or distribute this software for any 9 | // purpose with or without fee is hereby granted, provided that the above 10 | // copyright notice and this permission notice appear in all copies. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | // 20 | 21 | #if (os(macOS) || os(iOS)) && arch(x86_64) 22 | 23 | import Darwin 24 | 25 | // From /usr/include/mach/message.h 26 | // #define MACH_MSG_TYPE_MAKE_SEND 20 /* Must hold receive right */ 27 | // #define MACH_MSGH_BITS_REMOTE(bits) \ 28 | // ((bits) & MACH_MSGH_BITS_REMOTE_MASK) 29 | // #define MACH_MSGH_BITS(remote, local) /* legacy */ \ 30 | // ((remote) | ((local) << 8)) 31 | public let MACH_MSG_TYPE_MAKE_SEND: UInt32 = 20 32 | public func MACH_MSGH_BITS_REMOTE(_ bits: UInt32) -> UInt32 { return bits & UInt32(MACH_MSGH_BITS_REMOTE_MASK) } 33 | public func MACH_MSGH_BITS(_ remote: UInt32, _ local: UInt32) -> UInt32 { return ((remote) | ((local) << 8)) } 34 | 35 | // From /usr/include/mach/exception_types.h 36 | // #define EXC_BAD_INSTRUCTION 2 /* Instruction failed */ 37 | // #define EXC_MASK_BAD_INSTRUCTION (1 << EXC_BAD_INSTRUCTION) 38 | public let EXC_BAD_INSTRUCTION: UInt32 = 2 39 | public let EXC_MASK_BAD_INSTRUCTION: UInt32 = 1 << EXC_BAD_INSTRUCTION 40 | 41 | // From /usr/include/mach/i386/thread_status.h 42 | // #define x86_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \ 43 | // ( sizeof (x86_thread_state64_t) / sizeof (int) )) 44 | public let x86_THREAD_STATE64_COUNT = UInt32(MemoryLayout.size / MemoryLayout.size) 45 | 46 | public let EXC_TYPES_COUNT = 14 47 | public struct execTypesCountTuple { 48 | // From /usr/include/mach/i386/exception.h 49 | // #define EXC_TYPES_COUNT 14 /* incl. illegal exception 0 */ 50 | public var value: (T, T, T, T, T, T, T, T, T, T, T, T, T, T) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) 51 | public init() { 52 | } 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Adapters/AdapterProtocols.swift: -------------------------------------------------------------------------------- 1 | /// Protocol for the assertion handler that Nimble uses for all expectations. 2 | public protocol AssertionHandler { 3 | func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) 4 | } 5 | 6 | /// Global backing interface for assertions that Nimble creates. 7 | /// Defaults to a private test handler that passes through to XCTest. 8 | /// 9 | /// If XCTest is not available, you must assign your own assertion handler 10 | /// before using any matchers, otherwise Nimble will abort the program. 11 | /// 12 | /// @see AssertionHandler 13 | public var NimbleAssertionHandler: AssertionHandler = { () -> AssertionHandler in 14 | // swiftlint:disable:previous identifier_name 15 | return isXCTestAvailable() ? NimbleXCTestHandler() : NimbleXCTestUnavailableHandler() 16 | }() 17 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Adapters/AssertionDispatcher.swift: -------------------------------------------------------------------------------- 1 | /// AssertionDispatcher allows multiple AssertionHandlers to receive 2 | /// assertion messages. 3 | /// 4 | /// @warning Does not fully dispatch if one of the handlers raises an exception. 5 | /// This is possible with XCTest-based assertion handlers. 6 | /// 7 | public class AssertionDispatcher: AssertionHandler { 8 | let handlers: [AssertionHandler] 9 | 10 | public init(handlers: [AssertionHandler]) { 11 | self.handlers = handlers 12 | } 13 | 14 | public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) { 15 | for handler in handlers { 16 | handler.assert(assertion, message: message, location: location) 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Adapters/NimbleEnvironment.swift: -------------------------------------------------------------------------------- 1 | import Dispatch 2 | import class Foundation.NSObject 3 | import class Foundation.Thread 4 | 5 | /// "Global" state of Nimble is stored here. Only DSL functions should access / be aware of this 6 | /// class' existence 7 | internal class NimbleEnvironment: NSObject { 8 | static var activeInstance: NimbleEnvironment { 9 | get { 10 | let env = Thread.current.threadDictionary["NimbleEnvironment"] 11 | if let env = env as? NimbleEnvironment { 12 | return env 13 | } else { 14 | let newEnv = NimbleEnvironment() 15 | self.activeInstance = newEnv 16 | return newEnv 17 | } 18 | } 19 | set { 20 | Thread.current.threadDictionary["NimbleEnvironment"] = newValue 21 | } 22 | } 23 | 24 | // swiftlint:disable:next todo 25 | // TODO: eventually migrate the global to this environment value 26 | var assertionHandler: AssertionHandler { 27 | get { return NimbleAssertionHandler } 28 | set { NimbleAssertionHandler = newValue } 29 | } 30 | 31 | var suppressTVOSAssertionWarning: Bool = false 32 | var awaiter: Awaiter 33 | 34 | override init() { 35 | let timeoutQueue = DispatchQueue.global(qos: .userInitiated) 36 | awaiter = Awaiter( 37 | waitLock: AssertionWaitLock(), 38 | asyncQueue: .main, 39 | timeoutQueue: timeoutQueue 40 | ) 41 | 42 | super.init() 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeAKindOf.swift: -------------------------------------------------------------------------------- 1 | private func matcherMessage(forType expectedType: T.Type) -> String { 2 | return "be a kind of \(String(describing: expectedType))" 3 | } 4 | private func matcherMessage(forClass expectedClass: AnyClass) -> String { 5 | return "be a kind of \(String(describing: expectedClass))" 6 | } 7 | 8 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class. 9 | public func beAKindOf(_ expectedType: T.Type) -> Predicate { 10 | return Predicate.define { actualExpression in 11 | let message: ExpectationMessage 12 | 13 | let instance = try actualExpression.evaluate() 14 | guard let validInstance = instance else { 15 | message = .expectedCustomValueTo(matcherMessage(forType: expectedType), actual: "") 16 | return PredicateResult(status: .fail, message: message) 17 | } 18 | message = .expectedCustomValueTo( 19 | "be a kind of \(String(describing: expectedType))", 20 | actual: "<\(String(describing: type(of: validInstance))) instance>" 21 | ) 22 | 23 | return PredicateResult( 24 | bool: validInstance is T, 25 | message: message 26 | ) 27 | } 28 | } 29 | 30 | #if canImport(Darwin) 31 | import class Foundation.NSObject 32 | 33 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class. 34 | /// @see beAnInstanceOf if you want to match against the exact class 35 | public func beAKindOf(_ expectedClass: AnyClass) -> Predicate { 36 | return Predicate.define { actualExpression in 37 | let message: ExpectationMessage 38 | let status: PredicateStatus 39 | 40 | let instance = try actualExpression.evaluate() 41 | if let validInstance = instance { 42 | status = PredicateStatus(bool: instance != nil && instance!.isKind(of: expectedClass)) 43 | message = .expectedCustomValueTo( 44 | matcherMessage(forClass: expectedClass), 45 | actual: "<\(String(describing: type(of: validInstance))) instance>" 46 | ) 47 | } else { 48 | status = .fail 49 | message = .expectedCustomValueTo( 50 | matcherMessage(forClass: expectedClass), 51 | actual: "" 52 | ) 53 | } 54 | 55 | return PredicateResult(status: status, message: message) 56 | } 57 | } 58 | 59 | extension NMBPredicate { 60 | @objc public class func beAKindOfMatcher(_ expected: AnyClass) -> NMBPredicate { 61 | return NMBPredicate { actualExpression in 62 | return try beAKindOf(expected).satisfies(actualExpression).toObjectiveC() 63 | } 64 | } 65 | } 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeAnInstanceOf.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is an _exact_ instance of the given class. 4 | public func beAnInstanceOf(_ expectedType: T.Type) -> Predicate { 5 | let errorMessage = "be an instance of \(String(describing: expectedType))" 6 | return Predicate.define { actualExpression in 7 | let instance = try actualExpression.evaluate() 8 | guard let validInstance = instance else { 9 | return PredicateResult( 10 | status: .doesNotMatch, 11 | message: .expectedActualValueTo(errorMessage) 12 | ) 13 | } 14 | 15 | let actualString = "<\(String(describing: type(of: validInstance))) instance>" 16 | 17 | return PredicateResult( 18 | status: PredicateStatus(bool: type(of: validInstance) == expectedType), 19 | message: .expectedCustomValueTo(errorMessage, actual: actualString) 20 | ) 21 | } 22 | } 23 | 24 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class. 25 | /// @see beAKindOf if you want to match against subclasses 26 | public func beAnInstanceOf(_ expectedClass: AnyClass) -> Predicate { 27 | let errorMessage = "be an instance of \(String(describing: expectedClass))" 28 | return Predicate.define { actualExpression in 29 | let instance = try actualExpression.evaluate() 30 | let actualString: String 31 | if let validInstance = instance { 32 | actualString = "<\(String(describing: type(of: validInstance))) instance>" 33 | } else { 34 | actualString = "" 35 | } 36 | #if canImport(Darwin) 37 | let matches = instance != nil && instance!.isMember(of: expectedClass) 38 | #else 39 | let matches = instance != nil && type(of: instance!) == expectedClass 40 | #endif 41 | return PredicateResult( 42 | status: PredicateStatus(bool: matches), 43 | message: .expectedCustomValueTo(errorMessage, actual: actualString) 44 | ) 45 | } 46 | } 47 | 48 | #if canImport(Darwin) 49 | extension NMBPredicate { 50 | @objc public class func beAnInstanceOfMatcher(_ expected: AnyClass) -> NMBPredicate { 51 | return NMBPredicate { actualExpression in 52 | return try beAnInstanceOf(expected).satisfies(actualExpression).toObjectiveC() 53 | } 54 | } 55 | } 56 | #endif 57 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThan.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value. 2 | public func beGreaterThan(_ expectedValue: T?) -> Predicate { 3 | let errorMessage = "be greater than <\(stringify(expectedValue))>" 4 | return Predicate.simple(errorMessage) { actualExpression in 5 | guard let actual = try actualExpression.evaluate(), let expected = expectedValue else { return .fail } 6 | 7 | return PredicateStatus(bool: actual > expected) 8 | } 9 | } 10 | 11 | public func >(lhs: Expectation, rhs: T) { 12 | lhs.to(beGreaterThan(rhs)) 13 | } 14 | 15 | #if canImport(Darwin) 16 | import enum Foundation.ComparisonResult 17 | 18 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value. 19 | public func beGreaterThan(_ expectedValue: NMBComparable?) -> Predicate { 20 | let errorMessage = "be greater than <\(stringify(expectedValue))>" 21 | return Predicate.simple(errorMessage) { actualExpression in 22 | let actualValue = try actualExpression.evaluate() 23 | let matches = actualValue != nil 24 | && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedDescending 25 | return PredicateStatus(bool: matches) 26 | } 27 | } 28 | 29 | public func > (lhs: Expectation, rhs: NMBComparable?) { 30 | lhs.to(beGreaterThan(rhs)) 31 | } 32 | 33 | extension NMBPredicate { 34 | @objc public class func beGreaterThanMatcher(_ expected: NMBComparable?) -> NMBPredicate { 35 | return NMBPredicate { actualExpression in 36 | let expr = actualExpression.cast { $0 as? NMBComparable } 37 | return try beGreaterThan(expected).satisfies(expr).toObjectiveC() 38 | } 39 | } 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual value is greater than 2 | /// or equal to the expected value. 3 | public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> Predicate { 4 | let message = "be greater than or equal to <\(stringify(expectedValue))>" 5 | return Predicate.simple(message) { actualExpression in 6 | guard let actual = try actualExpression.evaluate(), let expected = expectedValue else { return .fail } 7 | 8 | return PredicateStatus(bool: actual >= expected) 9 | } 10 | } 11 | 12 | public func >=(lhs: Expectation, rhs: T) { 13 | lhs.to(beGreaterThanOrEqualTo(rhs)) 14 | } 15 | 16 | #if canImport(Darwin) 17 | import enum Foundation.ComparisonResult 18 | 19 | /// A Nimble matcher that succeeds when the actual value is greater than 20 | /// or equal to the expected value. 21 | public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> Predicate { 22 | let message = "be greater than or equal to <\(stringify(expectedValue))>" 23 | return Predicate.simple(message) { actualExpression in 24 | let actualValue = try actualExpression.evaluate() 25 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) != ComparisonResult.orderedAscending 26 | return PredicateStatus(bool: matches) 27 | } 28 | } 29 | 30 | public func >=(lhs: Expectation, rhs: T) { 31 | lhs.to(beGreaterThanOrEqualTo(rhs)) 32 | } 33 | 34 | extension NMBPredicate { 35 | @objc public class func beGreaterThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBPredicate { 36 | return NMBPredicate { actualExpression in 37 | let expr = actualExpression.cast { $0 as? NMBComparable } 38 | return try beGreaterThanOrEqualTo(expected).satisfies(expr).toObjectiveC() 39 | } 40 | } 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeIdenticalTo.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual value is the same instance 2 | /// as the expected instance. 3 | public func beIdenticalTo(_ expected: Any?) -> Predicate { 4 | return Predicate.define { actualExpression in 5 | let actual = try actualExpression.evaluate() as AnyObject? 6 | 7 | let bool = actual === (expected as AnyObject?) && actual !== nil 8 | return PredicateResult( 9 | bool: bool, 10 | message: .expectedCustomValueTo( 11 | "be identical to \(identityAsString(expected))", 12 | actual: "\(identityAsString(actual))" 13 | ) 14 | ) 15 | } 16 | } 17 | 18 | extension Expectation where T == Any { 19 | public static func === (lhs: Expectation, rhs: Any?) { 20 | lhs.to(beIdenticalTo(rhs)) 21 | } 22 | 23 | public static func !== (lhs: Expectation, rhs: Any?) { 24 | lhs.toNot(beIdenticalTo(rhs)) 25 | } 26 | } 27 | 28 | /// A Nimble matcher that succeeds when the actual value is the same instance 29 | /// as the expected instance. 30 | /// 31 | /// Alias for "beIdenticalTo". 32 | public func be(_ expected: Any?) -> Predicate { 33 | return beIdenticalTo(expected) 34 | } 35 | 36 | #if canImport(Darwin) 37 | import class Foundation.NSObject 38 | 39 | extension NMBPredicate { 40 | @objc public class func beIdenticalToMatcher(_ expected: NSObject?) -> NMBPredicate { 41 | return NMBPredicate { actualExpression in 42 | let aExpr = actualExpression.cast { $0 as Any? } 43 | return try beIdenticalTo(expected).satisfies(aExpr).toObjectiveC() 44 | } 45 | } 46 | } 47 | #endif 48 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThan.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual value is less than the expected value. 2 | public func beLessThan(_ expectedValue: T?) -> Predicate { 3 | let message = "be less than <\(stringify(expectedValue))>" 4 | return Predicate.simple(message) { actualExpression in 5 | guard let actual = try actualExpression.evaluate(), let expected = expectedValue else { return .fail } 6 | 7 | return PredicateStatus(bool: actual < expected) 8 | } 9 | } 10 | 11 | public func <(lhs: Expectation, rhs: T) { 12 | lhs.to(beLessThan(rhs)) 13 | } 14 | 15 | #if canImport(Darwin) 16 | import enum Foundation.ComparisonResult 17 | 18 | /// A Nimble matcher that succeeds when the actual value is less than the expected value. 19 | public func beLessThan(_ expectedValue: NMBComparable?) -> Predicate { 20 | let message = "be less than <\(stringify(expectedValue))>" 21 | return Predicate.simple(message) { actualExpression in 22 | let actualValue = try actualExpression.evaluate() 23 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedAscending 24 | return PredicateStatus(bool: matches) 25 | } 26 | } 27 | 28 | public func < (lhs: Expectation, rhs: NMBComparable?) { 29 | lhs.to(beLessThan(rhs)) 30 | } 31 | 32 | extension NMBPredicate { 33 | @objc public class func beLessThanMatcher(_ expected: NMBComparable?) -> NMBPredicate { 34 | return NMBPredicate { actualExpression in 35 | let expr = actualExpression.cast { $0 as? NMBComparable } 36 | return try beLessThan(expected).satisfies(expr).toObjectiveC() 37 | } 38 | } 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThanOrEqual.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual value is less than 2 | /// or equal to the expected value. 3 | public func beLessThanOrEqualTo(_ expectedValue: T?) -> Predicate { 4 | return Predicate.simple("be less than or equal to <\(stringify(expectedValue))>") { actualExpression in 5 | guard let actual = try actualExpression.evaluate(), let expected = expectedValue else { return .fail } 6 | 7 | return PredicateStatus(bool: actual <= expected) 8 | } 9 | } 10 | 11 | public func <=(lhs: Expectation, rhs: T) { 12 | lhs.to(beLessThanOrEqualTo(rhs)) 13 | } 14 | 15 | #if canImport(Darwin) 16 | import enum Foundation.ComparisonResult 17 | 18 | /// A Nimble matcher that succeeds when the actual value is less than 19 | /// or equal to the expected value. 20 | public func beLessThanOrEqualTo(_ expectedValue: T?) -> Predicate { 21 | return Predicate.simple("be less than or equal to <\(stringify(expectedValue))>") { actualExpression in 22 | let actualValue = try actualExpression.evaluate() 23 | let matches = actualValue.map { $0.NMB_compare(expectedValue) != .orderedDescending } ?? false 24 | return PredicateStatus(bool: matches) 25 | } 26 | } 27 | 28 | public func <=(lhs: Expectation, rhs: T) { 29 | lhs.to(beLessThanOrEqualTo(rhs)) 30 | } 31 | 32 | extension NMBPredicate { 33 | @objc public class func beLessThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBPredicate { 34 | return NMBPredicate { actualExpression in 35 | let expr = actualExpression.cast { $0 as? NMBComparable } 36 | return try beLessThanOrEqualTo(expected).satisfies(expr).toObjectiveC() 37 | } 38 | } 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeNil.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual value is nil. 2 | public func beNil() -> Predicate { 3 | return Predicate.simpleNilable("be nil") { actualExpression in 4 | let actualValue = try actualExpression.evaluate() 5 | return PredicateStatus(bool: actualValue == nil) 6 | } 7 | } 8 | 9 | #if canImport(Darwin) 10 | import Foundation 11 | 12 | extension NMBPredicate { 13 | @objc public class func beNilMatcher() -> NMBPredicate { 14 | return NMBPredicate { actualExpression in 15 | return try beNil().satisfies(actualExpression).toObjectiveC() 16 | } 17 | } 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeVoid.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual value is Void. 2 | public func beVoid() -> Predicate<()> { 3 | return Predicate.simpleNilable("be void") { actualExpression in 4 | let actualValue: ()? = try actualExpression.evaluate() 5 | return PredicateStatus(bool: actualValue != nil) 6 | } 7 | } 8 | 9 | extension Expectation where T == () { 10 | public static func == (lhs: Expectation<()>, rhs: ()) { 11 | lhs.to(beVoid()) 12 | } 13 | 14 | public static func != (lhs: Expectation<()>, rhs: ()) { 15 | lhs.toNot(beVoid()) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeginWith.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual sequence's first element 4 | /// is equal to the expected value. 5 | public func beginWith(_ startingElement: S.Element) -> Predicate where S.Element: Equatable { 6 | return Predicate.simple("begin with <\(startingElement)>") { actualExpression in 7 | guard let actualValue = try actualExpression.evaluate() else { return .fail } 8 | 9 | var actualGenerator = actualValue.makeIterator() 10 | return PredicateStatus(bool: actualGenerator.next() == startingElement) 11 | } 12 | } 13 | 14 | /// A Nimble matcher that succeeds when the actual collection's first element 15 | /// is equal to the expected object. 16 | public func beginWith(_ startingElement: Any) -> Predicate { 17 | return Predicate.simple("begin with <\(startingElement)>") { actualExpression in 18 | guard let collection = try actualExpression.evaluate() else { return .fail } 19 | guard collection.count > 0 else { return .doesNotMatch } 20 | #if os(Linux) 21 | guard let collectionValue = collection.object(at: 0) as? NSObject else { 22 | return .fail 23 | } 24 | #else 25 | let collectionValue = collection.object(at: 0) as AnyObject 26 | #endif 27 | return PredicateStatus(bool: collectionValue.isEqual(startingElement)) 28 | } 29 | } 30 | 31 | /// A Nimble matcher that succeeds when the actual string contains expected substring 32 | /// where the expected substring's location is zero. 33 | public func beginWith(_ startingSubstring: String) -> Predicate { 34 | return Predicate.simple("begin with <\(startingSubstring)>") { actualExpression in 35 | guard let actual = try actualExpression.evaluate() else { return .fail } 36 | 37 | return PredicateStatus(bool: actual.hasPrefix(startingSubstring)) 38 | } 39 | } 40 | 41 | #if canImport(Darwin) 42 | extension NMBPredicate { 43 | @objc public class func beginWithMatcher(_ expected: Any) -> NMBPredicate { 44 | return NMBPredicate { actualExpression in 45 | let actual = try actualExpression.evaluate() 46 | if actual is String { 47 | let expr = actualExpression.cast { $0 as? String } 48 | // swiftlint:disable:next force_cast 49 | return try beginWith(expected as! String).satisfies(expr).toObjectiveC() 50 | } else { 51 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection } 52 | return try beginWith(expected).satisfies(expr).toObjectiveC() 53 | } 54 | } 55 | } 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeginWithPrefix.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the exepected sequence is a prefix of the actual sequence. 2 | /// 3 | /// This is a matcher abstraction for https://developer.apple.com/documentation/swift/sequence/2854218-starts 4 | public func beginWith(prefix expectedPrefix: Seq2?) 5 | -> Predicate where Seq1.Element: Equatable, Seq1.Element == Seq2.Element { 6 | return Predicate.define("begin with <\(stringify(expectedPrefix))>") { (actualExpression, msg) in 7 | let actualPrefix = try actualExpression.evaluate() 8 | switch (expectedPrefix, actualPrefix) { 9 | case (nil, _?): 10 | return PredicateResult(status: .fail, message: msg.appendedBeNilHint()) 11 | case (nil, nil), (_, nil): 12 | return PredicateResult(status: .fail, message: msg) 13 | case (let expected?, let actual?): 14 | let matches = actual.starts(with: expected) 15 | return PredicateResult(bool: matches, message: msg) 16 | } 17 | } 18 | } 19 | 20 | /// A Nimble matcher that succeeds when the expected sequence is the prefix of the actual sequence, using the given predicate as the equivalence test. 21 | /// 22 | /// This is a matcher abstraction for https://developer.apple.com/documentation/swift/sequence/2996828-starts 23 | public func beginWith( 24 | prefix expectedPrefix: Seq2?, 25 | by areEquivalent: @escaping (Seq1.Element, Seq2.Element) -> Bool 26 | ) -> Predicate { 27 | return Predicate.define("begin with <\(stringify(expectedPrefix))>") { (actualExpression, msg) in 28 | let actualPrefix = try actualExpression.evaluate() 29 | switch (expectedPrefix, actualPrefix) { 30 | case (nil, _?): 31 | return PredicateResult(status: .fail, message: msg.appendedBeNilHint()) 32 | case (nil, nil), (_, nil): 33 | return PredicateResult(status: .fail, message: msg) 34 | case (let expected?, let actual?): 35 | let matches = actual.starts(with: expected, by: areEquivalent) 36 | return PredicateResult(bool: matches, message: msg) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/ContainElementSatisfying.swift: -------------------------------------------------------------------------------- 1 | public func containElementSatisfying( 2 | _ predicate: @escaping ((S.Element) -> Bool), _ predicateDescription: String = "" 3 | ) -> Predicate { 4 | return Predicate.define { actualExpression in 5 | let message: ExpectationMessage 6 | if predicateDescription == "" { 7 | message = .expectedTo("find object in collection that satisfies predicate") 8 | } else { 9 | message = .expectedTo("find object in collection \(predicateDescription)") 10 | } 11 | 12 | if let sequence = try actualExpression.evaluate() { 13 | for object in sequence { 14 | if predicate(object) { 15 | return PredicateResult(bool: true, message: message) 16 | } 17 | } 18 | 19 | return PredicateResult(bool: false, message: message) 20 | } 21 | 22 | return PredicateResult(status: .fail, message: message) 23 | } 24 | } 25 | 26 | #if canImport(Darwin) 27 | import class Foundation.NSObject 28 | import struct Foundation.NSFastEnumerationIterator 29 | import protocol Foundation.NSFastEnumeration 30 | 31 | extension NMBPredicate { 32 | @objc public class func containElementSatisfyingMatcher(_ predicate: @escaping ((NSObject) -> Bool)) -> NMBPredicate { 33 | return NMBPredicate { actualExpression in 34 | let value = try actualExpression.evaluate() 35 | guard let enumeration = value as? NSFastEnumeration else { 36 | let message = ExpectationMessage.fail( 37 | "containElementSatisfying must be provided an NSFastEnumeration object" 38 | ) 39 | return NMBPredicateResult(status: .fail, message: message.toObjectiveC()) 40 | } 41 | 42 | let message = ExpectationMessage 43 | .expectedTo("find object in collection that satisfies predicate") 44 | .toObjectiveC() 45 | 46 | var iterator = NSFastEnumerationIterator(enumeration) 47 | while let item = iterator.next() { 48 | guard let object = item as? NSObject else { 49 | continue 50 | } 51 | 52 | if predicate(object) { 53 | return NMBPredicateResult(status: .matches, message: message) 54 | } 55 | } 56 | 57 | return NMBPredicateResult(status: .doesNotMatch, message: message) 58 | } 59 | } 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/ElementsEqual.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual sequence and the exepected sequence contain the same elements in 2 | /// the same order. 3 | /// 4 | /// This is a matcher abstraction for https://developer.apple.com/documentation/swift/sequence/2854213-elementsequal 5 | public func elementsEqual( 6 | _ expectedValue: Seq2? 7 | ) -> Predicate where Seq1.Element: Equatable, Seq1.Element == Seq2.Element { 8 | return Predicate.define("elementsEqual <\(stringify(expectedValue))>") { (actualExpression, msg) in 9 | let actualValue = try actualExpression.evaluate() 10 | switch (expectedValue, actualValue) { 11 | case (nil, _?): 12 | return PredicateResult(status: .fail, message: msg.appendedBeNilHint()) 13 | case (nil, nil), (_, nil): 14 | return PredicateResult(status: .fail, message: msg) 15 | case (let expected?, let actual?): 16 | let matches = expected.elementsEqual(actual) 17 | return PredicateResult(bool: matches, message: msg) 18 | } 19 | } 20 | } 21 | 22 | /// A Nimble matcher that succeeds when the actual sequence and the exepected sequence contain equivalent elements in 23 | /// the same order, using the given predicate as the equivalence test. 24 | /// 25 | /// This is a matcher abstraction for https://developer.apple.com/documentation/swift/sequence/2949668-elementsequal 26 | public func elementsEqual( 27 | _ expectedValue: Seq2?, 28 | by areEquivalent: @escaping (Seq1.Element, Seq2.Element) -> Bool 29 | ) -> Predicate { 30 | return Predicate.define("elementsEqual <\(stringify(expectedValue))>") { (actualExpression, msg) in 31 | let actualValue = try actualExpression.evaluate() 32 | switch (expectedValue, actualValue) { 33 | case (nil, _?): 34 | return PredicateResult(status: .fail, message: msg.appendedBeNilHint()) 35 | case (nil, nil), (_, nil): 36 | return PredicateResult(status: .fail, message: msg) 37 | case (let expected?, let actual?): 38 | let matches = actual.elementsEqual(expected, by: areEquivalent) 39 | return PredicateResult(bool: matches, message: msg) 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/EndWith.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual sequence's last element 4 | /// is equal to the expected value. 5 | public func endWith(_ endingElement: S.Element) -> Predicate where S.Element: Equatable { 6 | return Predicate.simple("end with <\(endingElement)>") { actualExpression in 7 | guard let actualValue = try actualExpression.evaluate() else { return .fail } 8 | 9 | var actualGenerator = actualValue.makeIterator() 10 | var lastItem: S.Element? 11 | var item: S.Element? 12 | repeat { 13 | lastItem = item 14 | item = actualGenerator.next() 15 | } while(item != nil) 16 | 17 | return PredicateStatus(bool: lastItem == endingElement) 18 | } 19 | } 20 | 21 | /// A Nimble matcher that succeeds when the actual collection's last element 22 | /// is equal to the expected object. 23 | public func endWith(_ endingElement: Any) -> Predicate { 24 | return Predicate.simple("end with <\(endingElement)>") { actualExpression in 25 | guard let collection = try actualExpression.evaluate() else { return .fail } 26 | 27 | guard collection.count > 0 else { return PredicateStatus(bool: false) } 28 | #if os(Linux) 29 | guard let collectionValue = collection.object(at: collection.count - 1) as? NSObject else { 30 | return .fail 31 | } 32 | #else 33 | let collectionValue = collection.object(at: collection.count - 1) as AnyObject 34 | #endif 35 | 36 | return PredicateStatus(bool: collectionValue.isEqual(endingElement)) 37 | } 38 | } 39 | 40 | /// A Nimble matcher that succeeds when the actual string contains the expected substring 41 | /// where the expected substring's location is the actual string's length minus the 42 | /// expected substring's length. 43 | public func endWith(_ endingSubstring: String) -> Predicate { 44 | return Predicate.simple("end with <\(endingSubstring)>") { actualExpression in 45 | guard let collection = try actualExpression.evaluate() else { return .fail } 46 | 47 | return PredicateStatus(bool: collection.hasSuffix(endingSubstring)) 48 | } 49 | } 50 | 51 | #if canImport(Darwin) 52 | extension NMBPredicate { 53 | @objc public class func endWithMatcher(_ expected: Any) -> NMBPredicate { 54 | return NMBPredicate { actualExpression in 55 | let actual = try actualExpression.evaluate() 56 | if actual is String { 57 | let expr = actualExpression.cast { $0 as? String } 58 | // swiftlint:disable:next force_cast 59 | return try endWith(expected as! String).satisfies(expr).toObjectiveC() 60 | } else { 61 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection } 62 | return try endWith(expected).satisfies(expr).toObjectiveC() 63 | } 64 | } 65 | } 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/Match.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual string satisfies the regular expression 2 | /// described by the expected string. 3 | public func match(_ expectedValue: String?) -> Predicate { 4 | return Predicate.simple("match <\(stringify(expectedValue))>") { actualExpression in 5 | guard let actual = try actualExpression.evaluate(), let regexp = expectedValue else { return .fail } 6 | 7 | let bool = actual.range(of: regexp, options: .regularExpression) != nil 8 | return PredicateStatus(bool: bool) 9 | } 10 | } 11 | 12 | #if canImport(Darwin) 13 | import class Foundation.NSString 14 | 15 | extension NMBPredicate { 16 | @objc public class func matchMatcher(_ expected: NSString) -> NMBPredicate { 17 | return NMBPredicate { actualExpression in 18 | let actual = actualExpression.cast { $0 as? String } 19 | return try match(expected.description).satisfies(actual).toObjectiveC() 20 | } 21 | } 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/MatchError.swift: -------------------------------------------------------------------------------- 1 | /// A Nimble matcher that succeeds when the actual expression evaluates to an 2 | /// error from the specified case. 3 | /// 4 | /// Errors are tried to be compared by their implementation of Equatable, 5 | /// otherwise they fallback to comparison by _domain and _code. 6 | public func matchError(_ error: T) -> Predicate { 7 | return Predicate.define { actualExpression in 8 | let actualError = try actualExpression.evaluate() 9 | 10 | let message = messageForError( 11 | postfixMessageVerb: "match", 12 | actualError: actualError, 13 | error: error 14 | ) 15 | 16 | var matches = false 17 | if let actualError = actualError, errorMatchesExpectedError(actualError, expectedError: error) { 18 | matches = true 19 | } 20 | 21 | return PredicateResult(bool: matches, message: message) 22 | } 23 | } 24 | 25 | /// A Nimble matcher that succeeds when the actual expression evaluates to an 26 | /// error from the specified case. 27 | /// 28 | /// Errors are tried to be compared by their implementation of Equatable, 29 | /// otherwise they fallback to comparision by _domain and _code. 30 | public func matchError(_ error: T) -> Predicate { 31 | return Predicate.define { actualExpression in 32 | let actualError = try actualExpression.evaluate() 33 | 34 | let message = messageForError( 35 | postfixMessageVerb: "match", 36 | actualError: actualError, 37 | error: error 38 | ) 39 | 40 | var matches = false 41 | if let actualError = actualError as? T, error == actualError { 42 | matches = true 43 | } 44 | 45 | return PredicateResult(bool: matches, message: message) 46 | } 47 | } 48 | 49 | /// A Nimble matcher that succeeds when the actual expression evaluates to an 50 | /// error of the specified type 51 | public func matchError(_ errorType: T.Type) -> Predicate { 52 | return Predicate.define { actualExpression in 53 | let actualError = try actualExpression.evaluate() 54 | 55 | let message = messageForError( 56 | postfixMessageVerb: "match", 57 | actualError: actualError, 58 | errorType: errorType 59 | ) 60 | 61 | var matches = false 62 | if actualError as? T != nil { 63 | matches = true 64 | } 65 | 66 | return PredicateResult(bool: matches, message: message) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/ThrowAssertion.swift: -------------------------------------------------------------------------------- 1 | #if canImport(CwlPreconditionTesting) && (os(macOS) || os(iOS)) 2 | import CwlPreconditionTesting 3 | #elseif canImport(CwlPosixPreconditionTesting) 4 | import CwlPosixPreconditionTesting 5 | #endif 6 | 7 | public func throwAssertion() -> Predicate { 8 | return Predicate { actualExpression in 9 | #if arch(x86_64) && canImport(Darwin) 10 | let message = ExpectationMessage.expectedTo("throw an assertion") 11 | 12 | var actualError: Error? 13 | let caughtException: BadInstructionException? = catchBadInstruction { 14 | #if os(tvOS) 15 | if !NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning { 16 | print() 17 | print("[Nimble Warning]: If you're getting stuck on a debugger breakpoint for a " + 18 | "fatal error while using throwAssertion(), please disable 'Debug Executable' " + 19 | "in your scheme. Go to 'Edit Scheme > Test > Info' and uncheck " + 20 | "'Debug Executable'. If you've already done that, suppress this warning " + 21 | "by setting `NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true`. " + 22 | "This is required because the standard methods of catching assertions " + 23 | "(mach APIs) are unavailable for tvOS. Instead, the same mechanism the " + 24 | "debugger uses is the fallback method for tvOS." 25 | ) 26 | print() 27 | NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true 28 | } 29 | #endif 30 | do { 31 | _ = try actualExpression.evaluate() 32 | } catch { 33 | actualError = error 34 | } 35 | } 36 | 37 | if let actualError = actualError { 38 | return PredicateResult( 39 | bool: false, 40 | message: message.appended(message: "; threw error instead <\(actualError)>") 41 | ) 42 | } else { 43 | return PredicateResult(bool: caughtException != nil, message: message) 44 | } 45 | #else 46 | fatalError("The throwAssertion Nimble matcher can only run on x86_64 platforms with " + 47 | "Objective-C (e.g. macOS, iPhone 5s or later simulators). You can silence this error " + 48 | "by placing the test case inside an #if arch(x86_64) or canImport(Darwin) conditional statement") 49 | #endif 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/ToSucceed.swift: -------------------------------------------------------------------------------- 1 | /** 2 | Used by the `toSucceed` matcher. 3 | 4 | This is the return type for the closure. 5 | */ 6 | public enum ToSucceedResult { 7 | case succeeded 8 | case failed(reason: String) 9 | } 10 | 11 | /** 12 | A Nimble matcher that takes in a closure for validation. 13 | 14 | Return `.succeeded` when the validation succeeds. 15 | Return `.failed` with a failure reason when the validation fails. 16 | */ 17 | public func succeed() -> Predicate<() -> ToSucceedResult> { 18 | return Predicate.define { actualExpression in 19 | let optActual = try actualExpression.evaluate() 20 | guard let actual = optActual else { 21 | return PredicateResult(status: .fail, message: .fail("expected a closure, got ")) 22 | } 23 | 24 | switch actual() { 25 | case .succeeded: 26 | return PredicateResult( 27 | bool: true, 28 | message: .expectedCustomValueTo("succeed", actual: "") 29 | ) 30 | case .failed(let reason): 31 | return PredicateResult( 32 | bool: false, 33 | message: .expectedCustomValueTo("succeed", actual: " because <\(reason)>") 34 | ) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Nimble.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | 6 | #if TARGET_OS_OSX || TARGET_OS_IOS 7 | #import 8 | #import 9 | #endif 10 | 11 | FOUNDATION_EXPORT double NimbleVersionNumber; 12 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[]; 13 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Utils/DispatchTimeInterval.swift: -------------------------------------------------------------------------------- 1 | import Dispatch 2 | 3 | #if canImport(CDispatch) 4 | import CDispatch 5 | #endif 6 | 7 | extension DispatchTimeInterval { 8 | // ** Note: We cannot simply divide the time interval because DispatchTimeInterval associated value type is Int 9 | var divided: DispatchTimeInterval { 10 | switch self { 11 | case let .seconds(val): return val < 2 ? .milliseconds(Int(Float(val)/2*1000)) : .seconds(val/2) 12 | case let .milliseconds(val): return .milliseconds(val/2) 13 | case let .microseconds(val): return .microseconds(val/2) 14 | case let .nanoseconds(val): return .nanoseconds(val/2) 15 | case .never: return .never 16 | @unknown default: fatalError("Unknown DispatchTimeInterval value") 17 | } 18 | } 19 | 20 | var description: String { 21 | switch self { 22 | case let .seconds(val): return val == 1 ? "\(Float(val)) second" : "\(Float(val)) seconds" 23 | case let .milliseconds(val): return "\(Float(val)/1_000) seconds" 24 | case let .microseconds(val): return "\(Float(val)/1_000_000) seconds" 25 | case let .nanoseconds(val): return "\(Float(val)/1_000_000_000) seconds" 26 | default: fatalError("Unknown DispatchTimeInterval value") 27 | } 28 | } 29 | } 30 | 31 | #if canImport(Foundation) 32 | import typealias Foundation.TimeInterval 33 | 34 | extension TimeInterval { 35 | var dispatchInterval: DispatchTimeInterval { 36 | let microseconds = Int64(self * TimeInterval(USEC_PER_SEC)) 37 | // perhaps use nanoseconds, though would more often be > Int.max 38 | return microseconds < Int.max ? .microseconds(Int(microseconds)) : .seconds(Int(self)) 39 | } 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Utils/Errors.swift: -------------------------------------------------------------------------------- 1 | // Generic 2 | 3 | internal func messageForError( 4 | postfixMessageVerb: String = "throw", 5 | actualError: Error?, 6 | error: T? = nil, 7 | errorType: T.Type? = nil, 8 | closure: ((T) -> Void)? = nil 9 | ) -> ExpectationMessage { 10 | var rawMessage = "\(postfixMessageVerb) error" 11 | 12 | if let error = error { 13 | rawMessage += " <\(error)>" 14 | } else if errorType != nil || closure != nil { 15 | rawMessage += " from type <\(T.self)>" 16 | } 17 | if closure != nil { 18 | rawMessage += " that satisfies block" 19 | } 20 | if error == nil && errorType == nil && closure == nil { 21 | rawMessage = "\(postfixMessageVerb) any error" 22 | } 23 | 24 | let actual: String 25 | if let actualError = actualError { 26 | actual = "<\(actualError)>" 27 | } else { 28 | actual = "no error" 29 | } 30 | 31 | return .expectedCustomValueTo(rawMessage, actual: actual) 32 | } 33 | 34 | internal func errorMatchesExpectedError( 35 | _ actualError: Error, 36 | expectedError: T) -> Bool { 37 | return actualError._domain == expectedError._domain 38 | && actualError._code == expectedError._code 39 | } 40 | 41 | // Non-generic 42 | 43 | internal func messageForError( 44 | actualError: Error?, 45 | closure: ((Error) -> Void)? 46 | ) -> ExpectationMessage { 47 | var rawMessage = "throw error" 48 | 49 | if closure != nil { 50 | rawMessage += " that satisfies block" 51 | } else { 52 | rawMessage = "throw any error" 53 | } 54 | 55 | let actual: String 56 | if let actualError = actualError { 57 | actual = "<\(actualError)>" 58 | } else { 59 | actual = "no error" 60 | } 61 | 62 | return .expectedCustomValueTo(rawMessage, actual: actual) 63 | } 64 | -------------------------------------------------------------------------------- /Example/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 SWIFT_PACKAGE 9 | public typealias FileString = StaticString 10 | #else 11 | public typealias FileString = String 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 | -------------------------------------------------------------------------------- /Example/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)(void))finally; 7 | - (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock NS_SWIFT_NAME(tryBlock(_:)); 8 | 9 | @end 10 | 11 | typedef void(^NMBSourceCallbackBlock)(BOOL successful); 12 | -------------------------------------------------------------------------------- /Example/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)(void); 6 | @end 7 | 8 | @implementation NMBExceptionCapture 9 | 10 | - (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)(void))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:(__attribute__((noescape)) void(^ _Nonnull)(void))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 | -------------------------------------------------------------------------------- /Example/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 anyObject 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 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.m: -------------------------------------------------------------------------------- 1 | #import "NMBStringify.h" 2 | 3 | #if __has_include("Nimble-Swift.h") 4 | #import "Nimble-Swift.h" 5 | #else 6 | #import 7 | #endif 8 | 9 | NSString *_Nonnull NMBStringify(id _Nullable anyObject) { 10 | return [NMBStringer stringify:anyObject]; 11 | } 12 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/NimbleObjectiveC/XCTestObservationCenter+Register.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #if __has_include("Nimble-Swift.h") 4 | #import "Nimble-Swift.h" 5 | #else 6 | #import 7 | #endif 8 | 9 | #pragma mark - Private 10 | 11 | @implementation XCTestObservationCenter (Register) 12 | 13 | + (void)load { 14 | [[XCTestObservationCenter sharedTestObservationCenter] addTestObserver:[CurrentTestCaseTracker sharedInstance]]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Pods/OHHTTPStubs/LICENSE: -------------------------------------------------------------------------------- 1 | - MIT LICENSE - 2 | 3 | Copyright (c) 2012 Olivier Halligon 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. -------------------------------------------------------------------------------- /Example/Pods/OHHTTPStubs/OHHTTPStubs/Sources/Compatibility.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 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 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | /* 27 | * This file allows to keep compatibility with older SDKs which didn't have 28 | * the latest features and associated macros yet. 29 | */ 30 | 31 | 32 | #ifndef NS_DESIGNATED_INITIALIZER 33 | #if __has_attribute(objc_designated_initializer) 34 | #define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 35 | #else 36 | #define NS_DESIGNATED_INITIALIZER 37 | #endif 38 | #endif 39 | 40 | // Allow to use nullability macros and keywords even if not supported yet 41 | #if ! __has_feature(nullability) 42 | #define NS_ASSUME_NONNULL_BEGIN 43 | #define NS_ASSUME_NONNULL_END 44 | #define nullable 45 | #define __nullable 46 | #define __nonnull 47 | #endif 48 | -------------------------------------------------------------------------------- /Example/Pods/OHHTTPStubs/OHHTTPStubs/Sources/JSON/OHHTTPStubsResponse+JSON.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 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 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | #import "OHHTTPStubsResponse.h" 27 | #import "Compatibility.h" 28 | 29 | NS_ASSUME_NONNULL_BEGIN 30 | 31 | /** 32 | * Adds convenience methods to manipulate JSON objects directly. 33 | * Pass in an `NSDictionary` or `NSArray` to generate a corresponding JSON output. 34 | */ 35 | @interface OHHTTPStubsResponse (JSON) 36 | 37 | /** 38 | * Builds a response given a JSON object for the response body, status code, and headers. 39 | * 40 | * @param jsonObject Object representing the response body. 41 | * Typically a `NSDictionary`; may be any object accepted by `+[NSJSONSerialization dataWithJSONObject:options:error:]` 42 | * @param statusCode The HTTP Status Code to use in the response 43 | * @param httpHeaders The HTTP Headers to return in the response 44 | * If a "Content-Type" header is not included, "Content-Type: application/json" will be added. 45 | * 46 | * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub 47 | * 48 | * @note This method typically calls `responseWithData:statusCode:headers:`, passing the serialized JSON 49 | * object as the data parameter and adding the Content-Type header if necessary. 50 | */ 51 | + (instancetype)responseWithJSONObject:(id)jsonObject 52 | statusCode:(int)statusCode 53 | headers:(nullable NSDictionary *)httpHeaders; 54 | 55 | @end 56 | 57 | NS_ASSUME_NONNULL_END 58 | -------------------------------------------------------------------------------- /Example/Pods/OHHTTPStubs/OHHTTPStubs/Sources/JSON/OHHTTPStubsResponse+JSON.m: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 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 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | #import "OHHTTPStubsResponse+JSON.h" 27 | 28 | @implementation OHHTTPStubsResponse (JSON) 29 | 30 | /*! @name Building a response from JSON objects */ 31 | 32 | + (instancetype)responseWithJSONObject:(id)jsonObject 33 | statusCode:(int)statusCode 34 | headers:(nullable NSDictionary *)httpHeaders 35 | { 36 | if (!httpHeaders[@"Content-Type"]) 37 | { 38 | NSMutableDictionary* mutableHeaders = [NSMutableDictionary dictionaryWithDictionary:httpHeaders]; 39 | mutableHeaders[@"Content-Type"] = @"application/json"; 40 | httpHeaders = [NSDictionary dictionaryWithDictionary:mutableHeaders]; // make immutable again 41 | } 42 | 43 | return [self responseWithData:[NSJSONSerialization dataWithJSONObject:jsonObject options:0 error:nil] 44 | statusCode:statusCode 45 | headers:httpHeaders]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/Pods/OHHTTPStubs/OHHTTPStubs/Sources/NSURLSession/NSURLRequest+HTTPBodyTesting.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2016 Sebastian Hagedorn, Felix Lamouroux 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 | * 23 | ***********************************************************************************/ 24 | 25 | //////////////////////////////////////////////////////////////////////////////// 26 | #pragma mark - Imports 27 | 28 | #import 29 | 30 | // This category is only useful when NSURLSession is present 31 | #if defined(__IPHONE_7_0) || defined(__MAC_10_9) 32 | 33 | //////////////////////////////////////////////////////////////////////////////// 34 | #pragma mark - NSURLRequest+HTTPBodyTesting 35 | 36 | @interface NSURLRequest (HTTPBodyTesting) 37 | /** 38 | * Unfortunately, when sending POST requests (with a body) using NSURLSession, 39 | * by the time the request arrives at OHHTTPStubs, the HTTPBody of the 40 | * NSURLRequest has been reset to nil. 41 | * 42 | * You can use this method to retrieve the HTTPBody for testing and use it to 43 | * conditionally stub your requests. 44 | */ 45 | - (NSData *)OHHTTPStubs_HTTPBody; 46 | @end 47 | 48 | #endif /* __IPHONE_7_0 || __MAC_10_9 */ 49 | -------------------------------------------------------------------------------- /Example/Pods/OHHTTPStubs/OHHTTPStubs/Sources/NSURLSession/OHHTTPStubsMethodSwizzling.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon, 2016 Sebastian Hagedorn 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 | * 23 | ***********************************************************************************/ 24 | 25 | //////////////////////////////////////////////////////////////////////////////// 26 | #pragma mark - Imports 27 | 28 | #import 29 | 30 | //////////////////////////////////////////////////////////////////////////////// 31 | #pragma mark - Method Swizzling Helpers 32 | 33 | /** 34 | * Replaces the selector's associated method implementation with the 35 | * given implementation (or adds it, if there was no existing one). 36 | * 37 | * @param selector The selector entry in the dispatch table. 38 | * @param newImpl The implementation that will be associated with 39 | * the given selector. 40 | * @param affectedClass The class whose dispatch table will be altered. 41 | * @param isClassMethod Set to YES if the selector denotes a class 42 | * method, or NO if it is an instance method. 43 | * @return The previous implementation associated with 44 | * the swizzled selector. You should store the 45 | * implementation and call it when overwriting 46 | * the selector. 47 | */ 48 | __attribute__((warn_unused_result)) IMP OHHTTPStubsReplaceMethod(SEL selector, 49 | IMP newImpl, 50 | Class affectedClass, 51 | BOOL isClassMethod); 52 | -------------------------------------------------------------------------------- /Example/Pods/OHHTTPStubs/OHHTTPStubs/Sources/NSURLSession/OHHTTPStubsMethodSwizzling.m: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon, 2016 Sebastian Hagedorn 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 | * 23 | ***********************************************************************************/ 24 | 25 | //////////////////////////////////////////////////////////////////////////////// 26 | #pragma mark - Imports 27 | 28 | #import "OHHTTPStubsMethodSwizzling.h" 29 | 30 | ////////////////////////////////////////////////////////////////////////////////////////////////// 31 | #pragma mark - Method Swizzling Helpers 32 | 33 | IMP OHHTTPStubsReplaceMethod(SEL selector, 34 | IMP newImpl, 35 | Class affectedClass, 36 | BOOL isClassMethod) 37 | { 38 | Method origMethod = isClassMethod ? class_getClassMethod(affectedClass, selector) : class_getInstanceMethod(affectedClass, selector); 39 | IMP origImpl = method_getImplementation(origMethod); 40 | 41 | if (!class_addMethod(isClassMethod ? object_getClass(affectedClass) : affectedClass, selector, newImpl, method_getTypeEncoding(origMethod))) 42 | { 43 | method_setImplementation(origMethod, newImpl); 44 | } 45 | 46 | return origImpl; 47 | } 48 | -------------------------------------------------------------------------------- /Example/Pods/OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers/OHPathHelpers.m: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 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 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | #import "OHPathHelpers.h" 27 | 28 | NSString* __nullable OHPathForFile(NSString* fileName, Class inBundleForClass) 29 | { 30 | NSBundle* bundle = [NSBundle bundleForClass:inBundleForClass]; 31 | return OHPathForFileInBundle(fileName, bundle); 32 | } 33 | 34 | NSString* __nullable OHPathForFileInBundle(NSString* fileName, NSBundle* bundle) 35 | { 36 | return [bundle pathForResource:[fileName stringByDeletingPathExtension] 37 | ofType:[fileName pathExtension]]; 38 | } 39 | 40 | NSString* __nullable OHPathForFileInDocumentsDir(NSString* fileName) 41 | { 42 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 43 | NSString *basePath = (paths.count > 0) ? paths[0] : nil; 44 | return [basePath stringByAppendingPathComponent:fileName]; 45 | } 46 | 47 | NSBundle* __nullable OHResourceBundle(NSString* bundleBasename, Class inBundleForClass) 48 | { 49 | NSBundle* classBundle = [NSBundle bundleForClass:inBundleForClass]; 50 | return [NSBundle bundleWithPath:[classBundle pathForResource:bundleBasename 51 | ofType:@"bundle"]]; 52 | } 53 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/Behavior.swift: -------------------------------------------------------------------------------- 1 | /// A `Behavior` encapsulates a set of examples that can be re-used in several locations using the `itBehavesLike` 2 | /// function with a context instance of the generic type. 3 | open class Behavior { 4 | 5 | /** 6 | Override this variable if you want to provide custom name for this example group. 7 | */ 8 | open class var name: String { return String(describing: self) } 9 | 10 | /** 11 | Override this method in your behavior to define a set of reusable examples. 12 | 13 | This behaves just like an example group defines using `describe` or `context`--it may contain any number of `beforeEach` 14 | and `afterEach` closures, as well as any number of examples (defined using `it`). 15 | 16 | - parameter aContext: A closure that, when evaluated, returns a `Context` instance that provide the information on the subject. 17 | */ 18 | open class func spec(_ aContext: @escaping () -> Context) {} 19 | } 20 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/Callsite.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | #if canImport(Darwin) 4 | // swiftlint:disable type_name 5 | @objcMembers 6 | public class _CallsiteBase: NSObject {} 7 | #else 8 | public class _CallsiteBase: NSObject {} 9 | // swiftlint:enable type_name 10 | #endif 11 | 12 | // Ideally we would always use `StaticString` as the type for tracking the file name 13 | // in which an example is defined, for consistency with `assert` etc. from the 14 | // stdlib, and because recent versions of the XCTest overlay require `StaticString` 15 | // when calling `XCTFail`. Under the Objective-C runtime (i.e. building on macOS), we 16 | // have to use `String` instead because StaticString can't be generated from Objective-C 17 | #if SWIFT_PACKAGE 18 | public typealias FileString = StaticString 19 | #else 20 | public typealias FileString = String 21 | #endif 22 | 23 | /** 24 | An object encapsulating the file and line number at which 25 | a particular example is defined. 26 | */ 27 | final public class Callsite: _CallsiteBase { 28 | /** 29 | The absolute path of the file in which an example is defined. 30 | */ 31 | public let file: FileString 32 | 33 | /** 34 | The line number on which an example is defined. 35 | */ 36 | public let line: UInt 37 | 38 | internal init(file: FileString, line: UInt) { 39 | self.file = file 40 | self.line = line 41 | } 42 | } 43 | 44 | extension Callsite { 45 | /** 46 | Returns a boolean indicating whether two Callsite objects are equal. 47 | If two callsites are in the same file and on the same line, they must be equal. 48 | */ 49 | @nonobjc public static func == (lhs: Callsite, rhs: Callsite) -> Bool { 50 | return String(describing: lhs.file) == String(describing: rhs.file) && lhs.line == rhs.line 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/ErrorUtility.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | internal func raiseError(_ message: String) -> Never { 4 | #if canImport(Darwin) 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 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/ExampleMetadata.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | #if canImport(Darwin) 4 | // swiftlint:disable type_name 5 | @objcMembers 6 | public class _ExampleMetadataBase: NSObject {} 7 | #else 8 | public class _ExampleMetadataBase: NSObject {} 9 | // swiftlint:enable type_name 10 | #endif 11 | 12 | /** 13 | A class that encapsulates information about an example, 14 | including the index at which the example was executed, as 15 | well as the example itself. 16 | */ 17 | final public class ExampleMetadata: _ExampleMetadataBase { 18 | /** 19 | The example for which this metadata was collected. 20 | */ 21 | public let example: Example 22 | 23 | /** 24 | The index at which this example was executed in the 25 | test suite. 26 | */ 27 | public let exampleIndex: Int 28 | 29 | internal init(example: Example, exampleIndex: Int) { 30 | self.example = example 31 | self.exampleIndex = exampleIndex 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/Filter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | #if canImport(Darwin) 4 | // swiftlint:disable type_name 5 | @objcMembers 6 | public class _FilterBase: NSObject {} 7 | #else 8 | public class _FilterBase: NSObject {} 9 | // swiftlint:enable type_name 10 | #endif 11 | 12 | /** 13 | A mapping of string keys to booleans that can be used to 14 | filter examples or example groups. For example, a "focused" 15 | example would have the flags [Focused: true]. 16 | */ 17 | public typealias FilterFlags = [String: Bool] 18 | 19 | /** 20 | A namespace for filter flag keys, defined primarily to make the 21 | keys available in Objective-C. 22 | */ 23 | final public class Filter: _FilterBase { 24 | /** 25 | Example and example groups with [Focused: true] are included in test runs, 26 | excluding all other examples without this flag. Use this to only run one or 27 | two tests that you're currently focusing on. 28 | */ 29 | public class var focused: String { 30 | return "focused" 31 | } 32 | 33 | /** 34 | Example and example groups with [Pending: true] are excluded from test runs. 35 | Use this to temporarily suspend examples that you know do not pass yet. 36 | */ 37 | public class var pending: String { 38 | return "pending" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Example/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 = () -> Void 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) -> Void 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 = () -> Void 31 | 32 | /** 33 | A closure executed after all examples have finished running. 34 | */ 35 | public typealias AfterSuiteClosure = BeforeSuiteClosure 36 | -------------------------------------------------------------------------------- /Example/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) 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) 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 | -------------------------------------------------------------------------------- /Example/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 | -------------------------------------------------------------------------------- /Example/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 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift: -------------------------------------------------------------------------------- 1 | #if canImport(Darwin) 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 | Return the module name of the bundle. 16 | Uses the bundle filename and transform it to match Xcode's transformation. 17 | Module name has to be a valid "C99 extended identifier". 18 | */ 19 | internal var moduleName: String { 20 | let fileName = bundleURL.fileName 21 | return fileName.c99ExtendedIdentifier 22 | } 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift: -------------------------------------------------------------------------------- 1 | #if canImport(Darwin) 2 | import Foundation 3 | 4 | /** 5 | Responsible for building a "Selected tests" suite. This corresponds to a single 6 | spec, and all its examples. 7 | */ 8 | internal class QuickSelectedTestSuiteBuilder: QuickTestSuiteBuilder { 9 | 10 | /** 11 | The test spec class to run. 12 | */ 13 | let testCaseClass: AnyClass! 14 | 15 | /** 16 | For Objective-C classes, returns the class name. For Swift classes without, 17 | an explicit Objective-C name, returns a module-namespaced class name 18 | (e.g., "FooTests.FooSpec"). 19 | */ 20 | var testSuiteClassName: String { 21 | return NSStringFromClass(testCaseClass) 22 | } 23 | 24 | /** 25 | Given a test case name: 26 | 27 | FooSpec/testFoo 28 | 29 | Optionally constructs a test suite builder for the named test case class 30 | in the running test bundle. 31 | 32 | If no test bundle can be found, or the test case class can't be found, 33 | initialization fails and returns `nil`. 34 | */ 35 | init?(forTestCaseWithName name: String) { 36 | guard let testCaseClass = testCaseClassForTestCaseWithName(name) else { 37 | self.testCaseClass = nil 38 | return nil 39 | } 40 | 41 | self.testCaseClass = testCaseClass 42 | } 43 | 44 | /** 45 | Returns a `QuickTestSuite` that runs the associated test case class. 46 | */ 47 | func buildTestSuite() -> QuickTestSuite { 48 | return QuickTestSuite(forTestCaseClass: testCaseClass) 49 | } 50 | 51 | } 52 | 53 | /** 54 | Searches `Bundle.allBundles()` for an xctest bundle, then looks up the named 55 | test case class in that bundle. 56 | 57 | Returns `nil` if a bundle or test case class cannot be found. 58 | */ 59 | private func testCaseClassForTestCaseWithName(_ name: String) -> AnyClass? { 60 | func extractClassName(_ name: String) -> String? { 61 | return name.components(separatedBy: "/").first 62 | } 63 | 64 | guard let className = extractClassName(name) else { return nil } 65 | guard let bundle = Bundle.currentTestBundle else { return nil } 66 | 67 | if let testCaseClass = bundle.classNamed(className) { return testCaseClass } 68 | 69 | let moduleName = bundle.moduleName 70 | 71 | return NSClassFromString("\(moduleName).\(className)") 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/QuickTestObservation.swift: -------------------------------------------------------------------------------- 1 | #if !SWIFT_PACKAGE 2 | 3 | import Foundation 4 | import XCTest 5 | 6 | /// A dummy protocol for calling the internal `+[QuickSpec buildExamplesIfNeeded]` method 7 | /// which is defined in Objective-C from Swift. 8 | @objc internal protocol _QuickSpecInternal { 9 | static func buildExamplesIfNeeded() 10 | } 11 | 12 | @objc internal final class QuickTestObservation: NSObject, XCTestObservation { 13 | @objc(sharedInstance) 14 | static let shared = QuickTestObservation() 15 | 16 | // Quick hooks into this event to compile example groups for each QuickSpec subclasses. 17 | // 18 | // If an exception occurs when compiling examples, report it to the user. Chances are they 19 | // included an expectation outside of a "it", "describe", or "context" block. 20 | func testBundleWillStart(_ testBundle: Bundle) { 21 | QuickSpec.enumerateSubclasses { specClass in 22 | // This relies on `_QuickSpecInternal`. 23 | (specClass as AnyClass).buildExamplesIfNeeded() 24 | } 25 | } 26 | } 27 | 28 | // swiftlint:disable:next todo 29 | // TODO: Unify this with QuickConfiguration's equivalent 30 | extension QuickSpec { 31 | internal static func enumerateSubclasses( 32 | subclasses: [QuickSpec.Type]? = nil, 33 | _ block: (QuickSpec.Type) -> Void 34 | ) { 35 | let subjects: [QuickSpec.Type] 36 | if let subclasses = subclasses { 37 | subjects = subclasses 38 | } else { 39 | let classesCount = objc_getClassList(nil, 0) 40 | 41 | guard classesCount > 0 else { 42 | return 43 | } 44 | 45 | let classes = UnsafeMutablePointer.allocate(capacity: Int(classesCount)) 46 | defer { free(classes) } 47 | 48 | objc_getClassList(AutoreleasingUnsafeMutablePointer(classes), classesCount) 49 | 50 | var specSubclasses: [QuickSpec.Type] = [] 51 | for index in 0.. 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 | @objc 40 | public static func selectedTestSuite(forTestCaseWithName name: String) -> QuickTestSuite? { 41 | guard let builder = QuickSelectedTestSuiteBuilder(forTestCaseWithName: name) else { return nil } 42 | 43 | let (inserted, _) = builtTestSuites.insert(builder.testSuiteClassName) 44 | if inserted { 45 | return builder.buildTestSuite() 46 | } else { 47 | return nil 48 | } 49 | } 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/String+C99ExtendedIdentifier.swift: -------------------------------------------------------------------------------- 1 | #if canImport(Darwin) 2 | import Foundation 3 | 4 | extension String { 5 | private static var invalidCharacters: CharacterSet = { 6 | var invalidCharacters = CharacterSet() 7 | 8 | let invalidCharacterSets: [CharacterSet] = [ 9 | .whitespacesAndNewlines, 10 | .illegalCharacters, 11 | .controlCharacters, 12 | .punctuationCharacters, 13 | .nonBaseCharacters, 14 | .symbols, 15 | ] 16 | 17 | for invalidSet in invalidCharacterSets { 18 | invalidCharacters.formUnion(invalidSet) 19 | } 20 | 21 | return invalidCharacters 22 | }() 23 | 24 | internal var c99ExtendedIdentifier: String { 25 | let validComponents = components(separatedBy: String.invalidCharacters) 26 | let result = validComponents.joined(separator: "_") 27 | 28 | return result.isEmpty ? "_" : result 29 | } 30 | } 31 | 32 | /// Extension methods or properties for NSObject subclasses are invisible from 33 | /// the Objective-C runtime on static linking unless the consumers add `-ObjC` 34 | /// linker flag, so let's make a wrapper class to mitigate that situation. 35 | /// 36 | /// See: https://github.com/Quick/Quick/issues/785 and https://github.com/Quick/Quick/pull/803 37 | @objc 38 | class QCKObjCStringUtils: NSObject { 39 | override private init() {} 40 | 41 | @objc 42 | static func c99ExtendedIdentifier(from string: String) -> String { 43 | return string.c99ExtendedIdentifier 44 | } 45 | } 46 | #endif 47 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/Quick/URL+FileName.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension URL { 4 | 5 | /** 6 | Returns the path file name without file extension. 7 | */ 8 | var fileName: String { 9 | return self.deletingPathExtension().lastPathComponent 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/QuickObjCRuntime/QuickSpecBase.m: -------------------------------------------------------------------------------- 1 | #import "QuickSpecBase.h" 2 | 3 | #pragma mark - _QuickSpecBase 4 | 5 | @implementation _QuickSpecBase 6 | 7 | - (instancetype)init { 8 | self = [super initWithInvocation: nil]; 9 | return self; 10 | } 11 | 12 | /** 13 | Invocations for each test method in the test case. QuickSpec overrides this method to define a 14 | new method for each example defined in +[QuickSpec spec]. 15 | 16 | @return An array of invocations that execute the newly defined example methods. 17 | */ 18 | + (NSArray *)testInvocations { 19 | NSArray *selectors = [self _qck_testMethodSelectors]; 20 | NSMutableArray *invocations = [NSMutableArray arrayWithCapacity:selectors.count]; 21 | 22 | for (NSString *selectorString in selectors) { 23 | SEL selector = NSSelectorFromString(selectorString); 24 | NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector]; 25 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; 26 | invocation.selector = selector; 27 | 28 | [invocations addObject:invocation]; 29 | } 30 | 31 | return invocations; 32 | } 33 | 34 | + (NSArray *)_qck_testMethodSelectors { 35 | return @[]; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/QuickObjCRuntime/include/QuickSpecBase.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface _QuickSpecBase : XCTestCase 5 | + (NSArray *)_qck_testMethodSelectors; 6 | - (instancetype)init NS_DESIGNATED_INITIALIZER; 7 | @end 8 | -------------------------------------------------------------------------------- /Example/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 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.m: -------------------------------------------------------------------------------- 1 | #import "QuickConfiguration.h" 2 | #import 3 | 4 | #if __has_include("Quick-Swift.h") 5 | #import "Quick-Swift.h" 6 | #else 7 | #import 8 | #endif 9 | 10 | @implementation QuickConfiguration 11 | 12 | #pragma mark - Object Lifecycle 13 | 14 | /** 15 | QuickConfiguration is not meant to be instantiated; it merely provides a hook 16 | for users to configure how Quick behaves. Raise an exception if an instance of 17 | QuickConfiguration is created. 18 | */ 19 | - (instancetype)init { 20 | NSString *className = NSStringFromClass([self class]); 21 | NSString *selectorName = NSStringFromSelector(@selector(configure:)); 22 | [NSException raise:NSInternalInconsistencyException 23 | format:@"%@ is not meant to be instantiated; " 24 | @"subclass %@ and override %@ to configure Quick.", 25 | className, className, selectorName]; 26 | return nil; 27 | } 28 | 29 | #pragma mark - NSObject Overrides 30 | 31 | /** 32 | Hook into when QuickConfiguration is initialized in the runtime in order to 33 | call +[QuickConfiguration configure:] on each of its subclasses. 34 | */ 35 | + (void)initialize { 36 | // Only enumerate over the subclasses of QuickConfiguration, not any of its subclasses. 37 | if ([self class] == [QuickConfiguration class]) { 38 | World *world = [World sharedWorld]; 39 | [self configureSubclassesIfNeededWithWorld:world]; 40 | } 41 | } 42 | 43 | #pragma mark - Public Interface 44 | 45 | + (void)configure:(Configuration *)configuration { } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example/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 | -------------------------------------------------------------------------------- /Example/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 | /** 51 | Returns the currently executing spec. Use in specs that require XCTestCase 52 | methods, e.g. expectationWithDescription. 53 | */ 54 | @property (class, nonatomic, readonly) QuickSpec *current; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #if __has_include("Quick-Swift.h") 5 | #import "Quick-Swift.h" 6 | #else 7 | #import 8 | #endif 9 | 10 | @interface XCTestSuite (QuickTestSuiteBuilder) 11 | @end 12 | 13 | @implementation XCTestSuite (QuickTestSuiteBuilder) 14 | 15 | /** 16 | In order to ensure we can correctly build dynamic test suites, we need to 17 | replace some of the default test suite constructors. 18 | */ 19 | + (void)load { 20 | Method testCaseWithName = class_getClassMethod(self, @selector(testSuiteForTestCaseWithName:)); 21 | Method hooked_testCaseWithName = class_getClassMethod(self, @selector(qck_hooked_testSuiteForTestCaseWithName:)); 22 | method_exchangeImplementations(testCaseWithName, hooked_testCaseWithName); 23 | } 24 | 25 | /** 26 | The `+testSuiteForTestCaseWithName:` method is called when a specific test case 27 | class is run from the Xcode test navigator. If the built test suite is `nil`, 28 | Xcode will not run any tests for that test case. 29 | 30 | Given if the following test case class is run from the Xcode test navigator: 31 | 32 | FooSpec 33 | testFoo 34 | testBar 35 | 36 | XCTest will invoke this once per test case, with test case names following this format: 37 | 38 | FooSpec/testFoo 39 | FooSpec/testBar 40 | */ 41 | + (nullable instancetype)qck_hooked_testSuiteForTestCaseWithName:(nonnull NSString *)name { 42 | return [QuickTestSuite selectedTestSuiteForTestCaseWithName:name]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MapCache/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.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MapCache/MapCache-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.9.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MapCache/MapCache-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MapCache : NSObject 3 | @end 4 | @implementation PodsDummy_MapCache 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MapCache/MapCache-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MapCache/MapCache-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double MapCacheVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char MapCacheVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MapCache/MapCache.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MapCache 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "MapKit" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MapCache/MapCache.modulemap: -------------------------------------------------------------------------------- 1 | framework module MapCache { 2 | umbrella header "MapCache-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MapCache/MapCache.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MapCache 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "MapKit" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MapCache/MapCache.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MapCache 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "MapKit" 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/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 | 8.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 9.2.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Nimble : NSObject 3 | @end 4 | @implementation PodsDummy_Nimble 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "Nimble.h" 14 | #import "DSL.h" 15 | #import "NMBExceptionCapture.h" 16 | #import "NMBStringify.h" 17 | #import "CwlCatchException.h" 18 | #import "CwlMachBadInstructionHandler.h" 19 | #import "mach_excServer.h" 20 | 21 | FOUNDATION_EXPORT double NimbleVersionNumber; 22 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[]; 23 | 24 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble.debug.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Nimble 4 | DEFINES_MODULE = YES 5 | ENABLE_BITCODE = NO 6 | ENABLE_TESTING_SEARCH_PATHS = YES 7 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 8 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 9 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib" "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 10 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -weak-lXCTestSwiftSupport -weak_framework "XCTest" 11 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS $(inherited) -suppress-warnings 12 | PODS_BUILD_DIR = ${BUILD_DIR} 13 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 14 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 15 | PODS_ROOT = ${SRCROOT} 16 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Nimble 17 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 18 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 19 | SKIP_INSTALL = YES 20 | SWIFT_INCLUDE_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib" 21 | SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 22 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 23 | -------------------------------------------------------------------------------- /Example/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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble.release.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Nimble 4 | DEFINES_MODULE = YES 5 | ENABLE_BITCODE = NO 6 | ENABLE_TESTING_SEARCH_PATHS = YES 7 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 8 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 9 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib" "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 10 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -weak-lXCTestSwiftSupport -weak_framework "XCTest" 11 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS $(inherited) -suppress-warnings 12 | PODS_BUILD_DIR = ${BUILD_DIR} 13 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 14 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 15 | PODS_ROOT = ${SRCROOT} 16 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Nimble 17 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 18 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 19 | SKIP_INSTALL = YES 20 | SWIFT_INCLUDE_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib" 21 | SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 22 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 23 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Nimble 3 | DEFINES_MODULE = YES 4 | ENABLE_BITCODE = NO 5 | ENABLE_TESTING_SEARCH_PATHS = YES 6 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 7 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 8 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -weak-lswiftXCTest -weak_framework "XCTest" 9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS $(inherited) -suppress-warnings 10 | PODS_BUILD_DIR = ${BUILD_DIR} 11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_ROOT = ${SRCROOT} 13 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Nimble 14 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 15 | SKIP_INSTALL = YES 16 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 8.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_OHHTTPStubs : NSObject 3 | @end 4 | @implementation PodsDummy_OHHTTPStubs 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "Compatibility.h" 14 | #import "OHHTTPStubs.h" 15 | #import "OHHTTPStubsResponse.h" 16 | #import "OHHTTPStubsResponse+JSON.h" 17 | #import "NSURLRequest+HTTPBodyTesting.h" 18 | #import "OHPathHelpers.h" 19 | #import "Compatibility.h" 20 | 21 | FOUNDATION_EXPORT double OHHTTPStubsVersionNumber; 22 | FOUNDATION_EXPORT const unsigned char OHHTTPStubsVersionString[]; 23 | 24 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/OHHTTPStubs 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.modulemap: -------------------------------------------------------------------------------- 1 | framework module OHHTTPStubs { 2 | umbrella header "OHHTTPStubs-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/OHHTTPStubs 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/OHHTTPStubs 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Example/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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MapCache 5 | 6 | Copyright (c) 2019-2020 Juan M. Merlos @merlos 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2019-2020 Juan M. Merlos @merlos 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | MapCache 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MapCache_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MapCache_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_MapCache_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_MapCache_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MapCache" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MapCache/MapCache.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "MapCache" -framework "MapKit" 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_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_MapCache_Example { 2 | umbrella header "Pods-MapCache_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MapCache" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MapCache/MapCache.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "MapCache" -framework "MapKit" 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_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Tests/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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MapCache_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MapCache_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_MapCache_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_MapCache_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/MapCache" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble" "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs" "${PODS_CONFIGURATION_BUILD_DIR}/Quick" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MapCache/MapCache.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble/Nimble.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs/OHHTTPStubs.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Quick/Quick.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift "$(PLATFORM_DIR)/Developer/Library/Frameworks" '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" -framework "MapCache" -framework "MapKit" -framework "Nimble" -framework "OHHTTPStubs" -framework "Quick" -framework "XCTest" -weak_framework "XCTest" 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_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_MapCache_Tests { 2 | umbrella header "Pods-MapCache_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/MapCache" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble" "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs" "${PODS_CONFIGURATION_BUILD_DIR}/Quick" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MapCache/MapCache.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble/Nimble.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs/OHHTTPStubs.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Quick/Quick.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift "$(PLATFORM_DIR)/Developer/Library/Frameworks" '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" -framework "MapCache" -framework "MapKit" -framework "Nimble" -framework "OHHTTPStubs" -framework "Quick" -framework "XCTest" -weak_framework "XCTest" 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_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Example/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 | 2.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Quick/Quick-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Quick/Quick-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Quick : NSObject 3 | @end 4 | @implementation PodsDummy_Quick 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Quick/Quick-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Quick/Quick-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "QuickConfiguration.h" 14 | #import "QCKDSL.h" 15 | #import "Quick.h" 16 | #import "QuickSpec.h" 17 | 18 | FOUNDATION_EXPORT double QuickVersionNumber; 19 | FOUNDATION_EXPORT const unsigned char QuickVersionString[]; 20 | 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Quick/Quick.debug.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Quick 4 | DEFINES_MODULE = YES 5 | ENABLE_BITCODE = NO 6 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 7 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 8 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib" "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 9 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -framework "XCTest" 10 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 11 | PODS_BUILD_DIR = ${BUILD_DIR} 12 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 13 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 14 | PODS_ROOT = ${SRCROOT} 15 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Quick 16 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 17 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 18 | SKIP_INSTALL = YES 19 | SWIFT_INCLUDE_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib" 20 | SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 21 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 22 | -------------------------------------------------------------------------------- /Example/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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Quick/Quick.release.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Quick 4 | DEFINES_MODULE = YES 5 | ENABLE_BITCODE = NO 6 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 7 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 8 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib" "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 9 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -framework "XCTest" 10 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 11 | PODS_BUILD_DIR = ${BUILD_DIR} 12 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 13 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 14 | PODS_ROOT = ${SRCROOT} 15 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Quick 16 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 17 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 18 | SKIP_INSTALL = YES 19 | SWIFT_INCLUDE_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib" 20 | SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 21 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 22 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Quick/Quick.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Quick 3 | DEFINES_MODULE = YES 4 | ENABLE_BITCODE = NO 5 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 6 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 7 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -framework "XCTest" 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} 12 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Quick 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | -------------------------------------------------------------------------------- /Example/Tests/DiskCache/String+DiskCacheSpecs.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+MapCacheSpecs.swift 3 | // MapCache_Tests 4 | // 5 | // Created by merlos on 02/06/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Quick 10 | import Nimble 11 | @testable import MapCache 12 | 13 | 14 | class String_DiskCacheSpecs: QuickSpec { 15 | override func spec() { 16 | describe("String") { 17 | it("can calculate MD5") { 18 | let hello = "Hello" 19 | expect(hello.toMD5()) == "8b1a9953c4611296a827abf8c47804d7" 20 | } 21 | it("can escape file name") { 22 | let url = "http://xuz.com/c?a=1&b=2&c=1%20_" 23 | print(url.escapedFilename()) 24 | } 25 | 26 | it("can calculate MD5 filename") { 27 | let filename = "hello.pdf" // => MD5(hello.pdf) = 205bae5d34f9013544c01a6cf95cd7dd 28 | expect(filename.MD5Filename()) == "205bae5d34f9013544c01a6cf95cd7dd.pdf" 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Example/Tests/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/MapCacheConfigTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MapCacheConfigTests.swift 3 | // MapCache_Tests 4 | // 5 | // Created by merlos on 10/11/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | 8 | import Quick 9 | import Nimble 10 | import MapCache 11 | 12 | class MapCacheConfigTests: QuickSpec { 13 | override func spec() { 14 | describe("MapCacheConfig") { 15 | 16 | it("can do round robin") { 17 | var cache = MapCacheConfig() 18 | // because the +1 is done before returning value, it starts 19 | // with the second 20 | expect(cache.roundRobinSubdomain()).to(equal("b")) 21 | expect(cache.roundRobinSubdomain()).to(equal("c")) 22 | expect(cache.roundRobinSubdomain()).to(equal("a")) 23 | expect(cache.roundRobinSubdomain()).to(equal("b")) 24 | } 25 | 26 | it("can do round robin without subdomains") { 27 | var cache = MapCacheConfig() 28 | cache.subdomains = [] 29 | expect(cache.roundRobinSubdomain()).to(beNil()) 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Example/Tests/MapCacheTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MapCacheTests.swift 3 | // MapCache_Tests 4 | // 5 | // Created by merlos on 23/05/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | // https://github.com/Quick/Quick 9 | 10 | import Quick 11 | import Nimble 12 | import MapCache 13 | import MapKit 14 | import OHHTTPStubs 15 | 16 | class MapCacheTests: QuickSpec { 17 | 18 | override func spec() { 19 | beforeSuite { 20 | // This stub returns as data the URL of the request 21 | stub(condition: isHost("localhost")) { request in 22 | let stubData = request.url?.description.data(using: .utf8) 23 | return OHHTTPStubsResponse(data: stubData!, statusCode:200, headers:nil) 24 | } 25 | // This stub returns a 404 error 26 | stub(condition: isHost("brokenhost")) { request in 27 | let stubData = request.url?.description.data(using: .utf8) 28 | return OHHTTPStubsResponse(data: stubData!, statusCode:404, headers:nil) 29 | } 30 | } 31 | 32 | afterSuite { 33 | OHHTTPStubs.removeAllStubs() 34 | } 35 | 36 | describe("MapCache") { 37 | let urlTemplate = "https://localhost/{s}/{x}/{y}/{z}" 38 | var config = MapCacheConfig(withUrlTemplate: urlTemplate) 39 | config.subdomains = ["ok"] 40 | let cache = MapCache(withConfig: config) 41 | let path = MKTileOverlayPath(x: 1, y: 2, z: 3, contentScaleFactor: 1.0) 42 | 43 | it("can create the tile url") { 44 | let url = cache.url(forTilePath: path) 45 | expect(url.absoluteString) == "https://localhost/ok/1/2/3" 46 | } 47 | 48 | it("can generate the key for a path") { 49 | let key = cache.cacheKey(forPath: path) 50 | expect(key) == "\(urlTemplate)-1-2-3" 51 | } 52 | 53 | it("can fetch tile from server") { 54 | cache.fetchTileFromServer( 55 | at: path, 56 | failure: {error in expect(false) == true}, 57 | success: {data in expect(String(data: data, encoding: .utf8)) == cache.url(forTilePath: path).description} ) 58 | } 59 | 60 | it("can return error on fetch") { 61 | //Set a template url that returns error (in this case does not use https) 62 | let urlTemplate2 = "http://brokenhost/notworking" 63 | let config2 = MapCacheConfig(withUrlTemplate: urlTemplate2) 64 | let cache2 = MapCache(withConfig: config2) 65 | 66 | cache2.fetchTileFromServer( 67 | at: path, 68 | failure: {error in expect(true) == true}, 69 | success: {data in expect(true) == false} ) 70 | } 71 | 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | // https://github.com/Quick/Quick 2 | 3 | import Quick 4 | import Nimble 5 | import MapCache 6 | 7 | class TableOfContentsSpec: QuickSpec { 8 | override func spec() { 9 | describe("these will fail") { 10 | 11 | it("can do maths") { 12 | //expect(2) == 2 13 | } 14 | 15 | it("can read") { 16 | //expect("number") == "string" 17 | } 18 | 19 | it("will eventually fail") { 20 | //expect("time").toEventually( equal("done") ) 21 | } 22 | 23 | context("these will pass") { 24 | 25 | it("can do maths") { 26 | // expect(23) == 23 27 | } 28 | 29 | it("can read") { 30 | //expect("🐮") == "🐮" 31 | } 32 | 33 | it("will eventually pass") { 34 | var time = "passing" 35 | DispatchQueue.main.async { 36 | time = "done" 37 | } 38 | waitUntil { done in 39 | Thread.sleep(forTimeInterval: 0.5) 40 | expect(time) == "done" 41 | done() 42 | } 43 | } 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Example/Tests/TileRangeSpecs.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TileRangeSpecs.swift 3 | // MapCache_Tests 4 | // 5 | // Created by merlos on 14/06/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Quick 10 | import Nimble 11 | @testable import MapCache 12 | 13 | class TileRangeSpecs: QuickSpec { 14 | override func spec() { 15 | describe("TileRange") { 16 | it("inits") { 17 | let tR = TileRange(zoom: 10, minTileX: 15, maxTileX: 20, minTileY: 25, maxTileY: 30) 18 | expect(tR).notTo(beNil()) 19 | 20 | expect(tR.zoom).to(equal(10)) 21 | expect(tR.minTileX).to(equal(15)) 22 | expect(tR.maxTileX).to(equal(20)) 23 | expect(tR.minTileY).to(equal(25)) 24 | expect(tR.maxTileY).to(equal(30)) 25 | } 26 | 27 | it("can get calculated values") { 28 | let tR = TileRange(zoom: 10, minTileX: 15, maxTileX: 20, minTileY: 30, maxTileY: 41) 29 | expect(tR.diffX).to(equal(5)) 30 | expect(tR.diffY).to(equal(11)) 31 | expect(tR.columns).to(equal(6)) 32 | expect(tR.rows).to(equal(12)) 33 | expect(tR.count).to(equal(6*12)) 34 | } 35 | 36 | it("can iterate") { 37 | let tR = TileRange(zoom: 10, minTileX: 15, maxTileX: 20, minTileY: 25, maxTileY: 30) 38 | var count = 0 39 | for _ in tR { 40 | count += 1 41 | } 42 | expect(tR.count == count).to(beTrue()) 43 | } 44 | 45 | it("can iterate with one column or row") { 46 | // 1 Column 47 | let tROneCol = TileRange(zoom: 10, minTileX: 20, maxTileX: 20, minTileY: 25, maxTileY: 30) 48 | // 1 Row 49 | let tROneRow = TileRange(zoom: 10, minTileX: 10, maxTileX: 19, minTileY: 25, maxTileY: 25) 50 | 51 | var countOneCol = 0 52 | for _ in tROneCol { 53 | countOneCol += 1 54 | } 55 | expect(countOneCol).to(equal(1*6)) 56 | expect(tROneCol.columns).to(equal(1)) 57 | expect(tROneCol.count).to(equal(1*6)) 58 | expect(tROneRow.count).to(equal(1*10)) 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Example/Tests/ZoomRangeSpecs.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZoomRangeSpecs.swift 3 | // MapCache_Tests 4 | // 5 | // Created by merlos on 13/06/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Quick 10 | import Nimble 11 | @testable import MapCache 12 | 13 | class ZoomRangeSpecs: QuickSpec { 14 | override func spec() { 15 | describe("ZoomRange") { 16 | it("inits with valid zooms") { 17 | let z1 = ZoomRange(1,2) 18 | expect(z1?.min).to(equal(1)) 19 | expect(z1?.max).to(equal(2)) 20 | 21 | let z2 = ZoomRange(2,1) 22 | expect(z2?.min).to(equal(1)) 23 | expect(z2?.max).to(equal(2)) 24 | } 25 | 26 | it("does not init with invalid zooms") { 27 | let z1 = ZoomRange(20,2) 28 | expect(z1).to(beNil()) 29 | 30 | let z2 = ZoomRange(2,20) 31 | expect(z2).to(beNil()) 32 | } 33 | 34 | it("provides the difference of zooms") { 35 | let z1 = ZoomRange(10,2) 36 | expect(z1?.diffZoom).to(equal(8)) 37 | } 38 | 39 | it("counts the number of zooms") { 40 | let z1 = ZoomRange(1,1) 41 | expect(z1?.count).to(equal(1)) 42 | let z2 = ZoomRange(0,19) 43 | expect(z2?.count).to(equal(20)) 44 | } 45 | 46 | it("can be converted to array") { 47 | let z1Arr = ZoomRange(0,5)?.toArray() 48 | expect(z1Arr?.count).to(equal(6)) 49 | expect(z1Arr?[1]).to(equal(1)) 50 | //0 to 0 => [0] 51 | let z2Arr = ZoomRange(0,0)?.toArray() 52 | expect(z2Arr?.count).to(equal(1)) 53 | } 54 | 55 | it("can iterate") { 56 | let z1Arr = ZoomRange(0,5) 57 | var count = 0 58 | for zoom in z1Arr! { // -> 0,1,2,3,4,5 59 | expect(zoom == count).to(beTrue()) 60 | count += 1 61 | 62 | } 63 | expect(count).to(equal(6)) 64 | expect(z1Arr?.count).to(equal(6)) 65 | expect(z1Arr?.diffZoom).to(equal(5)) 66 | } 67 | 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019-2020 Juan M. Merlos @merlos 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 | -------------------------------------------------------------------------------- /MapCache.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # MapCache 3 | # 4 | # MIT License 5 | # Copyright (c) 2019-2023 Juan M. Merlos @merlos 6 | # 7 | # Be sure to run `pod lib lint MapCache.podspec' to ensure this is a 8 | # valid spec before submitting. 9 | # 10 | # Any lines starting with a # are optional, but their use is encouraged 11 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html 12 | # 13 | 14 | Pod::Spec.new do |s| 15 | s.name = 'MapCache' 16 | s.version = '0.10.0' 17 | s.summary = 'Map caching for iOS. Support offline maps in your app.' 18 | s.description = <<-DESC 19 | Cache for iOS applications for supporting offline tile maps. Downloads and keeps tiles in disk as user browses the map. Also, it can download a complete area at all different zoom levels for a complete offline experience (beta). 20 | DESC 21 | 22 | s.homepage = 'https://github.com/merlos/MapCache' 23 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 24 | s.license = { :type => 'MIT', :file => 'LICENSE' } 25 | s.author = { 'merlos' => 'merlos@users.noreply.github.com' } 26 | s.source = { :git => 'https://github.com/merlos/MapCache.git', :tag => s.version.to_s } 27 | s.social_media_url = 'https://twitter.com/merlos' 28 | 29 | s.swift_version = '5.0' 30 | s.source_files = 'MapCache/Classes/**/*' 31 | s.ios.deployment_target = '11.0' 32 | s.osx.deployment_target = '10.13' 33 | # s.resource_bundles = { 34 | # 'MapCache' => ['MapCache/Assets/*.png'] 35 | # } 36 | s.frameworks = 'Foundation', 'MapKit' 37 | end 38 | -------------------------------------------------------------------------------- /MapCache/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/MapCache/Assets/.gitkeep -------------------------------------------------------------------------------- /MapCache/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/MapCache/Classes/.gitkeep -------------------------------------------------------------------------------- /MapCache/Classes/DiskCache/String+DiskCache.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+DiskCache.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 02/06/2019. 6 | // 7 | // Based on String+Haneke.swift 8 | // Haneke 9 | // https://github.com/Haneke/HanekeSwift/blob/master/Haneke/String%2BHaneke.swift 10 | // 11 | // 12 | 13 | import Foundation 14 | 15 | /// 16 | /// Extension that adds a few methods that are useful for the `DiskCache`. 17 | extension String { 18 | 19 | /// Returns the escaped version of a filename. 20 | func escapedFilename() -> String { 21 | return [ "\0":"%00", ":":"%3A", "/":"%2F" ] 22 | .reduce(self.components(separatedBy: "%").joined(separator: "%25")) { 23 | str, m in str.components(separatedBy: m.0).joined(separator: m.1) 24 | } 25 | } 26 | 27 | /// Returns the md5 digest of this string. 28 | func toMD5() -> String { 29 | guard let data = self.data(using: String.Encoding.utf8) else { 30 | return self 31 | } 32 | 33 | let MD5Calculator = MD5(Array(data)) 34 | let MD5Data = MD5Calculator.calculate() 35 | let MD5String = NSMutableString() 36 | for c in MD5Data { 37 | MD5String.appendFormat("%02x", c) 38 | } 39 | return MD5String as String 40 | } 41 | 42 | /// Returns the path for the filename whose name is hold in this string. 43 | /// 44 | /// This method is used to get the md5 file name from a string that is key filename. 45 | func MD5Filename() -> String { 46 | let MD5String = self.toMD5() 47 | 48 | // NSString.pathExtension alone could return a query string, which can lead to very long filenames. 49 | let pathExtension = URL(string: self)?.pathExtension ?? (self as NSString).pathExtension 50 | 51 | if pathExtension.count > 0 { 52 | return (MD5String as NSString).appendingPathExtension(pathExtension) ?? MD5String 53 | } else { 54 | return MD5String 55 | } 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /MapCache/Classes/DiskCache/URL+DiskCache.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 23/11/2019. 6 | // 7 | 8 | import Foundation 9 | 10 | extension URL { 11 | 12 | /// Returns the allocated size in disk for a regular file in bytes. 13 | /// Typically are multiples of 4096 bytes 14 | func regularFileAllocatedDiskSize() throws -> UInt64 { 15 | 16 | let allocatedSizeResourceKeys: Set = [ 17 | .isRegularFileKey, 18 | .fileAllocatedSizeKey, 19 | .totalFileAllocatedSizeKey, 20 | ] 21 | 22 | let resourceValues = try self.resourceValues(forKeys: allocatedSizeResourceKeys) 23 | 24 | // We only look at regular files. 25 | guard resourceValues.isRegularFile ?? false else { 26 | return 0 27 | } 28 | 29 | // To get the file's size we first try the most comprehensive value in terms of what 30 | // the file may use on disk. This includes metadata, compression (on file system 31 | // level) and block size. 32 | // In case totalFileAllocatedSize is unavailable we use the fallback value (excluding 33 | // meta data and compression) This value should always be available. 34 | return UInt64(resourceValues.totalFileAllocatedSize ?? resourceValues.fileAllocatedSize ?? 0) 35 | } 36 | 37 | 38 | /// Returns the allocated file a regular file in bytes. 39 | func regularFileSize() throws -> UInt64 { 40 | let allocatedSizeResourceKeys: Set = [ 41 | .isRegularFileKey, 42 | .fileSizeKey, 43 | ] 44 | let resourceValues = try self.resourceValues(forKeys: allocatedSizeResourceKeys) 45 | // We only look at regular files. 46 | guard resourceValues.isRegularFile ?? false else { 47 | return 0 48 | } 49 | return UInt64(resourceValues.fileSize ?? 0) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /MapCache/Classes/LoadTileMode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoadTileMode.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 09/05/2020. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Defines the strategies that can be used for retrieving the tiles from the cache 11 | /// Used by `MapCache.loadTile()` method. 12 | /// 13 | /// - SeeAlso: `MapCache`, `MapCacheConfig` 14 | 15 | public enum LoadTileMode { 16 | 17 | /// Default. If the tile exists in the cache, return it, otherwise, fetch it from server (and cache the result). 18 | case cacheThenServer 19 | 20 | /// Always return the tile from the server unless there is some problem with the network. 21 | /// Cache is updated everytime the tile is received. 22 | /// Basically uses the cache as internet connection fallback 23 | case serverThenCache 24 | 25 | /// Only return data from cache. 26 | /// Useful for fully offline preloaded maps. 27 | case cacheOnly 28 | 29 | /// Always return the tile from the server, as well as updating the cache. 30 | /// This mode may be useful for donwloading a whole map region. 31 | /// If a tile was not downloaded fron the server error is returned. 32 | case serverOnly 33 | } 34 | -------------------------------------------------------------------------------- /MapCache/Classes/Log.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Log.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 02/06/2019. 6 | // 7 | // Based on Haneke' Log File 8 | // https://github.com/Haneke/HanekeSwift/blob/master/Haneke/Log.swift 9 | // 10 | 11 | 12 | import Foundation 13 | 14 | /// 15 | /// For logging messages on console. 16 | /// 17 | /// The log format is ` [with error ]`: 18 | /// Examples: 19 | /// ``` 20 | /// [MapCache][DEBUG] Welcome to MapCache 21 | /// [MapCache][ERROR] Could not download file with error Unknown address 22 | /// 23 | /// ``` 24 | /// 25 | /// 26 | public struct Log { 27 | 28 | /// The tag [MapCache] 29 | fileprivate static let tag = "[MapCache]" 30 | 31 | /// Log Levels 32 | fileprivate enum Level : String { 33 | /// `[Debug]` For displaying messages useful during development. 34 | case Debug = "[DEBUG]" 35 | /// `[ERROR]`For displaying messages of bad situations, very, very bad situations. 36 | case Error = "[ERROR]" 37 | } 38 | 39 | /// 40 | /// The actual method that prints. 41 | /// - Parameter level: log level to show 42 | /// - Parameter message: message to show 43 | /// - Parameter error: error to show if any on addition to the message. Uses the pattern `{message} with error {error}` 44 | fileprivate static func log(_ level: Level, _ message: @autoclosure () -> String, _ error: Error? = nil) { 45 | if let error = error { 46 | print("\(tag)\(level.rawValue) \(message()) with error \(error)") 47 | } else { 48 | print("\(tag)\(level.rawValue) \(message())") 49 | } 50 | } 51 | 52 | /// 53 | /// For displaying messages. Useful during development of this package. 54 | /// 55 | /// Example: 56 | /// ``` 57 | /// Log.debug("Hello world") // prints: [MapCache][DEBUG] Hello word 58 | /// ``` 59 | /// 60 | /// These messages are displayed only if DEBUG is defined. 61 | /// - Parameter message: message to display 62 | /// - Parameter error: error to display if any. 63 | static func debug(message: @autoclosure () -> String, error: Error? = nil) { 64 | #if DEBUG 65 | log(.Debug, message(), error) 66 | #endif 67 | } 68 | 69 | /// 70 | /// These messages are displayed independently of the debug mode. 71 | /// Used to provide useful information on exceptional situations to library users. 72 | /// Example: 73 | /// ``` 74 | /// Log.error("Could not download tile", error) // prints: [MapCache][ERROR] Could not download tile with error No internet connection. 75 | /// ``` 76 | /// 77 | /// - Parameter message: message to display 78 | /// - Parameter error: error to display 79 | 80 | static func error(message: @autoclosure () -> String, error: Error? = nil) { 81 | log(.Error, message(), error) 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /MapCache/Classes/MKMapView+MapCache.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MkMapView+MapCache.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 04/06/2019. 6 | // 7 | 8 | import Foundation 9 | import MapKit 10 | 11 | /// Extension that provides MKMapView support to use MapCache. 12 | /// 13 | /// - SeeAlso: Readme documentation 14 | extension MKMapView { 15 | 16 | /// Will tell the map to use the cache passed as parameter for getting the tiles. 17 | /// 18 | /// - Parameter cache: A cache that implements the `MapCacheProtocol`. Typically an instance of `MapCache` 19 | /// - Parameter canReplaceMapContent: Does the overlay replace the default map? It can be used to add a tile layer with centain level of transparency. 20 | /// 21 | /// - SeeAlso: `Readme` 22 | @discardableResult 23 | public func useCache(_ cache: MapCacheProtocol, canReplaceMapContent: Bool = true) -> CachedTileOverlay { 24 | 25 | let tileServerOverlay = CachedTileOverlay(withCache: cache) 26 | tileServerOverlay.canReplaceMapContent = canReplaceMapContent 27 | 28 | // Don't set `maximumZ` when wanting "over zooming". 29 | // TileOverlay will stop trying in zoom levels beyond `maximumZ`. 30 | // Our custom renderer `CachedTileOverlayZoomRenderer` will catch these "over zooms". 31 | if !cache.config.overZoomMaximumZ && cache.config.maximumZ > 0 { 32 | tileServerOverlay.maximumZ = cache.config.maximumZ 33 | } 34 | if cache.config.maximumZ > 0 { 35 | tileServerOverlay.maximumZ = cache.config.maximumZ 36 | } 37 | 38 | if cache.config.minimumZ > 0 { 39 | tileServerOverlay.minimumZ = cache.config.minimumZ 40 | } 41 | 42 | tileServerOverlay.tileSize = cache.config.tileSize 43 | if let firstOverlay = self.overlays.first { 44 | self.insertOverlay(tileServerOverlay, below: firstOverlay) 45 | } 46 | else { 47 | self.addOverlay(tileServerOverlay, level: .aboveLabels) 48 | } 49 | return tileServerOverlay 50 | } 51 | 52 | /// Call this method within the MKMapView delegate function 53 | /// `mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer` 54 | /// 55 | /// - SeeAlso: Example project and Readme documentation 56 | public func mapCacheRenderer(forOverlay overlay: MKOverlay) -> MKOverlayRenderer { 57 | if overlay.isKind(of: MKTileOverlay.self) { 58 | return CachedTileOverlayRenderer(overlay: overlay) 59 | } 60 | return MKOverlayRenderer() 61 | } 62 | 63 | /// 64 | /// TODO: Implement this correctly. 65 | /// Returns current zoom level 66 | /// 67 | public var zoomLevel: Int { 68 | let maxZoom: Double = 20 69 | let zoomScale = self.visibleMapRect.size.width / Double(self.frame.size.width) 70 | let zoomExponent = log2(zoomScale) 71 | return Int(maxZoom - ceil(zoomExponent)) 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /MapCache/Classes/MKTileOverlayPath+MapCache.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MKTileOverlay+MapCache.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 18/06/2019. 6 | // 7 | 8 | import Foundation 9 | import MapKit 10 | 11 | /// Extension to ease MapCache stuff :) 12 | /// 13 | extension MKTileOverlayPath { 14 | 15 | /// Creates a `MkTileOverlayPath` from a MapCache `TileCoords` 16 | /// - Parameter tileCoords: coordinates of the tile 17 | init(tileCoords: TileCoords) { 18 | self.init() 19 | x = Int(tileCoords.tileX) 20 | y = Int(tileCoords.tileY) 21 | z = Int(tileCoords.zoom) 22 | } 23 | 24 | /// Returns the tile overlay path as a `TileCoords` object. 25 | func toTileCoords() -> TileCoords? { 26 | return TileCoords(tileX: UInt64(x), tileY: UInt64(y), zoom: UInt8(z)) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /MapCache/Classes/MKZoomScale+MapCache.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MKZoomScale+MapCache.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 26/09/2020. 6 | // 7 | 8 | import Foundation 9 | import MapKit 10 | 11 | /// Extension for MapCache 12 | extension MKZoomScale { 13 | /// 14 | /// Converts from standard MapKit MKZoomScale to tile zoom level 15 | /// - Parameter tileSize: current map tile size in pixels. Typically set in MapCacheConfig 16 | /// - Returns: Corresponding zoom level for a tile 17 | func toZoomLevel(tileSize: CGSize) -> Int { 18 | let numTilesAt1_0 = MKMapSize.world.width / Double(tileSize.width) 19 | let zoomLevelAt1_0 = log2(numTilesAt1_0) 20 | let zoomLevel: Double = Double.maximum(0, zoomLevelAt1_0 + Double(floor(log2(self) + 0.5))) 21 | return Int(zoomLevel) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MapCache/Classes/MapCacheProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MapCacheProtocol.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 29/06/2019. 6 | // 7 | 8 | import Foundation 9 | import MapKit 10 | 11 | /// 12 | /// This protocol shall be implemented by any cache used in MapCache. 13 | /// 14 | /// - SeeAlso: [Main Readme page](/) 15 | /// 16 | public protocol MapCacheProtocol { 17 | 18 | /// An instance of `MapCacheConfig` 19 | var config: MapCacheConfig { get set } 20 | 21 | /// The implementation shall convert a tile path into a URL object 22 | /// 23 | /// Typically it will use the `config.urlTemplate` and `config.subdomains`. 24 | /// 25 | /// An example of implementation can be found in the class`MapCache` 26 | func url(forTilePath path: MKTileOverlayPath) -> URL 27 | 28 | /// 29 | /// The implementation shall return either the tile as a Data object or an Error if the tile could not be retrieved. 30 | /// 31 | /// - SeeAlso [MapKit.MkTileOverlay](https://developer.apple.com/documentation/mapkit/mktileoverlay) 32 | func loadTile(at path: MKTileOverlayPath, result: @escaping (Data?, Error?) -> Void) 33 | 34 | } 35 | -------------------------------------------------------------------------------- /MapCache/Classes/RegionDownloaderDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RegionDownloaderDelegate.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 18/06/2019. 6 | // 7 | 8 | import Foundation 9 | 10 | /// 11 | /// Delegate protocol of `RegionDownloader`. 12 | /// Implement this protocol whenever you use `RegionDownloader` it drovides feedback while donwloading a 13 | /// region (f.i, downloaded %) and callsback the delegate once the download finished. 14 | /// 15 | @objc public protocol RegionDownloaderDelegate: AnyObject { 16 | 17 | /// Did download the percentage. 18 | @objc func regionDownloader(_ regionDownloader: RegionDownloader, didDownloadPercentage percentage: Double) 19 | 20 | /// Did Finish Download all tiles. 21 | func regionDownloader(_ regionDownloader: RegionDownloader, didFinishDownload tilesDownloaded: TileNumber) 22 | } 23 | -------------------------------------------------------------------------------- /MapCache/Classes/TileRange.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TileRange.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 13/06/2019. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Errors for tile range 11 | public enum TileRangeError: Error { 12 | /// Error to be thrown in case of an issue during creation. 13 | case TileRangeCreation 14 | } 15 | 16 | /// For a particular zoom level, defines a range of tiles. 17 | /// It can be iterated in a for loop. It will get the `TileCoord`` 18 | /// 19 | /// The following conditions shall always be true 20 | /// 21 | /// minTileX <= maxTileX 22 | /// minTileY <= maxTileY 23 | /// 24 | /// - TODO: 25 | /// - There are no validations for the conditions above. 26 | /// - There are not validations for the min and max values. 27 | /// 28 | public struct TileRange: Sequence { 29 | 30 | /// Zoom level. 31 | var zoom: Zoom 32 | 33 | /// Min value of tile in X axis. 34 | var minTileX: TileNumber 35 | 36 | /// Max value of tile in X axis. 37 | var maxTileX: TileNumber 38 | 39 | /// Min value of tile in Y axis. 40 | var minTileY: TileNumber 41 | 42 | /// Min value of tile in Y axis. 43 | var maxTileY: TileNumber 44 | 45 | /// Difference between `maxTileX` and `minTileX` 46 | var diffX : TileNumber { 47 | get { 48 | return maxTileX - minTileX 49 | } 50 | } 51 | 52 | /// Difference between `maxTileY` and `minTileY` 53 | var diffY : TileNumber { 54 | get { 55 | return maxTileY - minTileY 56 | } 57 | } 58 | 59 | /// Number of rows in the range. 60 | var rows : TileNumber { 61 | get { 62 | return diffY + 1 63 | } 64 | } 65 | /// Number of columns in the range. 66 | var columns : TileNumber { 67 | get { 68 | return diffX + 1 69 | } 70 | } 71 | 72 | /// Counts the number of tiles in the range (columns x rows). 73 | var count : TileNumber { 74 | get { 75 | return rows * columns 76 | } 77 | } 78 | 79 | /// Sequence iterator. 80 | /// This allows `TileRange` to be used in for loops. 81 | /// In each iteration it returns a `TileCoord`. 82 | /// It starts from the top left corner of the range and iterates row by row. 83 | /// 84 | /// - SeeAlso: [IteratorProtocol](https://developer.apple.com/documentation/swift/iteratorprotocol) 85 | public func makeIterator() -> TileRangeIterator { 86 | return TileRangeIterator(self) 87 | } 88 | } 89 | 90 | -------------------------------------------------------------------------------- /MapCache/Classes/TileRangeIterator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TileRangeOperator.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 13/06/2019. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Iterator of a TileRange. 11 | public struct TileRangeIterator: IteratorProtocol { 12 | 13 | /// Range for the counter 14 | let range: TileRange 15 | 16 | /// Current counter value 17 | var counter: UInt64 18 | 19 | /// Max value counter can take. 20 | let maxCounter : UInt64 21 | 22 | /// Number of columns 23 | let columns : TileNumber 24 | 25 | /// Number of rows 26 | let rows : TileNumber 27 | 28 | /// Initializer of the iterator. 29 | /// Sets `range`,` counter`, `maxCounter` and `diffX` 30 | init(_ range: TileRange) { 31 | self.range = range 32 | counter = 0 33 | 34 | // we keep these in memory for efficiency 35 | // so they do not need to be calculated again 36 | maxCounter = range.count 37 | columns = range.columns 38 | rows = range.rows 39 | } 40 | 41 | /// The function that is required by the Iterator protocol. 42 | /// 43 | /// - Returns: the `TileCoord` for the current iteration. 44 | /// 45 | /// - TODO: because there are no validations of the range in TileRange, this function may fail. Pending to fix it. 46 | /// 47 | /// - SeeAlso: [IteratorProtocol](https://developer.apple.com/documentation/swift/iteratorprotocol) 48 | mutating public func next() -> TileCoords? { 49 | guard counter < maxCounter else { return nil } 50 | let currentColumn = counter % columns 51 | let currentRow = Double(counter / columns) 52 | 53 | let x = range.minTileX + currentColumn //We start in the topLeft corner 54 | let y = range.maxTileY - UInt64(currentRow.rounded(.down)) // point and end in the bottomRight corner 55 | counter += 1 56 | guard let nextTileCoords = TileCoords(tileX: x, tileY: y, zoom: range.zoom) 57 | else { 58 | return nil 59 | } 60 | return nextTileCoords 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /MapCache/Classes/ZoomRange.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZoomRange.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 13/06/2019. 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | /// A range of zooms. 12 | /// Matematically: [z1, z1+1, z1+2,..., z2-1, z2] 13 | /// 14 | /// For instance: z1 = 2, z2 = 5 then [2, 3, 4, 5] would be 15 | /// the range. 16 | /// 17 | /// Usage example: 18 | /// 19 | /// let zR = ZoomRange(2,5).toArray() 20 | /// print(zR.count) // => 4 21 | /// 22 | /// It strictly stores z1 and z2, and the rest of the range 23 | /// is built upon request. 24 | /// 25 | public struct ZoomRange : Sequence { 26 | 27 | /// Minimum zoom in this range. 28 | public let min: Zoom 29 | 30 | /// Maximum zoom in this range. 31 | public let max: Zoom 32 | 33 | /// Difference between max zoom and min zoom. 34 | var diffZoom: Zoom { 35 | get { 36 | return max - min 37 | } 38 | } 39 | 40 | /// Number of zooms in this range 41 | /// 42 | /// Example: 43 | /// 44 | /// let zR = ZoomRange(2,2) 45 | /// print(zR.count) // => 1 46 | 47 | public var count: Zoom { 48 | get { 49 | return diffZoom + 1 50 | } 51 | } 52 | 53 | /// Creates the range of zooms. 54 | public init?(_ z1: Zoom, _ z2: Zoom) { 55 | do { 56 | try TileCoords.validate(zoom: z1) 57 | try TileCoords.validate(zoom: z2) 58 | } catch { 59 | return nil 60 | } 61 | self.min = z1 > z2 ? z2 : z1 62 | self.max = z1 >= z2 ? z1 : z2 63 | } 64 | 65 | /// Converts the zoom range in to an array`.` 66 | func toArray() -> [Zoom] { 67 | var ret : [Zoom] = [] 68 | for i in min...max { 69 | ret.append(i) 70 | } 71 | return ret 72 | } 73 | 74 | /// Returns the iterator for this range. 75 | /// It allows to use `ZoomRange` in for loops. 76 | /// 77 | /// - SeeAlso: [IteratorProtocol](https://developer.apple.com/documentation/swift/iteratorprotocol) 78 | public func makeIterator() -> ZoomRangeIterator{ 79 | return ZoomRangeIterator(self) 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /MapCache/Classes/ZoomRangeIterator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZoomRangeIterator.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 14/06/2019. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Iterator that allows the use of ZoomRange in a for loop. 11 | /// 12 | /// - SeeAlso: [IteratorProtocol](https://developer.apple.com/documentation/swift/iteratorprotocol) 13 | public struct ZoomRangeIterator: IteratorProtocol { 14 | 15 | /// Keeps the counter of the iterator. 16 | var counter : UInt8 = 0 17 | 18 | /// The zoom range in question. 19 | var range: ZoomRange 20 | 21 | /// Receives the range to iterate. 22 | init(_ range: ZoomRange) { 23 | self.range = range 24 | } 25 | 26 | /// Gets next zoom value. 27 | mutating public func next() -> Zoom? { 28 | guard counter < range.count else { return nil } 29 | let next = range.min + counter 30 | counter += 1 31 | return next 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /MapCache/Classes/ZoomableTile.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZoomableTile.swift 3 | // MapCache 4 | // 5 | // Created by merlos on 26/09/2020. 6 | // 7 | 8 | import Foundation 9 | import MapKit 10 | 11 | /// 12 | /// Specifies a single tile and area of the tile that should upscaled. 13 | /// 14 | public struct ZoomableTile { 15 | 16 | /// Path for the tile with `maximumZ` supported by the tile server set in the config. 17 | /// This is the path with the best resolution tile from wich this zoomable tile can be interpolated. 18 | /// - SeeAlso: `MapCacheConfig`` 19 | let maximumZPath: MKTileOverlayPath 20 | 21 | /// Rectangle area ocupied by this tile 22 | let rect: MKMapRect 23 | 24 | /// Scale over the tile of the maximumZ path. 25 | /// It is a multiple of 2 (2, 4, 8). 26 | /// For a zoom larger than maximumZ represents the number of tiles the original tile is divided in 27 | /// one axis. For example, overZoom=4 means that in each axis the tile is divided in 4 as well as 28 | /// in the Y axis. So, the original tile at maximumZ is divided in 16 subtiles. 29 | /// The `rect`tells us, among those tiles, which one is this tile. 30 | let overZoom: Int 31 | } 32 | 33 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "MapCache", 8 | platforms: [ 9 | .iOS(.v8), .macOS(.v10_10) 10 | ], 11 | products: [ 12 | // Products define the executables and libraries produced by a package, and make them visible to other packages. 13 | .library( 14 | name: "MapCache", 15 | targets: ["MapCache"]), 16 | ], 17 | dependencies: [ 18 | // Dependencies declare other packages that this package depends on. 19 | // .package(url: /* package url */, from: "1.0.0"), 20 | ], 21 | targets: [ 22 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 23 | // Targets can depend on other targets in this package, and on products in packages which this package depends on. 24 | .target( 25 | name: "MapCache", 26 | dependencies: [], 27 | path: "MapCache/Classes"), 28 | .testTarget( 29 | name: "MapCache-Tests", 30 | dependencies: ["MapCache"], 31 | path: "Example/Tests"), 32 | ], 33 | swiftLanguageVersions: [ .v5 ] 34 | ) 35 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /docs/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | documentation 17 | 18 | 19 | documentation 20 | 21 | 22 | 100% 23 | 24 | 25 | 100% 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.jazzy.mapcache 7 | CFBundleName 8 | MapCache 9 | DocSetPlatformFamily 10 | mapcache 11 | isDashDocset 12 | 13 | dashIndexFilePath 14 | index.html 15 | isJavaScriptEnabled 16 | 17 | DashDocSetFamily 18 | dashtoc 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Resources/Documents/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | documentation 17 | 18 | 19 | documentation 20 | 21 | 22 | 100% 23 | 24 | 25 | 100% 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Resources/Documents/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/docsets/MapCache.docset/Contents/Resources/Documents/img/carat.png -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Resources/Documents/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/docsets/MapCache.docset/Contents/Resources/Documents/img/dash.png -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Resources/Documents/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/docsets/MapCache.docset/Contents/Resources/Documents/img/gh.png -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Resources/Documents/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/docsets/MapCache.docset/Contents/Resources/Documents/img/spinner.gif -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Resources/Documents/js/jazzy.js: -------------------------------------------------------------------------------- 1 | // Jazzy - https://github.com/realm/jazzy 2 | // Copyright Realm Inc. 3 | // SPDX-License-Identifier: MIT 4 | 5 | window.jazzy = {'docset': false} 6 | if (typeof window.dash != 'undefined') { 7 | document.documentElement.className += ' dash' 8 | window.jazzy.docset = true 9 | } 10 | if (navigator.userAgent.match(/xcode/i)) { 11 | document.documentElement.className += ' xcode' 12 | window.jazzy.docset = true 13 | } 14 | 15 | function toggleItem($link, $content) { 16 | var animationDuration = 300; 17 | $link.toggleClass('token-open'); 18 | $content.slideToggle(animationDuration); 19 | } 20 | 21 | function itemLinkToContent($link) { 22 | return $link.parent().parent().next(); 23 | } 24 | 25 | // On doc load + hash-change, open any targetted item 26 | function openCurrentItemIfClosed() { 27 | if (window.jazzy.docset) { 28 | return; 29 | } 30 | var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); 31 | $content = itemLinkToContent($link); 32 | if ($content.is(':hidden')) { 33 | toggleItem($link, $content); 34 | } 35 | } 36 | 37 | $(openCurrentItemIfClosed); 38 | $(window).on('hashchange', openCurrentItemIfClosed); 39 | 40 | // On item link ('token') click, toggle its discussion 41 | $('.token').on('click', function(event) { 42 | if (window.jazzy.docset) { 43 | return; 44 | } 45 | var $link = $(this); 46 | toggleItem($link, itemLinkToContent($link)); 47 | 48 | // Keeps the document from jumping to the hash. 49 | var href = $link.attr('href'); 50 | if (history.pushState) { 51 | history.pushState({}, '', href); 52 | } else { 53 | location.hash = href; 54 | } 55 | event.preventDefault(); 56 | }); 57 | 58 | // Clicks on links to the current, closed, item need to open the item 59 | $("a:not('.token')").on('click', function() { 60 | if (location == this.href) { 61 | openCurrentItemIfClosed(); 62 | } 63 | }); 64 | 65 | // KaTeX rendering 66 | if ("katex" in window) { 67 | $($('.math').each( (_, element) => { 68 | katex.render(element.textContent, element, { 69 | displayMode: $(element).hasClass('m-block'), 70 | throwOnError: false, 71 | trust: true 72 | }); 73 | })) 74 | } 75 | -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Resources/Documents/js/jazzy.search.js: -------------------------------------------------------------------------------- 1 | // Jazzy - https://github.com/realm/jazzy 2 | // Copyright Realm Inc. 3 | // SPDX-License-Identifier: MIT 4 | 5 | $(function(){ 6 | var $typeahead = $('[data-typeahead]'); 7 | var $form = $typeahead.parents('form'); 8 | var searchURL = $form.attr('action'); 9 | 10 | function displayTemplate(result) { 11 | return result.name; 12 | } 13 | 14 | function suggestionTemplate(result) { 15 | var t = '
'; 16 | t += '' + result.name + ''; 17 | if (result.parent_name) { 18 | t += '' + result.parent_name + ''; 19 | } 20 | t += '
'; 21 | return t; 22 | } 23 | 24 | $typeahead.one('focus', function() { 25 | $form.addClass('loading'); 26 | 27 | $.getJSON(searchURL).then(function(searchData) { 28 | const searchIndex = lunr(function() { 29 | this.ref('url'); 30 | this.field('name'); 31 | this.field('abstract'); 32 | for (const [url, doc] of Object.entries(searchData)) { 33 | this.add({url: url, name: doc.name, abstract: doc.abstract}); 34 | } 35 | }); 36 | 37 | $typeahead.typeahead( 38 | { 39 | highlight: true, 40 | minLength: 3, 41 | autoselect: true 42 | }, 43 | { 44 | limit: 10, 45 | display: displayTemplate, 46 | templates: { suggestion: suggestionTemplate }, 47 | source: function(query, sync) { 48 | const lcSearch = query.toLowerCase(); 49 | const results = searchIndex.query(function(q) { 50 | q.term(lcSearch, { boost: 100 }); 51 | q.term(lcSearch, { 52 | boost: 10, 53 | wildcard: lunr.Query.wildcard.TRAILING 54 | }); 55 | }).map(function(result) { 56 | var doc = searchData[result.ref]; 57 | doc.url = result.ref; 58 | return doc; 59 | }); 60 | sync(results); 61 | } 62 | } 63 | ); 64 | $form.removeClass('loading'); 65 | $typeahead.trigger('focus'); 66 | }); 67 | }); 68 | 69 | var baseURL = searchURL.slice(0, -"search.json".length); 70 | 71 | $typeahead.on('typeahead:select', function(e, result) { 72 | window.location = baseURL + result.url; 73 | }); 74 | }); 75 | -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Resources/Documents/undocumented.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | 4 | ], 5 | "source_directory": "/Users/merlos/Projects/MapCacher/sources/MapCache" 6 | } -------------------------------------------------------------------------------- /docs/docsets/MapCache.docset/Contents/Resources/docSet.dsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/docsets/MapCache.docset/Contents/Resources/docSet.dsidx -------------------------------------------------------------------------------- /docs/docsets/MapCache.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/docsets/MapCache.tgz -------------------------------------------------------------------------------- /docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/img/carat.png -------------------------------------------------------------------------------- /docs/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/img/dash.png -------------------------------------------------------------------------------- /docs/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/img/gh.png -------------------------------------------------------------------------------- /docs/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/docs/img/spinner.gif -------------------------------------------------------------------------------- /docs/js/jazzy.js: -------------------------------------------------------------------------------- 1 | // Jazzy - https://github.com/realm/jazzy 2 | // Copyright Realm Inc. 3 | // SPDX-License-Identifier: MIT 4 | 5 | window.jazzy = {'docset': false} 6 | if (typeof window.dash != 'undefined') { 7 | document.documentElement.className += ' dash' 8 | window.jazzy.docset = true 9 | } 10 | if (navigator.userAgent.match(/xcode/i)) { 11 | document.documentElement.className += ' xcode' 12 | window.jazzy.docset = true 13 | } 14 | 15 | function toggleItem($link, $content) { 16 | var animationDuration = 300; 17 | $link.toggleClass('token-open'); 18 | $content.slideToggle(animationDuration); 19 | } 20 | 21 | function itemLinkToContent($link) { 22 | return $link.parent().parent().next(); 23 | } 24 | 25 | // On doc load + hash-change, open any targetted item 26 | function openCurrentItemIfClosed() { 27 | if (window.jazzy.docset) { 28 | return; 29 | } 30 | var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); 31 | $content = itemLinkToContent($link); 32 | if ($content.is(':hidden')) { 33 | toggleItem($link, $content); 34 | } 35 | } 36 | 37 | $(openCurrentItemIfClosed); 38 | $(window).on('hashchange', openCurrentItemIfClosed); 39 | 40 | // On item link ('token') click, toggle its discussion 41 | $('.token').on('click', function(event) { 42 | if (window.jazzy.docset) { 43 | return; 44 | } 45 | var $link = $(this); 46 | toggleItem($link, itemLinkToContent($link)); 47 | 48 | // Keeps the document from jumping to the hash. 49 | var href = $link.attr('href'); 50 | if (history.pushState) { 51 | history.pushState({}, '', href); 52 | } else { 53 | location.hash = href; 54 | } 55 | event.preventDefault(); 56 | }); 57 | 58 | // Clicks on links to the current, closed, item need to open the item 59 | $("a:not('.token')").on('click', function() { 60 | if (location == this.href) { 61 | openCurrentItemIfClosed(); 62 | } 63 | }); 64 | 65 | // KaTeX rendering 66 | if ("katex" in window) { 67 | $($('.math').each( (_, element) => { 68 | katex.render(element.textContent, element, { 69 | displayMode: $(element).hasClass('m-block'), 70 | throwOnError: false, 71 | trust: true 72 | }); 73 | })) 74 | } 75 | -------------------------------------------------------------------------------- /docs/js/jazzy.search.js: -------------------------------------------------------------------------------- 1 | // Jazzy - https://github.com/realm/jazzy 2 | // Copyright Realm Inc. 3 | // SPDX-License-Identifier: MIT 4 | 5 | $(function(){ 6 | var $typeahead = $('[data-typeahead]'); 7 | var $form = $typeahead.parents('form'); 8 | var searchURL = $form.attr('action'); 9 | 10 | function displayTemplate(result) { 11 | return result.name; 12 | } 13 | 14 | function suggestionTemplate(result) { 15 | var t = '
'; 16 | t += '' + result.name + ''; 17 | if (result.parent_name) { 18 | t += '' + result.parent_name + ''; 19 | } 20 | t += '
'; 21 | return t; 22 | } 23 | 24 | $typeahead.one('focus', function() { 25 | $form.addClass('loading'); 26 | 27 | $.getJSON(searchURL).then(function(searchData) { 28 | const searchIndex = lunr(function() { 29 | this.ref('url'); 30 | this.field('name'); 31 | this.field('abstract'); 32 | for (const [url, doc] of Object.entries(searchData)) { 33 | this.add({url: url, name: doc.name, abstract: doc.abstract}); 34 | } 35 | }); 36 | 37 | $typeahead.typeahead( 38 | { 39 | highlight: true, 40 | minLength: 3, 41 | autoselect: true 42 | }, 43 | { 44 | limit: 10, 45 | display: displayTemplate, 46 | templates: { suggestion: suggestionTemplate }, 47 | source: function(query, sync) { 48 | const lcSearch = query.toLowerCase(); 49 | const results = searchIndex.query(function(q) { 50 | q.term(lcSearch, { boost: 100 }); 51 | q.term(lcSearch, { 52 | boost: 10, 53 | wildcard: lunr.Query.wildcard.TRAILING 54 | }); 55 | }).map(function(result) { 56 | var doc = searchData[result.ref]; 57 | doc.url = result.ref; 58 | return doc; 59 | }); 60 | sync(results); 61 | } 62 | } 63 | ); 64 | $form.removeClass('loading'); 65 | $typeahead.trigger('focus'); 66 | }); 67 | }); 68 | 69 | var baseURL = searchURL.slice(0, -"search.json".length); 70 | 71 | $typeahead.on('typeahead:select', function(e, result) { 72 | window.location = baseURL + result.url; 73 | }); 74 | }); 75 | -------------------------------------------------------------------------------- /docs/undocumented.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | 4 | ], 5 | "source_directory": "/Users/merlos/projects/OpenGPXTracker/MapCache" 6 | } -------------------------------------------------------------------------------- /images/MapCache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merlos/MapCache/592813d1759929db5a6710916b2495335546bc12/images/MapCache.png --------------------------------------------------------------------------------