├── .gitignore
├── .swift-version
├── Example
├── HTTP-Status-Codes-for-Swift.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── StatusCodes-Demo.xcscheme
├── HTTP-Status-Codes-for-Swift
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ └── ViewController.swift
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Local Podspecs
│ │ ├── HTTP-Status-Codes-for-Swift.podspec.json
│ │ └── StatusCodes.podspec.json
│ ├── Manifest.lock
│ ├── Nimble
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Sources
│ │ │ ├── Lib
│ │ │ └── CwlPreconditionTesting
│ │ │ │ ├── CwlCatchException
│ │ │ │ └── CwlCatchException.swift
│ │ │ │ ├── CwlCatchExceptionSupport
│ │ │ │ ├── CwlCatchException.m
│ │ │ │ └── include
│ │ │ │ │ └── CwlCatchException.h
│ │ │ │ ├── CwlMachBadInstructionHandler
│ │ │ │ ├── CwlMachBadInstructionHandler.m
│ │ │ │ ├── include
│ │ │ │ │ └── CwlMachBadInstructionHandler.h
│ │ │ │ ├── mach_excServer.c
│ │ │ │ └── mach_excServer.h
│ │ │ │ └── CwlPreconditionTesting
│ │ │ │ ├── CwlBadInstructionException.swift
│ │ │ │ ├── CwlCatchBadInstruction.swift
│ │ │ │ ├── CwlDarwinDefinitions.swift
│ │ │ │ └── Mach
│ │ │ │ └── CwlPreconditionTesting.h
│ │ │ ├── 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
│ │ │ │ ├── AsyncMatcherWrapper.swift
│ │ │ │ ├── BeAKindOf.swift
│ │ │ │ ├── BeAnInstanceOf.swift
│ │ │ │ ├── BeCloseTo.swift
│ │ │ │ ├── BeEmpty.swift
│ │ │ │ ├── BeGreaterThan.swift
│ │ │ │ ├── BeGreaterThanOrEqualTo.swift
│ │ │ │ ├── BeIdenticalTo.swift
│ │ │ │ ├── BeLessThan.swift
│ │ │ │ ├── BeLessThanOrEqual.swift
│ │ │ │ ├── BeLogical.swift
│ │ │ │ ├── BeNil.swift
│ │ │ │ ├── BeVoid.swift
│ │ │ │ ├── BeginWith.swift
│ │ │ │ ├── Contain.swift
│ │ │ │ ├── ContainElementSatisfying.swift
│ │ │ │ ├── EndWith.swift
│ │ │ │ ├── Equal.swift
│ │ │ │ ├── HaveCount.swift
│ │ │ │ ├── Match.swift
│ │ │ │ ├── MatchError.swift
│ │ │ │ ├── MatcherFunc.swift
│ │ │ │ ├── MatcherProtocols.swift
│ │ │ │ ├── PostNotification.swift
│ │ │ │ ├── Predicate.swift
│ │ │ │ ├── RaisesException.swift
│ │ │ │ ├── SatisfyAnyOf.swift
│ │ │ │ ├── ThrowAssertion.swift
│ │ │ │ ├── ThrowError.swift
│ │ │ │ └── ToSucceed.swift
│ │ │ ├── Nimble.h
│ │ │ └── Utils
│ │ │ │ ├── Async.swift
│ │ │ │ ├── Errors.swift
│ │ │ │ ├── Functional.swift
│ │ │ │ ├── SourceLocation.swift
│ │ │ │ └── Stringers.swift
│ │ │ └── NimbleObjectiveC
│ │ │ ├── CurrentTestCaseTracker.h
│ │ │ ├── DSL.h
│ │ │ ├── DSL.m
│ │ │ ├── NMBExceptionCapture.h
│ │ │ ├── NMBExceptionCapture.m
│ │ │ ├── NMBStringify.h
│ │ │ ├── NMBStringify.m
│ │ │ └── XCTestObservationCenter+Register.m
│ ├── Pods.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── StatusCodes.xcscheme
│ ├── Quick
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Sources
│ │ │ ├── Quick
│ │ │ ├── Behavior.swift
│ │ │ ├── Callsite.swift
│ │ │ ├── Configuration
│ │ │ │ └── Configuration.swift
│ │ │ ├── DSL
│ │ │ │ ├── DSL.swift
│ │ │ │ └── World+DSL.swift
│ │ │ ├── ErrorUtility.swift
│ │ │ ├── Example.swift
│ │ │ ├── ExampleGroup.swift
│ │ │ ├── ExampleMetadata.swift
│ │ │ ├── Filter.swift
│ │ │ ├── Hooks
│ │ │ │ ├── Closures.swift
│ │ │ │ ├── ExampleHooks.swift
│ │ │ │ ├── HooksPhase.swift
│ │ │ │ └── SuiteHooks.swift
│ │ │ ├── NSBundle+CurrentTestBundle.swift
│ │ │ ├── NSString+C99ExtendedIdentifier.swift
│ │ │ ├── QuickSelectedTestSuiteBuilder.swift
│ │ │ ├── QuickTestSuite.swift
│ │ │ ├── URL+FileName.swift
│ │ │ └── World.swift
│ │ │ ├── QuickObjectiveC
│ │ │ ├── Configuration
│ │ │ │ ├── QuickConfiguration.h
│ │ │ │ └── QuickConfiguration.m
│ │ │ ├── DSL
│ │ │ │ ├── QCKDSL.h
│ │ │ │ ├── QCKDSL.m
│ │ │ │ └── World+DSL.h
│ │ │ ├── Quick.h
│ │ │ ├── QuickSpec.h
│ │ │ ├── QuickSpec.m
│ │ │ ├── World.h
│ │ │ └── XCTestSuite+QuickTestSuiteBuilder.m
│ │ │ └── QuickSpecBase
│ │ │ ├── QuickSpecBase.m
│ │ │ └── include
│ │ │ └── QuickSpecBase.h
│ ├── SnapKit
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Source
│ │ │ ├── Constraint.swift
│ │ │ ├── ConstraintAttributes.swift
│ │ │ ├── ConstraintConfig.swift
│ │ │ ├── ConstraintConstantTarget.swift
│ │ │ ├── ConstraintDSL.swift
│ │ │ ├── ConstraintDescription.swift
│ │ │ ├── ConstraintInsetTarget.swift
│ │ │ ├── ConstraintInsets.swift
│ │ │ ├── ConstraintItem.swift
│ │ │ ├── ConstraintLayoutGuide+Extensions.swift
│ │ │ ├── ConstraintLayoutGuide.swift
│ │ │ ├── ConstraintLayoutGuideDSL.swift
│ │ │ ├── ConstraintLayoutSupport.swift
│ │ │ ├── ConstraintLayoutSupportDSL.swift
│ │ │ ├── ConstraintMaker.swift
│ │ │ ├── ConstraintMakerEditable.swift
│ │ │ ├── ConstraintMakerExtendable.swift
│ │ │ ├── ConstraintMakerFinalizable.swift
│ │ │ ├── ConstraintMakerPriortizable.swift
│ │ │ ├── ConstraintMakerRelatable.swift
│ │ │ ├── ConstraintMultiplierTarget.swift
│ │ │ ├── ConstraintOffsetTarget.swift
│ │ │ ├── ConstraintPriority.swift
│ │ │ ├── ConstraintPriorityTarget.swift
│ │ │ ├── ConstraintRelatableTarget.swift
│ │ │ ├── ConstraintRelation.swift
│ │ │ ├── ConstraintView+Extensions.swift
│ │ │ ├── ConstraintView.swift
│ │ │ ├── ConstraintViewDSL.swift
│ │ │ ├── Debugging.swift
│ │ │ ├── LayoutConstraint.swift
│ │ │ ├── LayoutConstraintItem.swift
│ │ │ ├── Typealiases.swift
│ │ │ └── UILayoutSupport+Extensions.swift
│ └── Target Support Files
│ │ ├── Nimble
│ │ ├── Info.plist
│ │ ├── Nimble-dummy.m
│ │ ├── Nimble-prefix.pch
│ │ ├── Nimble-umbrella.h
│ │ ├── Nimble.modulemap
│ │ └── Nimble.xcconfig
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Example
│ │ ├── Info.plist
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Example-acknowledgements.markdown
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Example-acknowledgements.plist
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Example-dummy.m
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Example-frameworks.sh
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Example-resources.sh
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Example-umbrella.h
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Example.debug.xcconfig
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Example.modulemap
│ │ └── Pods-HTTP-Status-Codes-for-Swift_Example.release.xcconfig
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Tests
│ │ ├── Info.plist
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Tests-acknowledgements.markdown
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Tests-acknowledgements.plist
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Tests-dummy.m
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Tests-frameworks.sh
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Tests-resources.sh
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Tests-umbrella.h
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Tests.debug.xcconfig
│ │ ├── Pods-HTTP-Status-Codes-for-Swift_Tests.modulemap
│ │ └── Pods-HTTP-Status-Codes-for-Swift_Tests.release.xcconfig
│ │ ├── Quick
│ │ ├── Info.plist
│ │ ├── Quick-dummy.m
│ │ ├── Quick-prefix.pch
│ │ ├── Quick-umbrella.h
│ │ ├── Quick.modulemap
│ │ └── Quick.xcconfig
│ │ ├── SnapKit
│ │ ├── Info.plist
│ │ ├── SnapKit-dummy.m
│ │ ├── SnapKit-prefix.pch
│ │ ├── SnapKit-umbrella.h
│ │ ├── SnapKit.modulemap
│ │ └── SnapKit.xcconfig
│ │ └── StatusCodes
│ │ ├── Info.plist
│ │ ├── StatusCodes-dummy.m
│ │ ├── StatusCodes-prefix.pch
│ │ ├── StatusCodes-umbrella.h
│ │ ├── StatusCodes.modulemap
│ │ └── StatusCodes.xcconfig
└── Tests
│ ├── Info.plist
│ └── Tests.swift
├── HTTP-Status-Codes-for-Swift
├── Assets
│ └── .gitkeep
└── Classes
│ ├── .gitkeep
│ ├── StatusCodes+Description.swift
│ └── StatusCodes.swift
├── LICENSE
├── README.md
├── StatusCodes.podspec
└── _Pods.xcodeproj
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | *.xcworkspace
13 | !default.xcworkspace
14 | xcuserdata
15 | profile
16 | *.moved-aside
17 | DerivedData
18 | .idea/
19 |
--------------------------------------------------------------------------------
/.swift-version:
--------------------------------------------------------------------------------
1 | 4.0
2 |
--------------------------------------------------------------------------------
/Example/HTTP-Status-Codes-for-Swift/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // HTTP-Status-Codes-for-Swift
4 | //
5 | // Created by Ondrej Rafaj on 11/02/2017.
6 | // Copyright (c) 2017 Ondrej Rafaj. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17 | // Override point for customization after application launch.
18 | return true
19 | }
20 |
21 | func applicationWillResignActive(_ application: UIApplication) {
22 | // 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.
23 | // 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.
24 | }
25 |
26 | func applicationDidEnterBackground(_ application: UIApplication) {
27 | // 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.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | func applicationWillEnterForeground(_ application: UIApplication) {
32 | // 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.
33 | }
34 |
35 | func applicationDidBecomeActive(_ application: UIApplication) {
36 | // 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.
37 | }
38 |
39 | func applicationWillTerminate(_ application: UIApplication) {
40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
41 | }
42 |
43 |
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/Example/HTTP-Status-Codes-for-Swift/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Example/HTTP-Status-Codes-for-Swift/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Example/HTTP-Status-Codes-for-Swift/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | StatusCodes
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 2.0.2
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Example/HTTP-Status-Codes-for-Swift/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // HTTP-Status-Codes-for-Swift
4 | //
5 | // Created by Ondrej Rafaj on 11/02/2017.
6 | // Copyright (c) 2017 Ondrej Rafaj. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import StatusCodes
11 | import SnapKit
12 |
13 |
14 | class ViewController: UIViewController {
15 |
16 | override func viewDidLoad() {
17 | super.viewDidLoad()
18 |
19 | let label = UILabel()
20 |
21 | let httpStatus = StatusCodes.Code418IamATeapot
22 | label.text = "Definition for \(httpStatus.code) is \"\(httpStatus.description())\""
23 |
24 | label.textColor = .black
25 | label.textAlignment = .center
26 | label.numberOfLines = 0
27 | view.addSubview(label)
28 | label.snp.makeConstraints { (make) in
29 | make.left.top.equalTo(44)
30 | make.right.bottom.equalTo(-44)
31 | }
32 | }
33 |
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '10.3'
2 |
3 | use_frameworks!
4 |
5 | target 'HTTP-Status-Codes-for-Swift_Example' do
6 | pod 'StatusCodes', :path => '../'
7 | pod 'SnapKit'
8 |
9 | target 'HTTP-Status-Codes-for-Swift_Tests' do
10 | inherit! :search_paths
11 |
12 | pod 'Quick', '~> 1.2.0'
13 | pod 'Nimble', '~> 7.0.2'
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Nimble (7.0.2)
3 | - Quick (1.2.0)
4 | - SnapKit (4.0.0)
5 | - StatusCodes (2.0.1)
6 |
7 | DEPENDENCIES:
8 | - Nimble (~> 7.0.2)
9 | - Quick (~> 1.2.0)
10 | - SnapKit
11 | - StatusCodes (from `../`)
12 |
13 | EXTERNAL SOURCES:
14 | StatusCodes:
15 | :path: ../
16 |
17 | SPEC CHECKSUMS:
18 | Nimble: bfe1f814edabba69ff145cb1283e04ed636a67f2
19 | Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
20 | SnapKit: a42d492c16e80209130a3379f73596c3454b7694
21 | StatusCodes: e8fa9c8e4e17b26da0fc613595786e1f2e2af71b
22 |
23 | PODFILE CHECKSUM: 1f07d660b9533e1a858294cddd68b4c0fafd2c04
24 |
25 | COCOAPODS: 1.3.1
26 |
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/HTTP-Status-Codes-for-Swift.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "StatusCodes",
3 | "version": "0.1.0",
4 | "summary": "A short description of HTTP-Status-Codes-for-Swift.",
5 | "description": "TODO: Add long description of the pod here.",
6 | "homepage": "https://github.com/Ondrej Rafaj/HTTP-Status-Codes-for-Swift",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "Ondrej Rafaj": "ondrej.rafaj@gmail.com"
13 | },
14 | "source": {
15 | "git": "https://github.com/Ondrej Rafaj/HTTP-Status-Codes-for-Swift.git",
16 | "tag": "0.1.0"
17 | },
18 | "platforms": {
19 | "ios": "8.0"
20 | },
21 | "source_files": "HTTP-Status-Codes-for-Swift/Classes/**/*"
22 | }
23 |
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/StatusCodes.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "StatusCodes",
3 | "version": "2.0.1",
4 | "summary": "HTTP status codes for Swift",
5 | "description": "Swift enum which contans (at least to my knowledge) all available status codes as Int values.",
6 | "homepage": "http://github.com/manGoweb/StatusCodes",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "Ondrej Rafaj": "developers@mangoweb.cz"
13 | },
14 | "source": {
15 | "git": "https://github.com/manGoweb/StatusCodes.git",
16 | "tag": "2.0.1"
17 | },
18 | "social_media_url": "http://twitter.com/mangowebuk",
19 | "platforms": {
20 | "ios": "10.3",
21 | "tvos": "10.0",
22 | "osx": "10.12"
23 | },
24 | "source_files": "HTTP-Status-Codes-for-Swift/Classes/**/*"
25 | }
26 |
--------------------------------------------------------------------------------
/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Nimble (7.0.2)
3 | - Quick (1.2.0)
4 | - SnapKit (4.0.0)
5 | - StatusCodes (2.0.1)
6 |
7 | DEPENDENCIES:
8 | - Nimble (~> 7.0.2)
9 | - Quick (~> 1.2.0)
10 | - SnapKit
11 | - StatusCodes (from `../`)
12 |
13 | EXTERNAL SOURCES:
14 | StatusCodes:
15 | :path: ../
16 |
17 | SPEC CHECKSUMS:
18 | Nimble: bfe1f814edabba69ff145cb1283e04ed636a67f2
19 | Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
20 | SnapKit: a42d492c16e80209130a3379f73596c3454b7694
21 | StatusCodes: e8fa9c8e4e17b26da0fc613595786e1f2e2af71b
22 |
23 | PODFILE CHECKSUM: 1f07d660b9533e1a858294cddd68b4c0fafd2c04
24 |
25 | COCOAPODS: 1.3.1
26 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Lib/CwlPreconditionTesting/CwlCatchException/CwlCatchException.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CwlCatchException.swift
3 | // CwlAssertionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( http://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(_ instance: T, block: () -> Void) -> T? {
28 | // Get the type from an *instance*, instead of a receiving the type directly
29 | return catchExceptionOfKind(T.self, block) as? T
30 | }
31 |
32 | extension NSException {
33 | public static func catchException(in block: () -> Void) -> Self? {
34 | // Use a dummy instance of Self to provide the type
35 | return catchReturnTypeConverter(self.init(), block: block)
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Lib/CwlPreconditionTesting/CwlCatchExceptionSupport/CwlCatchException.m:
--------------------------------------------------------------------------------
1 | //
2 | // CwlCatchException.m
3 | // CwlAssertionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( http://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 | #if !SWIFT_PACKAGE && NON_SWIFT_PACKAGE
24 | __attribute__((visibility("hidden")))
25 | #endif
26 | NSException* catchExceptionOfKind(Class __nonnull type, __attribute__((noescape)) void (^ __nonnull inBlock)(void)) {
27 | @try {
28 | inBlock();
29 | } @catch (NSException *exception) {
30 | if ([exception isKindOfClass:type]) {
31 | return exception;
32 | } else {
33 | @throw;
34 | }
35 | }
36 | return nil;
37 | }
38 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Lib/CwlPreconditionTesting/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 ( http://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 | //! Project version number for CwlCatchException.
24 | FOUNDATION_EXPORT double CwlCatchExceptionVersionNumber;
25 |
26 | //! Project version string for CwlCatchException.
27 | FOUNDATION_EXPORT const unsigned char CwlCatchExceptionVersionString[];
28 |
29 | #if !SWIFT_PACKAGE && NON_SWIFT_PACKAGE
30 | __attribute__((visibility("hidden")))
31 | #endif
32 | NSException* __nullable catchExceptionOfKind(Class __nonnull type, __attribute__((noescape)) void (^ __nonnull inBlock)(void));
33 |
34 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Lib/CwlPreconditionTesting/CwlMachBadInstructionHandler/CwlMachBadInstructionHandler.m:
--------------------------------------------------------------------------------
1 | //
2 | // CwlMachBadExceptionHandler.m
3 | // CwlPreconditionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( http://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 defined(__x86_64__)
22 |
23 | #import "mach_excServer.h"
24 | #import "CwlMachBadInstructionHandler.h"
25 |
26 | @protocol BadInstructionReply
27 | +(NSNumber *)receiveReply:(NSValue *)value;
28 | @end
29 |
30 | /// A basic function that receives callbacks from mach_exc_server and relays them to the Swift implemented BadInstructionException.catch_mach_exception_raise_state.
31 | kern_return_t catch_mach_exception_raise_state(mach_port_t exception_port, exception_type_t exception, const mach_exception_data_t code, mach_msg_type_number_t codeCnt, int *flavor, const thread_state_t old_state, mach_msg_type_number_t old_stateCnt, thread_state_t new_state, mach_msg_type_number_t *new_stateCnt) {
32 | bad_instruction_exception_reply_t reply = { exception_port, exception, code, codeCnt, flavor, old_state, old_stateCnt, new_state, new_stateCnt };
33 | Class badInstructionClass = NSClassFromString(@"BadInstructionException");
34 | NSValue *value = [NSValue valueWithBytes: &reply objCType: @encode(bad_instruction_exception_reply_t)];
35 | return [[badInstructionClass performSelector: @selector(receiveReply:) withObject: value] intValue];
36 | }
37 |
38 | // The mach port should be configured so that this function is never used.
39 | kern_return_t catch_mach_exception_raise(mach_port_t exception_port, mach_port_t thread, mach_port_t task, exception_type_t exception, mach_exception_data_t code, mach_msg_type_number_t codeCnt) {
40 | assert(false);
41 | return KERN_FAILURE;
42 | }
43 |
44 | // The mach port should be configured so that this function is never used.
45 | kern_return_t catch_mach_exception_raise_state_identity(mach_port_t exception_port, mach_port_t thread, mach_port_t task, exception_type_t exception, mach_exception_data_t code, mach_msg_type_number_t codeCnt, int *flavor, thread_state_t old_state, mach_msg_type_number_t old_stateCnt, thread_state_t new_state, mach_msg_type_number_t *new_stateCnt) {
46 | assert(false);
47 | return KERN_FAILURE;
48 | }
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Lib/CwlPreconditionTesting/CwlMachBadInstructionHandler/include/CwlMachBadInstructionHandler.h:
--------------------------------------------------------------------------------
1 | //
2 | // CwlMachBadExceptionHandler.h
3 | // CwlPreconditionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( http://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 | #import
23 |
24 | NS_ASSUME_NONNULL_BEGIN
25 |
26 | extern boolean_t mach_exc_server(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
27 |
28 | // The request_mach_exception_raise_t struct is passed to mach_msg which assumes its exact layout. To avoid problems with different layouts, we keep the definition in C rather than Swift.
29 | typedef struct
30 | {
31 | mach_msg_header_t Head;
32 | /* start of the kernel processed data */
33 | mach_msg_body_t msgh_body;
34 | mach_msg_port_descriptor_t thread;
35 | mach_msg_port_descriptor_t task;
36 | /* end of the kernel processed data */
37 | NDR_record_t NDR;
38 | exception_type_t exception;
39 | mach_msg_type_number_t codeCnt;
40 | int64_t code[2];
41 | int flavor;
42 | mach_msg_type_number_t old_stateCnt;
43 | natural_t old_state[224];
44 | } request_mach_exception_raise_t;
45 |
46 | // The reply_mach_exception_raise_state_t struct is passed to mach_msg which assumes its exact layout. To avoid problems with different layouts, we keep the definition in C rather than Swift.
47 | typedef struct
48 | {
49 | mach_msg_header_t Head;
50 | NDR_record_t NDR;
51 | kern_return_t RetCode;
52 | int flavor;
53 | mach_msg_type_number_t new_stateCnt;
54 | natural_t new_state[224];
55 | } reply_mach_exception_raise_state_t;
56 |
57 | typedef struct
58 | {
59 | mach_port_t exception_port;
60 | exception_type_t exception;
61 | mach_exception_data_type_t const * _Nullable code;
62 | mach_msg_type_number_t codeCnt;
63 | int32_t * _Nullable flavor;
64 | natural_t const * _Nullable old_state;
65 | mach_msg_type_number_t old_stateCnt;
66 | thread_state_t _Nullable new_state;
67 | mach_msg_type_number_t * _Nullable new_stateCnt;
68 | } bad_instruction_exception_reply_t;
69 |
70 | NS_ASSUME_NONNULL_END
71 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/CwlDarwinDefinitions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CwlDarwinDefinitions.swift
3 | // CwlPreconditionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( http://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 Darwin
22 |
23 | #if arch(x86_64)
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/Lib/CwlPreconditionTesting/CwlPreconditionTesting/Mach/CwlPreconditionTesting.h:
--------------------------------------------------------------------------------
1 | //
2 | // CwlPreconditionTesting.h
3 | // CwlPreconditionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( http://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 | //! Project version number for CwlUtils.
24 | FOUNDATION_EXPORT double CwlPreconditionTestingVersionNumber;
25 |
26 | //! Project version string for CwlUtils.
27 | FOUNDATION_EXPORT const unsigned char CwlAssertingTestingVersionString[];
28 |
29 | #include "CwlMachBadInstructionHandler.h"
30 | #include "CwlCatchException.h"
31 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Adapters/AdapterProtocols.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// Protocol for the assertion handler that Nimble uses for all expectations.
4 | public protocol AssertionHandler {
5 | func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation)
6 | }
7 |
8 | /// Global backing interface for assertions that Nimble creates.
9 | /// Defaults to a private test handler that passes through to XCTest.
10 | ///
11 | /// If XCTest is not available, you must assign your own assertion handler
12 | /// before using any matchers, otherwise Nimble will abort the program.
13 | ///
14 | /// @see AssertionHandler
15 | public var NimbleAssertionHandler: AssertionHandler = { () -> AssertionHandler in
16 | return isXCTestAvailable() ? NimbleXCTestHandler() : NimbleXCTestUnavailableHandler()
17 | }()
18 |
--------------------------------------------------------------------------------
/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/NMBObjCMatcher.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
4 |
5 | // swiftlint:disable line_length
6 | public typealias MatcherBlock = (_ actualExpression: Expression, _ failureMessage: FailureMessage) -> Bool
7 | public typealias FullMatcherBlock = (_ actualExpression: Expression, _ failureMessage: FailureMessage, _ shouldNotMatch: Bool) -> Bool
8 | // swiftlint:enable line_length
9 |
10 | public class NMBObjCMatcher: NSObject, NMBMatcher {
11 | let _match: MatcherBlock
12 | let _doesNotMatch: MatcherBlock
13 | let canMatchNil: Bool
14 |
15 | public init(canMatchNil: Bool, matcher: @escaping MatcherBlock, notMatcher: @escaping MatcherBlock) {
16 | self.canMatchNil = canMatchNil
17 | self._match = matcher
18 | self._doesNotMatch = notMatcher
19 | }
20 |
21 | public convenience init(matcher: @escaping MatcherBlock) {
22 | self.init(canMatchNil: true, matcher: matcher)
23 | }
24 |
25 | public convenience init(canMatchNil: Bool, matcher: @escaping MatcherBlock) {
26 | self.init(canMatchNil: canMatchNil, matcher: matcher, notMatcher: ({ actualExpression, failureMessage in
27 | return !matcher(actualExpression, failureMessage)
28 | }))
29 | }
30 |
31 | public convenience init(matcher: @escaping FullMatcherBlock) {
32 | self.init(canMatchNil: true, matcher: matcher)
33 | }
34 |
35 | public convenience init(canMatchNil: Bool, matcher: @escaping FullMatcherBlock) {
36 | self.init(canMatchNil: canMatchNil, matcher: ({ actualExpression, failureMessage in
37 | return matcher(actualExpression, failureMessage, false)
38 | }), notMatcher: ({ actualExpression, failureMessage in
39 | return matcher(actualExpression, failureMessage, true)
40 | }))
41 | }
42 |
43 | private func canMatch(_ actualExpression: Expression, failureMessage: FailureMessage) -> Bool {
44 | do {
45 | if !canMatchNil {
46 | if try actualExpression.evaluate() == nil {
47 | failureMessage.postfixActual = " (use beNil() to match nils)"
48 | return false
49 | }
50 | }
51 | } catch let error {
52 | failureMessage.actualValue = "an unexpected error thrown: \(error)"
53 | return false
54 | }
55 | return true
56 | }
57 |
58 | public func matches(_ actualBlock: @escaping () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
59 | let expr = Expression(expression: actualBlock, location: location)
60 | let result = _match(
61 | expr,
62 | failureMessage)
63 | if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) {
64 | return result
65 | } else {
66 | return false
67 | }
68 | }
69 |
70 | public func doesNotMatch(_ actualBlock: @escaping () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
71 | let expr = Expression(expression: actualBlock, location: location)
72 | let result = _doesNotMatch(
73 | expr,
74 | failureMessage)
75 | if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) {
76 | return result
77 | } else {
78 | return false
79 | }
80 | }
81 | }
82 |
83 | #endif
84 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Adapters/NimbleEnvironment.swift:
--------------------------------------------------------------------------------
1 | import Dispatch
2 | import Foundation
3 |
4 | /// "Global" state of Nimble is stored here. Only DSL functions should access / be aware of this
5 | /// class' existence
6 | internal class NimbleEnvironment {
7 | static var activeInstance: NimbleEnvironment {
8 | get {
9 | let env = Thread.current.threadDictionary["NimbleEnvironment"]
10 | if let env = env as? NimbleEnvironment {
11 | return env
12 | } else {
13 | let newEnv = NimbleEnvironment()
14 | self.activeInstance = newEnv
15 | return newEnv
16 | }
17 | }
18 | set {
19 | Thread.current.threadDictionary["NimbleEnvironment"] = newValue
20 | }
21 | }
22 |
23 | // TODO: eventually migrate the global to this environment value
24 | var assertionHandler: AssertionHandler {
25 | get { return NimbleAssertionHandler }
26 | set { NimbleAssertionHandler = newValue }
27 | }
28 |
29 | var suppressTVOSAssertionWarning: Bool = false
30 | var awaiter: Awaiter
31 |
32 | init() {
33 | let timeoutQueue: DispatchQueue
34 | if #available(OSX 10.10, *) {
35 | timeoutQueue = DispatchQueue.global(qos: .userInitiated)
36 | } else {
37 | timeoutQueue = DispatchQueue.global(priority: .high)
38 | }
39 |
40 | awaiter = Awaiter(
41 | waitLock: AssertionWaitLock(),
42 | asyncQueue: .main,
43 | timeoutQueue: timeoutQueue)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Adapters/NimbleXCTestHandler.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import XCTest
3 |
4 | /// Default handler for Nimble. This assertion handler passes failures along to
5 | /// XCTest.
6 | public class NimbleXCTestHandler: AssertionHandler {
7 | public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) {
8 | if !assertion {
9 | recordFailure("\(message.stringValue)\n", location: location)
10 | }
11 | }
12 | }
13 |
14 | /// Alternative handler for Nimble. This assertion handler passes failures along
15 | /// to XCTest by attempting to reduce the failure message size.
16 | public class NimbleShortXCTestHandler: AssertionHandler {
17 | public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) {
18 | if !assertion {
19 | let msg: String
20 | if let actual = message.actualValue {
21 | msg = "got: \(actual) \(message.postfixActual)"
22 | } else {
23 | msg = "expected \(message.to) \(message.postfixMessage)"
24 | }
25 | recordFailure("\(msg)\n", location: location)
26 | }
27 | }
28 | }
29 |
30 | /// Fallback handler in case XCTest is unavailable. This assertion handler will abort
31 | /// the program if it is invoked.
32 | class NimbleXCTestUnavailableHandler: AssertionHandler {
33 | func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) {
34 | fatalError("XCTest is not available and no custom assertion handler was configured. Aborting.")
35 | }
36 | }
37 |
38 | #if !SWIFT_PACKAGE
39 | /// Helper class providing access to the currently executing XCTestCase instance, if any
40 | @objc final internal class CurrentTestCaseTracker: NSObject, XCTestObservation {
41 | @objc static let sharedInstance = CurrentTestCaseTracker()
42 |
43 | private(set) var currentTestCase: XCTestCase?
44 |
45 | @objc func testCaseWillStart(_ testCase: XCTestCase) {
46 | currentTestCase = testCase
47 | }
48 |
49 | @objc func testCaseDidFinish(_ testCase: XCTestCase) {
50 | currentTestCase = nil
51 | }
52 | }
53 | #endif
54 |
55 | func isXCTestAvailable() -> Bool {
56 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
57 | // XCTest is weakly linked and so may not be present
58 | return NSClassFromString("XCTestCase") != nil
59 | #else
60 | return true
61 | #endif
62 | }
63 |
64 | private func recordFailure(_ message: String, location: SourceLocation) {
65 | #if SWIFT_PACKAGE
66 | XCTFail("\(message)", file: location.file, line: location.line)
67 | #else
68 | if let testCase = CurrentTestCaseTracker.sharedInstance.currentTestCase {
69 | #if swift(>=4)
70 | let line = Int(location.line)
71 | #else
72 | let line = location.line
73 | #endif
74 | testCase.recordFailure(withDescription: message, inFile: location.file, atLine: line, expected: true)
75 | } else {
76 | let msg = "Attempted to report a test failure to XCTest while no test case was running. " +
77 | "The failure was:\n\"\(message)\"\nIt occurred at: \(location.file):\(location.line)"
78 | NSException(name: .internalInconsistencyException, reason: msg, userInfo: nil).raise()
79 | }
80 | #endif
81 | }
82 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/DSL.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// Make an expectation on a given actual value. The value given is lazily evaluated.
4 | public func expect(_ expression: @autoclosure @escaping () throws -> T?, file: FileString = #file, line: UInt = #line) -> Expectation {
5 | return Expectation(
6 | expression: Expression(
7 | expression: expression,
8 | location: SourceLocation(file: file, line: line),
9 | isClosure: true))
10 | }
11 |
12 | /// Make an expectation on a given actual value. The closure is lazily invoked.
13 | public func expect(_ file: FileString = #file, line: UInt = #line, expression: @escaping () throws -> T?) -> Expectation {
14 | return Expectation(
15 | expression: Expression(
16 | expression: expression,
17 | location: SourceLocation(file: file, line: line),
18 | isClosure: true))
19 | }
20 |
21 | /// Always fails the test with a message and a specified location.
22 | public func fail(_ message: String, location: SourceLocation) {
23 | let handler = NimbleEnvironment.activeInstance.assertionHandler
24 | handler.assert(false, message: FailureMessage(stringValue: message), location: location)
25 | }
26 |
27 | /// Always fails the test with a message.
28 | public func fail(_ message: String, file: FileString = #file, line: UInt = #line) {
29 | fail(message, location: SourceLocation(file: file, line: line))
30 | }
31 |
32 | /// Always fails the test.
33 | public func fail(_ file: FileString = #file, line: UInt = #line) {
34 | fail("fail() always fails", file: file, line: line)
35 | }
36 |
37 | /// Like Swift's precondition(), but raises NSExceptions instead of sigaborts
38 | internal func nimblePrecondition(
39 | _ expr: @autoclosure() -> Bool,
40 | _ name: @autoclosure() -> String,
41 | _ message: @autoclosure() -> String,
42 | file: StaticString = #file,
43 | line: UInt = #line) {
44 | let result = expr()
45 | if !result {
46 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
47 | let e = NSException(
48 | name: NSExceptionName(name()),
49 | reason: message(),
50 | userInfo: nil)
51 | e.raise()
52 | #else
53 | preconditionFailure("\(name()) - \(message())", file: file, line: line)
54 | #endif
55 | }
56 | }
57 |
58 | internal func internalError(_ msg: String, file: FileString = #file, line: UInt = #line) -> Never {
59 | fatalError(
60 | "Nimble Bug Found: \(msg) at \(file):\(line).\n" +
61 | "Please file a bug to Nimble: https://github.com/Quick/Nimble/issues with the " +
62 | "code snippet that caused this error."
63 | )
64 | }
65 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/FailureMessage.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// Encapsulates the failure message that matchers can report to the end user.
4 | ///
5 | /// This is shared state between Nimble and matchers that mutate this value.
6 | public class FailureMessage: NSObject {
7 | public var expected: String = "expected"
8 | public var actualValue: String? = "" // empty string -> use default; nil -> exclude
9 | public var to: String = "to"
10 | public var postfixMessage: String = "match"
11 | public var postfixActual: String = ""
12 | /// An optional message that will be appended as a new line and provides additional details
13 | /// about the failure. This message will only be visible in the issue navigator / in logs but
14 | /// not directly in the source editor since only a single line is presented there.
15 | public var extendedMessage: String?
16 | public var userDescription: String?
17 |
18 | public var stringValue: String {
19 | get {
20 | if let value = _stringValueOverride {
21 | return value
22 | } else {
23 | return computeStringValue()
24 | }
25 | }
26 | set {
27 | _stringValueOverride = newValue
28 | }
29 | }
30 |
31 | internal var _stringValueOverride: String?
32 | internal var hasOverriddenStringValue: Bool {
33 | return _stringValueOverride != nil
34 | }
35 |
36 | public override init() {
37 | }
38 |
39 | public init(stringValue: String) {
40 | _stringValueOverride = stringValue
41 | }
42 |
43 | internal func stripNewlines(_ str: String) -> String {
44 | let whitespaces = CharacterSet.whitespacesAndNewlines
45 | return str
46 | .components(separatedBy: "\n")
47 | .map { line in line.trimmingCharacters(in: whitespaces) }
48 | .joined(separator: "")
49 | }
50 |
51 | internal func computeStringValue() -> String {
52 | var value = "\(expected) \(to) \(postfixMessage)"
53 | if let actualValue = actualValue {
54 | value = "\(expected) \(to) \(postfixMessage), got \(actualValue)\(postfixActual)"
55 | }
56 | value = stripNewlines(value)
57 |
58 | if let extendedMessage = extendedMessage {
59 | value += "\n\(stripNewlines(extendedMessage))"
60 | }
61 |
62 | if let userDescription = userDescription {
63 | return "\(userDescription)\n\(value)"
64 | }
65 |
66 | return value
67 | }
68 |
69 | internal func appendMessage(_ msg: String) {
70 | if hasOverriddenStringValue {
71 | stringValue += "\(msg)"
72 | } else if actualValue != nil {
73 | postfixActual += msg
74 | } else {
75 | postfixMessage += msg
76 | }
77 | }
78 |
79 | internal func appendDetails(_ msg: String) {
80 | if hasOverriddenStringValue {
81 | if let desc = userDescription {
82 | stringValue = "\(desc)\n\(stringValue)"
83 | }
84 | stringValue += "\n\(msg)"
85 | } else {
86 | if let desc = userDescription {
87 | userDescription = desc
88 | }
89 | extendedMessage = msg
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/BeAKindOf.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | private func matcherMessage(forType expectedType: T.Type) -> String {
4 | return "be a kind of \(String(describing: expectedType))"
5 | }
6 | private func matcherMessage(forClass expectedClass: AnyClass) -> String {
7 | return "be a kind of \(String(describing: expectedClass))"
8 | }
9 |
10 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class.
11 | public func beAKindOf(_ expectedType: T.Type) -> Predicate {
12 | return Predicate.define { actualExpression in
13 | let message: ExpectationMessage
14 |
15 | let instance = try actualExpression.evaluate()
16 | guard let validInstance = instance else {
17 | message = .expectedCustomValueTo(matcherMessage(forType: expectedType), "")
18 | return PredicateResult(status: .fail, message: message)
19 | }
20 | message = .expectedCustomValueTo(
21 | "be a kind of \(String(describing: expectedType))",
22 | "<\(String(describing: type(of: validInstance))) instance>"
23 | )
24 |
25 | return PredicateResult(
26 | bool: validInstance is T,
27 | message: message
28 | )
29 | }
30 | }
31 |
32 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
33 |
34 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class.
35 | /// @see beAnInstanceOf if you want to match against the exact class
36 | public func beAKindOf(_ expectedClass: AnyClass) -> Predicate {
37 | return Predicate.define { actualExpression in
38 | let message: ExpectationMessage
39 | let status: PredicateStatus
40 |
41 | let instance = try actualExpression.evaluate()
42 | if let validInstance = instance {
43 | status = PredicateStatus(bool: instance != nil && instance!.isKind(of: expectedClass))
44 | message = .expectedCustomValueTo(
45 | matcherMessage(forClass: expectedClass),
46 | "<\(String(describing: type(of: validInstance))) instance>"
47 | )
48 | } else {
49 | status = .fail
50 | message = .expectedCustomValueTo(
51 | matcherMessage(forClass: expectedClass),
52 | ""
53 | )
54 | }
55 |
56 | return PredicateResult(status: status, message: message)
57 | }
58 | }
59 |
60 | extension NMBObjCMatcher {
61 | @objc public class func beAKindOfMatcher(_ expected: AnyClass) -> NMBMatcher {
62 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
63 | return try! beAKindOf(expected).matches(actualExpression, failureMessage: failureMessage)
64 | }
65 | }
66 | }
67 |
68 | #endif
69 |
--------------------------------------------------------------------------------
/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, 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 os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
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, actualString)
44 | )
45 | }
46 | }
47 |
48 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
49 | extension NMBObjCMatcher {
50 | @objc public class func beAnInstanceOfMatcher(_ expected: AnyClass) -> NMBMatcher {
51 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
52 | return try! beAnInstanceOf(expected).matches(actualExpression, failureMessage: failureMessage)
53 | }
54 | }
55 | }
56 | #endif
57 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThan.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value.
4 | public func beGreaterThan(_ expectedValue: T?) -> Predicate {
5 | let errorMessage = "be greater than <\(stringify(expectedValue))>"
6 | return Predicate.simple(errorMessage) { actualExpression in
7 | if let actual = try actualExpression.evaluate(), let expected = expectedValue {
8 | return PredicateStatus(bool: actual > expected)
9 | }
10 | return .fail
11 | }
12 | }
13 |
14 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value.
15 | public func beGreaterThan(_ expectedValue: NMBComparable?) -> Predicate {
16 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
17 | failureMessage.postfixMessage = "be greater than <\(stringify(expectedValue))>"
18 | let actualValue = try actualExpression.evaluate()
19 | let matches = actualValue != nil
20 | && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedDescending
21 | return matches
22 | }.requireNonNil
23 | }
24 |
25 | public func >(lhs: Expectation, rhs: T) {
26 | lhs.to(beGreaterThan(rhs))
27 | }
28 |
29 | public func > (lhs: Expectation, rhs: NMBComparable?) {
30 | lhs.to(beGreaterThan(rhs))
31 | }
32 |
33 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
34 | extension NMBObjCMatcher {
35 | @objc public class func beGreaterThanMatcher(_ expected: NMBComparable?) -> NMBObjCMatcher {
36 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
37 | let expr = actualExpression.cast { $0 as? NMBComparable }
38 | return try! beGreaterThan(expected).matches(expr, failureMessage: failureMessage)
39 | }
40 | }
41 | }
42 | #endif
43 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is greater than
4 | /// or equal to the expected value.
5 | public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> Predicate {
6 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
7 | failureMessage.postfixMessage = "be greater than or equal to <\(stringify(expectedValue))>"
8 | let actualValue = try actualExpression.evaluate()
9 | if let actual = actualValue, let expected = expectedValue {
10 | return actual >= expected
11 | }
12 | return false
13 | }.requireNonNil
14 | }
15 |
16 | /// A Nimble matcher that succeeds when the actual value is greater than
17 | /// or equal to the expected value.
18 | public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> Predicate {
19 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
20 | failureMessage.postfixMessage = "be greater than or equal to <\(stringify(expectedValue))>"
21 | let actualValue = try actualExpression.evaluate()
22 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) != ComparisonResult.orderedAscending
23 | return matches
24 | }.requireNonNil
25 | }
26 |
27 | public func >=(lhs: Expectation, rhs: T) {
28 | lhs.to(beGreaterThanOrEqualTo(rhs))
29 | }
30 |
31 | public func >=(lhs: Expectation, rhs: T) {
32 | lhs.to(beGreaterThanOrEqualTo(rhs))
33 | }
34 |
35 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
36 | extension NMBObjCMatcher {
37 | @objc public class func beGreaterThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBObjCMatcher {
38 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
39 | let expr = actualExpression.cast { $0 as? NMBComparable }
40 | return try! beGreaterThanOrEqualTo(expected).matches(expr, failureMessage: failureMessage)
41 | }
42 | }
43 | }
44 | #endif
45 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/BeIdenticalTo.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is the same instance
4 | /// as the expected instance.
5 | public func beIdenticalTo(_ expected: Any?) -> Predicate {
6 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
7 | #if os(Linux)
8 | let actual = try actualExpression.evaluate() as? AnyObject
9 | #else
10 | let actual = try actualExpression.evaluate() as AnyObject?
11 | #endif
12 | failureMessage.actualValue = "\(identityAsString(actual))"
13 | failureMessage.postfixMessage = "be identical to \(identityAsString(expected))"
14 | #if os(Linux)
15 | return actual === (expected as? AnyObject) && actual !== nil
16 | #else
17 | return actual === (expected as AnyObject?) && actual !== nil
18 | #endif
19 | }.requireNonNil
20 | }
21 |
22 | public func === (lhs: Expectation, rhs: Any?) {
23 | lhs.to(beIdenticalTo(rhs))
24 | }
25 | public func !== (lhs: Expectation, rhs: Any?) {
26 | lhs.toNot(beIdenticalTo(rhs))
27 | }
28 |
29 | /// A Nimble matcher that succeeds when the actual value is the same instance
30 | /// as the expected instance.
31 | ///
32 | /// Alias for "beIdenticalTo".
33 | public func be(_ expected: Any?) -> Predicate {
34 | return beIdenticalTo(expected)
35 | }
36 |
37 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
38 | extension NMBObjCMatcher {
39 | @objc public class func beIdenticalToMatcher(_ expected: NSObject?) -> NMBObjCMatcher {
40 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
41 | let aExpr = actualExpression.cast { $0 as Any? }
42 | return try! beIdenticalTo(expected).matches(aExpr, failureMessage: failureMessage)
43 | }
44 | }
45 | }
46 | #endif
47 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThan.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is less than the expected value.
4 | public func beLessThan(_ expectedValue: T?) -> Predicate {
5 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
6 | failureMessage.postfixMessage = "be less than <\(stringify(expectedValue))>"
7 | if let actual = try actualExpression.evaluate(), let expected = expectedValue {
8 | return actual < expected
9 | }
10 | return false
11 | }.requireNonNil
12 | }
13 |
14 | /// A Nimble matcher that succeeds when the actual value is less than the expected value.
15 | public func beLessThan(_ expectedValue: NMBComparable?) -> Predicate {
16 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
17 | failureMessage.postfixMessage = "be less than <\(stringify(expectedValue))>"
18 | let actualValue = try actualExpression.evaluate()
19 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedAscending
20 | return matches
21 | }.requireNonNil
22 | }
23 |
24 | public func <(lhs: Expectation, rhs: T) {
25 | lhs.to(beLessThan(rhs))
26 | }
27 |
28 | public func < (lhs: Expectation, rhs: NMBComparable?) {
29 | lhs.to(beLessThan(rhs))
30 | }
31 |
32 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
33 | extension NMBObjCMatcher {
34 | @objc public class func beLessThanMatcher(_ expected: NMBComparable?) -> NMBObjCMatcher {
35 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
36 | let expr = actualExpression.cast { $0 as? NMBComparable }
37 | return try! beLessThan(expected).matches(expr, failureMessage: failureMessage)
38 | }
39 | }
40 | }
41 | #endif
42 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThanOrEqual.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is less than
4 | /// or equal to the expected value.
5 | public func beLessThanOrEqualTo(_ expectedValue: T?) -> Predicate {
6 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
7 | failureMessage.postfixMessage = "be less than or equal to <\(stringify(expectedValue))>"
8 | if let actual = try actualExpression.evaluate(), let expected = expectedValue {
9 | return actual <= expected
10 | }
11 | return false
12 | }.requireNonNil
13 | }
14 |
15 | /// A Nimble matcher that succeeds when the actual value is less than
16 | /// or equal to the expected value.
17 | public func beLessThanOrEqualTo(_ expectedValue: T?) -> Predicate {
18 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
19 | failureMessage.postfixMessage = "be less than or equal to <\(stringify(expectedValue))>"
20 | let actualValue = try actualExpression.evaluate()
21 | return actualValue != nil && actualValue!.NMB_compare(expectedValue) != ComparisonResult.orderedDescending
22 | }.requireNonNil
23 | }
24 |
25 | public func <=(lhs: Expectation, rhs: T) {
26 | lhs.to(beLessThanOrEqualTo(rhs))
27 | }
28 |
29 | public func <=(lhs: Expectation, rhs: T) {
30 | lhs.to(beLessThanOrEqualTo(rhs))
31 | }
32 |
33 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
34 | extension NMBObjCMatcher {
35 | @objc public class func beLessThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBObjCMatcher {
36 | return NMBObjCMatcher(canMatchNil:false) { actualExpression, failureMessage in
37 | let expr = actualExpression.cast { $0 as? NMBComparable }
38 | return try! beLessThanOrEqualTo(expected).matches(expr, failureMessage: failureMessage)
39 | }
40 | }
41 | }
42 | #endif
43 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/BeNil.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is nil.
4 | public func beNil() -> Predicate {
5 | return Predicate.simpleNilable("be nil") { actualExpression in
6 | let actualValue = try actualExpression.evaluate()
7 | return PredicateStatus(bool: actualValue == nil)
8 | }
9 | }
10 |
11 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
12 | extension NMBObjCMatcher {
13 | @objc public class func beNilMatcher() -> NMBObjCMatcher {
14 | return NMBObjCMatcher { actualExpression, failureMessage in
15 | return try! beNil().matches(actualExpression, failureMessage: failureMessage)
16 | }
17 | }
18 | }
19 | #endif
20 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/BeVoid.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is Void.
4 | public func beVoid() -> Predicate<()> {
5 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
6 | failureMessage.postfixMessage = "be void"
7 | let actualValue: ()? = try actualExpression.evaluate()
8 | return actualValue != nil
9 | }
10 | }
11 |
12 | public func == (lhs: Expectation<()>, rhs: ()) {
13 | lhs.to(beVoid())
14 | }
15 |
16 | public func != (lhs: Expectation<()>, rhs: ()) {
17 | lhs.toNot(beVoid())
18 | }
19 |
--------------------------------------------------------------------------------
/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: T) -> Predicate
6 | where S.Iterator.Element == T {
7 | return Predicate.simple("begin with <\(startingElement)>") { actualExpression in
8 | if let actualValue = try actualExpression.evaluate() {
9 | var actualGenerator = actualValue.makeIterator()
10 | return PredicateStatus(bool: actualGenerator.next() == startingElement)
11 | }
12 | return .fail
13 | }
14 | }
15 |
16 | /// A Nimble matcher that succeeds when the actual collection's first element
17 | /// is equal to the expected object.
18 | public func beginWith(_ startingElement: Any) -> Predicate {
19 | return Predicate.simple("begin with <\(startingElement)>") { actualExpression in
20 | guard let collection = try actualExpression.evaluate() else { return .fail }
21 | guard collection.count > 0 else { return .doesNotMatch }
22 | #if os(Linux)
23 | guard let collectionValue = collection.object(at: 0) as? NSObject else {
24 | return .fail
25 | }
26 | #else
27 | let collectionValue = collection.object(at: 0) as AnyObject
28 | #endif
29 | return PredicateStatus(bool: collectionValue.isEqual(startingElement))
30 | }
31 | }
32 |
33 | /// A Nimble matcher that succeeds when the actual string contains expected substring
34 | /// where the expected substring's location is zero.
35 | public func beginWith(_ startingSubstring: String) -> Predicate {
36 | return Predicate.simple("begin with <\(startingSubstring)>") { actualExpression in
37 | if let actual = try actualExpression.evaluate() {
38 | let range = actual.range(of: startingSubstring)
39 | return PredicateStatus(bool: range != nil && range!.lowerBound == actual.startIndex)
40 | }
41 | return .fail
42 | }
43 | }
44 |
45 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
46 | extension NMBObjCMatcher {
47 | @objc public class func beginWithMatcher(_ expected: Any) -> NMBObjCMatcher {
48 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
49 | let actual = try! actualExpression.evaluate()
50 | if (actual as? String) != nil {
51 | let expr = actualExpression.cast { $0 as? String }
52 | return try! beginWith(expected as! String).matches(expr, failureMessage: failureMessage)
53 | } else {
54 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection }
55 | return try! beginWith(expected).matches(expr, failureMessage: failureMessage)
56 | }
57 | }
58 | }
59 | }
60 | #endif
61 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/ContainElementSatisfying.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | public func containElementSatisfying(_ predicate: @escaping ((T) -> Bool), _ predicateDescription: String = "") -> Predicate where S.Iterator.Element == T {
4 |
5 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
6 | failureMessage.actualValue = nil
7 |
8 | if predicateDescription == "" {
9 | failureMessage.postfixMessage = "find object in collection that satisfies predicate"
10 | } else {
11 | failureMessage.postfixMessage = "find object in collection \(predicateDescription)"
12 | }
13 |
14 | if let sequence = try actualExpression.evaluate() {
15 | for object in sequence {
16 | if predicate(object) {
17 | return true
18 | }
19 | }
20 |
21 | return false
22 | }
23 |
24 | return false
25 | }.requireNonNil
26 | }
27 |
28 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
29 | extension NMBObjCMatcher {
30 | @objc public class func containElementSatisfyingMatcher(_ predicate: @escaping ((NSObject) -> Bool)) -> NMBObjCMatcher {
31 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
32 | let value = try! actualExpression.evaluate()
33 | guard let enumeration = value as? NSFastEnumeration else {
34 | // swiftlint:disable:next line_length
35 | failureMessage.postfixMessage = "containElementSatisfying must be provided an NSFastEnumeration object"
36 | failureMessage.actualValue = nil
37 | failureMessage.expected = ""
38 | failureMessage.to = ""
39 | return false
40 | }
41 |
42 | var iterator = NSFastEnumerationIterator(enumeration)
43 | while let item = iterator.next() {
44 | guard let object = item as? NSObject else {
45 | continue
46 | }
47 |
48 | if predicate(object) {
49 | return true
50 | }
51 | }
52 |
53 | failureMessage.actualValue = nil
54 | failureMessage.postfixMessage = ""
55 | failureMessage.to = "to find object in collection that satisfies predicate"
56 | return false
57 | }
58 | }
59 | }
60 | #endif
61 |
--------------------------------------------------------------------------------
/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: T) -> Predicate
6 | where S.Iterator.Element == T {
7 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
8 | failureMessage.postfixMessage = "end with <\(endingElement)>"
9 |
10 | if let actualValue = try actualExpression.evaluate() {
11 | var actualGenerator = actualValue.makeIterator()
12 | var lastItem: T?
13 | var item: T?
14 | repeat {
15 | lastItem = item
16 | item = actualGenerator.next()
17 | } while(item != nil)
18 |
19 | return lastItem == endingElement
20 | }
21 | return false
22 | }.requireNonNil
23 | }
24 |
25 | /// A Nimble matcher that succeeds when the actual collection's last element
26 | /// is equal to the expected object.
27 | public func endWith(_ endingElement: Any) -> Predicate {
28 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
29 | failureMessage.postfixMessage = "end with <\(endingElement)>"
30 | guard let collection = try actualExpression.evaluate() else { return false }
31 | guard collection.count > 0 else { return false }
32 | #if os(Linux)
33 | guard let collectionValue = collection.object(at: collection.count - 1) as? NSObject else {
34 | return false
35 | }
36 | #else
37 | let collectionValue = collection.object(at: collection.count - 1) as AnyObject
38 | #endif
39 |
40 | return collectionValue.isEqual(endingElement)
41 | }.requireNonNil
42 | }
43 |
44 | /// A Nimble matcher that succeeds when the actual string contains the expected substring
45 | /// where the expected substring's location is the actual string's length minus the
46 | /// expected substring's length.
47 | public func endWith(_ endingSubstring: String) -> Predicate {
48 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
49 | failureMessage.postfixMessage = "end with <\(endingSubstring)>"
50 | if let collection = try actualExpression.evaluate() {
51 | return collection.hasSuffix(endingSubstring)
52 | }
53 | return false
54 | }.requireNonNil
55 | }
56 |
57 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
58 | extension NMBObjCMatcher {
59 | @objc public class func endWithMatcher(_ expected: Any) -> NMBObjCMatcher {
60 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
61 | let actual = try! actualExpression.evaluate()
62 | if (actual as? String) != nil {
63 | let expr = actualExpression.cast { $0 as? String }
64 | return try! endWith(expected as! String).matches(expr, failureMessage: failureMessage)
65 | } else {
66 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection }
67 | return try! endWith(expected).matches(expr, failureMessage: failureMessage)
68 | }
69 | }
70 | }
71 | }
72 | #endif
73 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/HaveCount.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // The `haveCount` matchers do not print the full string representation of the collection value,
4 | // instead they only print the type name and the expected count. This makes it easier to understand
5 | // the reason for failed expectations. See: https://github.com/Quick/Nimble/issues/308.
6 | // The representation of the collection content is provided in a new line as an `extendedMessage`.
7 |
8 | /// A Nimble matcher that succeeds when the actual Collection's count equals
9 | /// the expected value
10 | public func haveCount(_ expectedValue: T.IndexDistance) -> Predicate {
11 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
12 | if let actualValue = try actualExpression.evaluate() {
13 | // swiftlint:disable:next line_length
14 | failureMessage.postfixMessage = "have \(prettyCollectionType(actualValue)) with count \(stringify(expectedValue))"
15 | let result = expectedValue == actualValue.count
16 | failureMessage.actualValue = "\(actualValue.count)"
17 | failureMessage.extendedMessage = "Actual Value: \(stringify(actualValue))"
18 | return result
19 | } else {
20 | return false
21 | }
22 | }.requireNonNil
23 | }
24 |
25 | /// A Nimble matcher that succeeds when the actual collection's count equals
26 | /// the expected value
27 | public func haveCount(_ expectedValue: Int) -> Predicate {
28 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
29 | if let actualValue = try actualExpression.evaluate() {
30 | // swiftlint:disable:next line_length
31 | failureMessage.postfixMessage = "have \(prettyCollectionType(actualValue)) with count \(stringify(expectedValue))"
32 | let result = expectedValue == actualValue.count
33 | failureMessage.actualValue = "\(actualValue.count)"
34 | failureMessage.extendedMessage = "Actual Value: \(stringify(actualValue))"
35 | return result
36 | } else {
37 | return false
38 | }
39 | }
40 | }
41 |
42 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
43 | extension NMBObjCMatcher {
44 | @objc public class func haveCountMatcher(_ expected: NSNumber) -> NMBObjCMatcher {
45 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
46 | let location = actualExpression.location
47 | let actualValue = try! actualExpression.evaluate()
48 | if let value = actualValue as? NMBCollection {
49 | let expr = Expression(expression: ({ value as NMBCollection}), location: location)
50 | return try! haveCount(expected.intValue).matches(expr, failureMessage: failureMessage)
51 | } else if let actualValue = actualValue {
52 | failureMessage.postfixMessage = "get type of NSArray, NSSet, NSDictionary, or NSHashTable"
53 | failureMessage.actualValue = "\(String(describing: type(of: actualValue)))"
54 | }
55 | return false
56 | }
57 | }
58 | }
59 | #endif
60 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/Match.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual string satisfies the regular expression
4 | /// described by the expected string.
5 | public func match(_ expectedValue: String?) -> Predicate {
6 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
7 | failureMessage.postfixMessage = "match <\(stringify(expectedValue))>"
8 |
9 | if let actual = try actualExpression.evaluate() {
10 | if let regexp = expectedValue {
11 | return actual.range(of: regexp, options: .regularExpression) != nil
12 | }
13 | }
14 |
15 | return false
16 | }.requireNonNil
17 | }
18 |
19 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
20 |
21 | extension NMBObjCMatcher {
22 | @objc public class func matchMatcher(_ expected: NSString) -> NMBMatcher {
23 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in
24 | let actual = actualExpression.cast { $0 as? String }
25 | return try! match(expected.description).matches(actual, failureMessage: failureMessage)
26 | }
27 | }
28 | }
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/MatchError.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual expression evaluates to an
4 | /// error from the specified case.
5 | ///
6 | /// Errors are tried to be compared by their implementation of Equatable,
7 | /// otherwise they fallback to comparison by _domain and _code.
8 | public func matchError(_ error: T) -> Predicate {
9 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
10 | let actualError: Error? = try actualExpression.evaluate()
11 |
12 | setFailureMessageForError(failureMessage, postfixMessageVerb: "match", actualError: actualError, error: error)
13 | var matches = false
14 | if let actualError = actualError, errorMatchesExpectedError(actualError, expectedError: error) {
15 | matches = true
16 | }
17 | return matches
18 | }.requireNonNil
19 | }
20 |
21 | /// A Nimble matcher that succeeds when the actual expression evaluates to an
22 | /// error from the specified case.
23 | ///
24 | /// Errors are tried to be compared by their implementation of Equatable,
25 | /// otherwise they fallback to comparision by _domain and _code.
26 | public func matchError(_ error: T) -> Predicate {
27 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
28 | let actualError: Error? = try actualExpression.evaluate()
29 |
30 | setFailureMessageForError(failureMessage, postfixMessageVerb: "match", actualError: actualError, error: error)
31 |
32 | var matches = false
33 | if let actualError = actualError as? T, error == actualError {
34 | matches = true
35 | }
36 | return matches
37 | }.requireNonNil
38 | }
39 |
40 | /// A Nimble matcher that succeeds when the actual expression evaluates to an
41 | /// error of the specified type
42 | public func matchError(_ errorType: T.Type) -> Predicate {
43 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
44 | let actualError: Error? = try actualExpression.evaluate()
45 |
46 | setFailureMessageForError(
47 | failureMessage,
48 | postfixMessageVerb: "match",
49 | actualError: actualError,
50 | errorType: errorType
51 | )
52 | var matches = false
53 | if actualError as? T != nil {
54 | matches = true
55 | }
56 | return matches
57 | }.requireNonNil
58 | }
59 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/PostNotification.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal class NotificationCollector {
4 | private(set) var observedNotifications: [Notification]
5 | private let notificationCenter: NotificationCenter
6 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
7 | private var token: AnyObject?
8 | #else
9 | private var token: NSObjectProtocol?
10 | #endif
11 |
12 | required init(notificationCenter: NotificationCenter) {
13 | self.notificationCenter = notificationCenter
14 | self.observedNotifications = []
15 | }
16 |
17 | func startObserving() {
18 | self.token = self.notificationCenter.addObserver(forName: nil, object: nil, queue: nil) { [weak self] n in
19 | // linux-swift gets confused by .append(n)
20 | self?.observedNotifications.append(n)
21 | }
22 | }
23 |
24 | deinit {
25 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
26 | if let token = self.token {
27 | self.notificationCenter.removeObserver(token)
28 | }
29 | #else
30 | if let token = self.token as? AnyObject {
31 | self.notificationCenter.removeObserver(token)
32 | }
33 | #endif
34 | }
35 | }
36 |
37 | private let mainThread = pthread_self()
38 |
39 | public func postNotifications(
40 | _ notificationsMatcher: T,
41 | fromNotificationCenter center: NotificationCenter = .default)
42 | -> Predicate
43 | where T: Matcher, T.ValueType == [Notification]
44 | {
45 | _ = mainThread // Force lazy-loading of this value
46 | let collector = NotificationCollector(notificationCenter: center)
47 | collector.startObserving()
48 | var once: Bool = false
49 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
50 | let collectorNotificationsExpression = Expression(memoizedExpression: { _ in
51 | return collector.observedNotifications
52 | }, location: actualExpression.location, withoutCaching: true)
53 |
54 | assert(pthread_equal(mainThread, pthread_self()) != 0, "Only expecting closure to be evaluated on main thread.")
55 | if !once {
56 | once = true
57 | _ = try actualExpression.evaluate()
58 | }
59 |
60 | let match = try notificationsMatcher.matches(collectorNotificationsExpression, failureMessage: failureMessage)
61 | if collector.observedNotifications.isEmpty {
62 | failureMessage.actualValue = "no notifications"
63 | } else {
64 | failureMessage.actualValue = "<\(stringify(collector.observedNotifications))>"
65 | }
66 | return match
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Matchers/ThrowAssertion.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | public func throwAssertion() -> Predicate {
4 | return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
5 | #if arch(x86_64) && (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE
6 | failureMessage.postfixMessage = "throw an assertion"
7 | failureMessage.actualValue = nil
8 |
9 | var succeeded = true
10 |
11 | let caughtException: BadInstructionException? = catchBadInstruction {
12 | #if os(tvOS)
13 | if !NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning {
14 | print()
15 | print("[Nimble Warning]: If you're getting stuck on a debugger breakpoint for a " +
16 | "fatal error while using throwAssertion(), please disable 'Debug Executable' " +
17 | "in your scheme. Go to 'Edit Scheme > Test > Info' and uncheck " +
18 | "'Debug Executable'. If you've already done that, suppress this warning " +
19 | "by setting `NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true`. " +
20 | "This is required because the standard methods of catching assertions " +
21 | "(mach APIs) are unavailable for tvOS. Instead, the same mechanism the " +
22 | "debugger uses is the fallback method for tvOS."
23 | )
24 | print()
25 | NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true
26 | }
27 | #endif
28 | do {
29 | try actualExpression.evaluate()
30 | } catch let error {
31 | succeeded = false
32 | failureMessage.postfixMessage += "; threw error instead <\(error)>"
33 | }
34 | }
35 |
36 | if !succeeded {
37 | return false
38 | }
39 |
40 | if caughtException == nil {
41 | return false
42 | }
43 |
44 | return true
45 | #elseif SWIFT_PACKAGE
46 | fatalError("The throwAssertion Nimble matcher does not currently support Swift CLI." +
47 | " You can silence this error by placing the test case inside an #if !SWIFT_PACKAGE" +
48 | " conditional statement")
49 | #else
50 | fatalError("The throwAssertion Nimble matcher can only run on x86_64 platforms with " +
51 | "Objective-C (e.g. Mac, iPhone 5s or later simulators). You can silence this error " +
52 | "by placing the test case inside an #if arch(x86_64) or (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) conditional statement")
53 | // swiftlint:disable:previous line_length
54 | #endif
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/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", "")
29 | )
30 | case .failed(let reason):
31 | return PredicateResult(
32 | bool: false,
33 | message: .expectedCustomValueTo("succeed", " because <\(reason)>")
34 | )
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Nimble.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "NMBExceptionCapture.h"
3 | #import "NMBStringify.h"
4 | #import "DSL.h"
5 |
6 | #import "CwlPreconditionTesting.h"
7 |
8 | FOUNDATION_EXPORT double NimbleVersionNumber;
9 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
10 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Utils/Errors.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // Generic
4 |
5 | internal func setFailureMessageForError(
6 | _ failureMessage: FailureMessage,
7 | postfixMessageVerb: String = "throw",
8 | actualError: Error?,
9 | error: T? = nil,
10 | errorType: T.Type? = nil,
11 | closure: ((T) -> Void)? = nil) {
12 | failureMessage.postfixMessage = "\(postfixMessageVerb) error"
13 |
14 | if let error = error {
15 | failureMessage.postfixMessage += " <\(error)>"
16 | } else if errorType != nil || closure != nil {
17 | failureMessage.postfixMessage += " from type <\(T.self)>"
18 | }
19 | if closure != nil {
20 | failureMessage.postfixMessage += " that satisfies block"
21 | }
22 | if error == nil && errorType == nil && closure == nil {
23 | failureMessage.postfixMessage = "\(postfixMessageVerb) any error"
24 | }
25 |
26 | if let actualError = actualError {
27 | failureMessage.actualValue = "<\(actualError)>"
28 | } else {
29 | failureMessage.actualValue = "no error"
30 | }
31 | }
32 |
33 | internal func errorMatchesExpectedError(
34 | _ actualError: Error,
35 | expectedError: T) -> Bool {
36 | return actualError._domain == expectedError._domain
37 | && actualError._code == expectedError._code
38 | }
39 |
40 | // Non-generic
41 |
42 | internal func setFailureMessageForError(
43 | _ failureMessage: FailureMessage,
44 | actualError: Error?,
45 | closure: ((Error) -> Void)?) {
46 | failureMessage.postfixMessage = "throw error"
47 |
48 | if closure != nil {
49 | failureMessage.postfixMessage += " that satisfies block"
50 | } else {
51 | failureMessage.postfixMessage = "throw any error"
52 | }
53 |
54 | if let actualError = actualError {
55 | failureMessage.actualValue = "<\(actualError)>"
56 | } else {
57 | failureMessage.actualValue = "no error"
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/Nimble/Utils/Functional.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | extension Sequence {
4 | internal func all(_ fn: (Iterator.Element) -> Bool) -> Bool {
5 | for item in self {
6 | if !fn(item) {
7 | return false
8 | }
9 | }
10 | return true
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/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/CurrentTestCaseTracker.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | SWIFT_CLASS("_TtC6Nimble22CurrentTestCaseTracker")
5 | @interface CurrentTestCaseTracker : NSObject
6 | + (CurrentTestCaseTracker *)sharedInstance;
7 | @end
8 |
9 | @interface CurrentTestCaseTracker (Register) @end
10 |
--------------------------------------------------------------------------------
/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:(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 | #import
3 |
4 | NSString *_Nonnull NMBStringify(id _Nullable anyObject) {
5 | return [NMBStringer stringify:anyObject];
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Nimble/Sources/NimbleObjectiveC/XCTestObservationCenter+Register.m:
--------------------------------------------------------------------------------
1 | #import "CurrentTestCaseTracker.h"
2 | #import
3 | #import
4 |
5 | #pragma mark - Method Swizzling
6 |
7 | /// Swaps the implementations between two instance methods.
8 | ///
9 | /// @param class The class containing `originalSelector`.
10 | /// @param originalSelector Original method to replace.
11 | /// @param replacementSelector Replacement method.
12 | void swizzleSelectors(Class class, SEL originalSelector, SEL replacementSelector) {
13 | Method originalMethod = class_getInstanceMethod(class, originalSelector);
14 | Method replacementMethod = class_getInstanceMethod(class, replacementSelector);
15 |
16 | BOOL didAddMethod =
17 | class_addMethod(class,
18 | originalSelector,
19 | method_getImplementation(replacementMethod),
20 | method_getTypeEncoding(replacementMethod));
21 |
22 | if (didAddMethod) {
23 | class_replaceMethod(class,
24 | replacementSelector,
25 | method_getImplementation(originalMethod),
26 | method_getTypeEncoding(originalMethod));
27 | } else {
28 | method_exchangeImplementations(originalMethod, replacementMethod);
29 | }
30 | }
31 |
32 | #pragma mark - Private
33 |
34 | @interface XCTestObservationCenter (Private)
35 | - (void)_addLegacyTestObserver:(id)observer;
36 | @end
37 |
38 | @implementation XCTestObservationCenter (Register)
39 |
40 | /// Uses objc method swizzling to register `CurrentTestCaseTracker` as a test observer. This is necessary
41 | /// because Xcode 7.3 introduced timing issues where if a custom `XCTestObservation` is registered too early
42 | /// it suppresses all console output (generated by `XCTestLog`), breaking any tools that depend on this output.
43 | /// This approach waits to register our custom test observer until XCTest adds its first "legacy" observer,
44 | /// falling back to registering after the first normal observer if this private method ever changes.
45 | + (void)load {
46 | if (class_getInstanceMethod([self class], @selector(_addLegacyTestObserver:))) {
47 | // Swizzle -_addLegacyTestObserver:
48 | swizzleSelectors([self class], @selector(_addLegacyTestObserver:), @selector(NMB_original__addLegacyTestObserver:));
49 | } else {
50 | // Swizzle -addTestObserver:, only if -_addLegacyTestObserver: is not implemented
51 | swizzleSelectors([self class], @selector(addTestObserver:), @selector(NMB_original_addTestObserver:));
52 | }
53 | }
54 |
55 | #pragma mark - Replacement Methods
56 |
57 | /// Registers `CurrentTestCaseTracker` as a test observer after `XCTestLog` has been added.
58 | - (void)NMB_original__addLegacyTestObserver:(id)observer {
59 | [self NMB_original__addLegacyTestObserver:observer];
60 |
61 | static dispatch_once_t onceToken;
62 | dispatch_once(&onceToken, ^{
63 | [self addTestObserver:[CurrentTestCaseTracker sharedInstance]];
64 | });
65 | }
66 |
67 | /// Registers `CurrentTestCaseTracker` as a test observer after `XCTestLog` has been added.
68 | /// This method is only used if `-_addLegacyTestObserver:` is not impelemented. (added in Xcode 7.3)
69 | - (void)NMB_original_addTestObserver:(id)observer {
70 | [self NMB_original_addTestObserver:observer];
71 |
72 | static dispatch_once_t onceToken;
73 | dispatch_once(&onceToken, ^{
74 | [self NMB_original_addTestObserver:[CurrentTestCaseTracker sharedInstance]];
75 | });
76 | }
77 |
78 | @end
79 |
--------------------------------------------------------------------------------
/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/StatusCodes.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
35 |
36 |
47 |
48 |
54 |
55 |
56 |
57 |
58 |
59 |
65 |
66 |
68 |
69 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/Quick/Behavior.swift:
--------------------------------------------------------------------------------
1 | /**
2 | A `Behavior` encapsulates a set of examples that can be re-used in several locations using the `itBehavesLike` function with a context instance of the generic type.
3 | */
4 |
5 | open class Behavior {
6 |
7 | open static var name: String { return String(describing: self) }
8 | /**
9 | override this method in your behavior to define a set of reusable examples.
10 |
11 | This behaves just like an example group defines using `describe` or `context`--it may contain any number of `beforeEach`
12 | and `afterEach` closures, as well as any number of examples (defined using `it`).
13 |
14 | - parameter aContext: A closure that, when evaluated, returns a `Context` instance that provide the information on the subject.
15 | */
16 | open class func spec(_ aContext: @escaping () -> Context) {}
17 | }
18 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/Quick/Callsite.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // `#if swift(>=3.2) && (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE`
4 | // does not work as expected.
5 | #if swift(>=3.2)
6 | #if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE
7 | @objcMembers
8 | public class _CallsiteBase: NSObject {}
9 | #else
10 | public class _CallsiteBase: NSObject {}
11 | #endif
12 | #else
13 | public class _CallsiteBase: NSObject {}
14 | #endif
15 |
16 | /**
17 | An object encapsulating the file and line number at which
18 | a particular example is defined.
19 | */
20 | final public class Callsite: _CallsiteBase {
21 | /**
22 | The absolute path of the file in which an example is defined.
23 | */
24 | public let file: String
25 |
26 | /**
27 | The line number on which an example is defined.
28 | */
29 | public let line: UInt
30 |
31 | internal init(file: String, line: UInt) {
32 | self.file = file
33 | self.line = line
34 | }
35 | }
36 |
37 | extension Callsite {
38 | /**
39 | Returns a boolean indicating whether two Callsite objects are equal.
40 | If two callsites are in the same file and on the same line, they must be equal.
41 | */
42 | @nonobjc public static func == (lhs: Callsite, rhs: Callsite) -> Bool {
43 | return lhs.file == rhs.file && lhs.line == rhs.line
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/Quick/ErrorUtility.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal func raiseError(_ message: String) -> Never {
4 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
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/ExampleGroup.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /**
4 | Example groups are logical groupings of examples, defined with
5 | the `describe` and `context` functions. Example groups can share
6 | setup and teardown code.
7 | */
8 | final public class ExampleGroup: NSObject {
9 | weak internal var parent: ExampleGroup?
10 | internal let hooks = ExampleHooks()
11 |
12 | internal var phase: HooksPhase = .nothingExecuted
13 |
14 | private let internalDescription: String
15 | private let flags: FilterFlags
16 | private let isInternalRootExampleGroup: Bool
17 | private var childGroups = [ExampleGroup]()
18 | private var childExamples = [Example]()
19 |
20 | internal init(description: String, flags: FilterFlags, isInternalRootExampleGroup: Bool = false) {
21 | self.internalDescription = description
22 | self.flags = flags
23 | self.isInternalRootExampleGroup = isInternalRootExampleGroup
24 | }
25 |
26 | public override var description: String {
27 | return internalDescription
28 | }
29 |
30 | /**
31 | Returns a list of examples that belong to this example group,
32 | or to any of its descendant example groups.
33 | */
34 | public var examples: [Example] {
35 | return childExamples + childGroups.flatMap { $0.examples }
36 | }
37 |
38 | internal var name: String? {
39 | guard let parent = parent else {
40 | return isInternalRootExampleGroup ? nil : description
41 | }
42 |
43 | guard let name = parent.name else { return description }
44 | return "\(name), \(description)"
45 | }
46 |
47 | internal var filterFlags: FilterFlags {
48 | var aggregateFlags = flags
49 | walkUp { group in
50 | for (key, value) in group.flags {
51 | aggregateFlags[key] = value
52 | }
53 | }
54 | return aggregateFlags
55 | }
56 |
57 | internal var befores: [BeforeExampleWithMetadataClosure] {
58 | var closures = Array(hooks.befores.reversed())
59 | walkUp { group in
60 | closures.append(contentsOf: Array(group.hooks.befores.reversed()))
61 | }
62 | return Array(closures.reversed())
63 | }
64 |
65 | internal var afters: [AfterExampleWithMetadataClosure] {
66 | var closures = hooks.afters
67 | walkUp { group in
68 | closures.append(contentsOf: group.hooks.afters)
69 | }
70 | return closures
71 | }
72 |
73 | internal func walkDownExamples(_ callback: (_ example: Example) -> Void) {
74 | for example in childExamples {
75 | callback(example)
76 | }
77 | for group in childGroups {
78 | group.walkDownExamples(callback)
79 | }
80 | }
81 |
82 | internal func appendExampleGroup(_ group: ExampleGroup) {
83 | group.parent = self
84 | childGroups.append(group)
85 | }
86 |
87 | internal func appendExample(_ example: Example) {
88 | example.group = self
89 | childExamples.append(example)
90 | }
91 |
92 | private func walkUp(_ callback: (_ group: ExampleGroup) -> Void) {
93 | var group = self
94 | while let parent = group.parent {
95 | callback(parent)
96 | group = parent
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/Quick/ExampleMetadata.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // `#if swift(>=3.2) && (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE`
4 | // does not work as expected.
5 | #if swift(>=3.2)
6 | #if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE
7 | @objcMembers
8 | public class _ExampleMetadataBase: NSObject {}
9 | #else
10 | public class _ExampleMetadataBase: NSObject {}
11 | #endif
12 | #else
13 | public class _ExampleMetadataBase: NSObject {}
14 | #endif
15 |
16 | /**
17 | A class that encapsulates information about an example,
18 | including the index at which the example was executed, as
19 | well as the example itself.
20 | */
21 | final public class ExampleMetadata: _ExampleMetadataBase {
22 | /**
23 | The example for which this metadata was collected.
24 | */
25 | public let example: Example
26 |
27 | /**
28 | The index at which this example was executed in the
29 | test suite.
30 | */
31 | public let exampleIndex: Int
32 |
33 | internal init(example: Example, exampleIndex: Int) {
34 | self.example = example
35 | self.exampleIndex = exampleIndex
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/Quick/Filter.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // `#if swift(>=3.2) && (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE`
4 | // does not work as expected.
5 | #if swift(>=3.2)
6 | #if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE
7 | @objcMembers
8 | public class _FilterBase: NSObject {}
9 | #else
10 | public class _FilterBase: NSObject {}
11 | #endif
12 | #else
13 | public class _FilterBase: NSObject {}
14 | #endif
15 |
16 | /**
17 | A mapping of string keys to booleans that can be used to
18 | filter examples or example groups. For example, a "focused"
19 | example would have the flags [Focused: true].
20 | */
21 | public typealias FilterFlags = [String: Bool]
22 |
23 | /**
24 | A namespace for filter flag keys, defined primarily to make the
25 | keys available in Objective-C.
26 | */
27 | final public class Filter: _FilterBase {
28 | /**
29 | Example and example groups with [Focused: true] are included in test runs,
30 | excluding all other examples without this flag. Use this to only run one or
31 | two tests that you're currently focusing on.
32 | */
33 | public class var focused: String {
34 | return "focused"
35 | }
36 |
37 | /**
38 | Example and example groups with [Pending: true] are excluded from test runs.
39 | Use this to temporarily suspend examples that you know do not pass yet.
40 | */
41 | public class var pending: String {
42 | return "pending"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/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 os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
2 |
3 | import Foundation
4 |
5 | extension Bundle {
6 |
7 | /**
8 | Locates the first bundle with a '.xctest' file extension.
9 | */
10 | internal static var currentTestBundle: Bundle? {
11 | return allBundles.first { $0.bundlePath.hasSuffix(".xctest") }
12 | }
13 |
14 | /**
15 | 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 as NSString
21 | return fileName.c99ExtendedIdentifier
22 | }
23 | }
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/Quick/NSString+C99ExtendedIdentifier.swift:
--------------------------------------------------------------------------------
1 | #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
2 | import Foundation
3 |
4 | public extension NSString {
5 |
6 | private static var invalidCharacters: CharacterSet = {
7 | var invalidCharacters = CharacterSet()
8 |
9 | let invalidCharacterSets: [CharacterSet] = [
10 | .whitespacesAndNewlines,
11 | .illegalCharacters,
12 | .controlCharacters,
13 | .punctuationCharacters,
14 | .nonBaseCharacters,
15 | .symbols
16 | ]
17 |
18 | for invalidSet in invalidCharacterSets {
19 | invalidCharacters.formUnion(invalidSet)
20 | }
21 |
22 | return invalidCharacters
23 | }()
24 |
25 | @objc(qck_c99ExtendedIdentifier)
26 | var c99ExtendedIdentifier: String {
27 | let validComponents = components(separatedBy: NSString.invalidCharacters)
28 | let result = validComponents.joined(separator: "_")
29 |
30 | return result.isEmpty ? "_" : result
31 | }
32 | }
33 | #endif
34 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift:
--------------------------------------------------------------------------------
1 | #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
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/QuickTestSuite.swift:
--------------------------------------------------------------------------------
1 | #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
2 |
3 | import XCTest
4 |
5 | /**
6 | This protocol defines the role of an object that builds test suites.
7 | */
8 | internal protocol QuickTestSuiteBuilder {
9 |
10 | /**
11 | Construct a `QuickTestSuite` instance with the appropriate test cases added as tests.
12 |
13 | Subsequent calls to this method should return equivalent test suites.
14 | */
15 | func buildTestSuite() -> QuickTestSuite
16 |
17 | }
18 |
19 | /**
20 | A base class for a class cluster of Quick test suites, that should correctly
21 | build dynamic test suites for XCTest to execute.
22 | */
23 | public class QuickTestSuite: XCTestSuite {
24 |
25 | private static var builtTestSuites: Set = Set()
26 |
27 | /**
28 | Construct a test suite for a specific, selected subset of test cases (rather
29 | than the default, which as all test cases).
30 |
31 | If this method is called multiple times for the same test case class, e.g..
32 |
33 | FooSpec/testFoo
34 | FooSpec/testBar
35 |
36 | It is expected that the first call should return a valid test suite, and
37 | all subsequent calls should return `nil`.
38 | */
39 | @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/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/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 "World.h"
3 | #import
4 |
5 | typedef void (^QCKClassEnumerationBlock)(Class klass);
6 |
7 | /**
8 | Finds all direct subclasses of the given class and passes them to the block provided.
9 | The classes are iterated over in the order that objc_getClassList returns them.
10 |
11 | @param klass The base class to find subclasses of.
12 | @param block A block that takes a Class. This block will be executed once for each subclass of klass.
13 | */
14 | void qck_enumerateSubclasses(Class klass, QCKClassEnumerationBlock block) {
15 | Class *classes = NULL;
16 | int classesCount = objc_getClassList(NULL, 0);
17 |
18 | if (classesCount > 0) {
19 | classes = (Class *)calloc(sizeof(Class), classesCount);
20 | classesCount = objc_getClassList(classes, classesCount);
21 |
22 | Class subclass, superclass;
23 | for(int i = 0; i < classesCount; i++) {
24 | subclass = classes[i];
25 | superclass = class_getSuperclass(subclass);
26 | if (superclass == klass && block) {
27 | block(subclass);
28 | }
29 | }
30 |
31 | free(classes);
32 | }
33 | }
34 |
35 | @implementation QuickConfiguration
36 |
37 | #pragma mark - Object Lifecycle
38 |
39 | /**
40 | QuickConfiguration is not meant to be instantiated; it merely provides a hook
41 | for users to configure how Quick behaves. Raise an exception if an instance of
42 | QuickConfiguration is created.
43 | */
44 | - (instancetype)init {
45 | NSString *className = NSStringFromClass([self class]);
46 | NSString *selectorName = NSStringFromSelector(@selector(configure:));
47 | [NSException raise:NSInternalInconsistencyException
48 | format:@"%@ is not meant to be instantiated; "
49 | @"subclass %@ and override %@ to configure Quick.",
50 | className, className, selectorName];
51 | return nil;
52 | }
53 |
54 | #pragma mark - NSObject Overrides
55 |
56 | /**
57 | Hook into when QuickConfiguration is initialized in the runtime in order to
58 | call +[QuickConfiguration configure:] on each of its subclasses.
59 | */
60 | + (void)initialize {
61 | // Only enumerate over the subclasses of QuickConfiguration, not any of its subclasses.
62 | if ([self class] == [QuickConfiguration class]) {
63 |
64 | // Only enumerate over subclasses once, even if +[QuickConfiguration initialize]
65 | // were to be called several times. This is necessary because +[QuickSpec initialize]
66 | // manually calls +[QuickConfiguration initialize].
67 | static dispatch_once_t onceToken;
68 | dispatch_once(&onceToken, ^{
69 | qck_enumerateSubclasses([QuickConfiguration class], ^(__unsafe_unretained Class klass) {
70 | [[World sharedWorld] configure:^(Configuration *configuration) {
71 | [klass configure:configuration];
72 | }];
73 | });
74 | [[World sharedWorld] finalizeConfiguration];
75 | });
76 | }
77 | }
78 |
79 | #pragma mark - Public Interface
80 |
81 | + (void)configure:(Configuration *)configuration { }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/QuickObjectiveC/DSL/QCKDSL.m:
--------------------------------------------------------------------------------
1 | #import "QCKDSL.h"
2 | #import "World.h"
3 | #import "World+DSL.h"
4 |
5 | void qck_beforeSuite(QCKDSLEmptyBlock closure) {
6 | [[World sharedWorld] beforeSuite:closure];
7 | }
8 |
9 | void qck_afterSuite(QCKDSLEmptyBlock closure) {
10 | [[World sharedWorld] afterSuite:closure];
11 | }
12 |
13 | void qck_sharedExamples(NSString *name, QCKDSLSharedExampleBlock closure) {
14 | [[World sharedWorld] sharedExamples:name closure:closure];
15 | }
16 |
17 | void qck_describe(NSString *description, QCKDSLEmptyBlock closure) {
18 | [[World sharedWorld] describe:description flags:@{} closure:closure];
19 | }
20 |
21 | void qck_context(NSString *description, QCKDSLEmptyBlock closure) {
22 | qck_describe(description, closure);
23 | }
24 |
25 | void qck_beforeEach(QCKDSLEmptyBlock closure) {
26 | [[World sharedWorld] beforeEach:closure];
27 | }
28 |
29 | void qck_beforeEachWithMetadata(QCKDSLExampleMetadataBlock closure) {
30 | [[World sharedWorld] beforeEachWithMetadata:closure];
31 | }
32 |
33 | void qck_afterEach(QCKDSLEmptyBlock closure) {
34 | [[World sharedWorld] afterEach:closure];
35 | }
36 |
37 | void qck_afterEachWithMetadata(QCKDSLExampleMetadataBlock closure) {
38 | [[World sharedWorld] afterEachWithMetadata:closure];
39 | }
40 |
41 | QCKItBlock qck_it_builder(NSDictionary *flags, NSString *file, NSUInteger line) {
42 | return ^(NSString *description, QCKDSLEmptyBlock closure) {
43 | [[World sharedWorld] itWithDescription:description
44 | flags:flags
45 | file:file
46 | line:line
47 | closure:closure];
48 | };
49 | }
50 |
51 | QCKItBehavesLikeBlock qck_itBehavesLike_builder(NSDictionary *flags, NSString *file, NSUInteger line) {
52 | return ^(NSString *name, QCKDSLSharedExampleContext context) {
53 | [[World sharedWorld] itBehavesLikeSharedExampleNamed:name
54 | sharedExampleContext:context
55 | flags:flags
56 | file:file
57 | line:line];
58 | };
59 | }
60 |
61 | void qck_pending(NSString *description, QCKDSLEmptyBlock closure) {
62 | [[World sharedWorld] pending:description closure:closure];
63 | }
64 |
65 | void qck_xdescribe(NSString *description, QCKDSLEmptyBlock closure) {
66 | [[World sharedWorld] xdescribe:description flags:@{} closure:closure];
67 | }
68 |
69 | void qck_xcontext(NSString *description, QCKDSLEmptyBlock closure) {
70 | qck_xdescribe(description, closure);
71 | }
72 |
73 | void qck_fdescribe(NSString *description, QCKDSLEmptyBlock closure) {
74 | [[World sharedWorld] fdescribe:description flags:@{} closure:closure];
75 | }
76 |
77 | void qck_fcontext(NSString *description, QCKDSLEmptyBlock closure) {
78 | qck_fdescribe(description, closure);
79 | }
80 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/QuickObjectiveC/DSL/World+DSL.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface World (SWIFT_EXTENSION(Quick))
4 | - (void)beforeSuite:(void (^ __nonnull)(void))closure;
5 | - (void)afterSuite:(void (^ __nonnull)(void))closure;
6 | - (void)sharedExamples:(NSString * __nonnull)name closure:(void (^ __nonnull)(NSDictionary * __nonnull (^ __nonnull)(void)))closure;
7 | - (void)describe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure;
8 | - (void)context:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure;
9 | - (void)fdescribe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure;
10 | - (void)xdescribe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure;
11 | - (void)beforeEach:(void (^ __nonnull)(void))closure;
12 | - (void)beforeEachWithMetadata:(void (^ __nonnull)(ExampleMetadata * __nonnull))closure;
13 | - (void)afterEach:(void (^ __nonnull)(void))closure;
14 | - (void)afterEachWithMetadata:(void (^ __nonnull)(ExampleMetadata * __nonnull))closure;
15 | - (void)itWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure;
16 | - (void)fitWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure;
17 | - (void)xitWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure;
18 | - (void)itBehavesLikeSharedExampleNamed:(NSString * __nonnull)name sharedExampleContext:(NSDictionary * __nonnull (^ __nonnull)(void))sharedExampleContext flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line;
19 | - (void)pending:(NSString * __nonnull)description closure:(void (^ __nonnull)(void))closure;
20 | @end
21 |
--------------------------------------------------------------------------------
/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 | @end
51 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/QuickObjectiveC/World.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @class ExampleGroup;
4 | @class ExampleMetadata;
5 |
6 | SWIFT_CLASS("_TtC5Quick5World")
7 | @interface World
8 |
9 | @property (nonatomic) ExampleGroup * __nullable currentExampleGroup;
10 | @property (nonatomic) ExampleMetadata * __nullable currentExampleMetadata;
11 | @property (nonatomic) BOOL isRunningAdditionalSuites;
12 | + (World * __nonnull)sharedWorld;
13 | - (void)configure:(void (^ __nonnull)(Configuration * __nonnull))closure;
14 | - (void)finalizeConfiguration;
15 | - (ExampleGroup * __nonnull)rootExampleGroupForSpecClass:(Class __nonnull)cls;
16 | - (NSArray * __nonnull)examplesForSpecClass:(Class __nonnull)specClass;
17 | - (void)performWithCurrentExampleGroup:(ExampleGroup * __nonnull)group closure:(void (^ __nonnull)(void))closure;
18 | @end
19 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import
4 |
5 | @interface XCTestSuite (QuickTestSuiteBuilder)
6 | @end
7 |
8 | @implementation XCTestSuite (QuickTestSuiteBuilder)
9 |
10 | /**
11 | In order to ensure we can correctly build dynamic test suites, we need to
12 | replace some of the default test suite constructors.
13 | */
14 | + (void)load {
15 | Method testCaseWithName = class_getClassMethod(self, @selector(testSuiteForTestCaseWithName:));
16 | Method hooked_testCaseWithName = class_getClassMethod(self, @selector(qck_hooked_testSuiteForTestCaseWithName:));
17 | method_exchangeImplementations(testCaseWithName, hooked_testCaseWithName);
18 | }
19 |
20 | /**
21 | The `+testSuiteForTestCaseWithName:` method is called when a specific test case
22 | class is run from the Xcode test navigator. If the built test suite is `nil`,
23 | Xcode will not run any tests for that test case.
24 |
25 | Given if the following test case class is run from the Xcode test navigator:
26 |
27 | FooSpec
28 | testFoo
29 | testBar
30 |
31 | XCTest will invoke this once per test case, with test case names following this format:
32 |
33 | FooSpec/testFoo
34 | FooSpec/testBar
35 | */
36 | + (nullable instancetype)qck_hooked_testSuiteForTestCaseWithName:(nonnull NSString *)name {
37 | return [QuickTestSuite selectedTestSuiteForTestCaseWithName:name];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/QuickSpecBase/QuickSpecBase.m:
--------------------------------------------------------------------------------
1 | #import "QuickSpecBase.h"
2 |
3 | #pragma mark - _QuickSelectorWrapper
4 |
5 | @interface _QuickSelectorWrapper ()
6 | @property(nonatomic, assign) SEL selector;
7 | @end
8 |
9 | @implementation _QuickSelectorWrapper
10 |
11 | - (instancetype)initWithSelector:(SEL)selector {
12 | self = [super init];
13 | _selector = selector;
14 | return self;
15 | }
16 |
17 | @end
18 |
19 |
20 | #pragma mark - _QuickSpecBase
21 |
22 | @implementation _QuickSpecBase
23 |
24 | - (instancetype)init {
25 | self = [super initWithInvocation: nil];
26 | return self;
27 | }
28 |
29 | /**
30 | Invocations for each test method in the test case. QuickSpec overrides this method to define a
31 | new method for each example defined in +[QuickSpec spec].
32 |
33 | @return An array of invocations that execute the newly defined example methods.
34 | */
35 | + (NSArray *)testInvocations {
36 | NSArray<_QuickSelectorWrapper *> *wrappers = [self _qck_testMethodSelectors];
37 | NSMutableArray *invocations = [NSMutableArray arrayWithCapacity:wrappers.count];
38 |
39 | for (_QuickSelectorWrapper *wrapper in wrappers) {
40 | SEL selector = wrapper.selector;
41 | NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector];
42 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
43 | invocation.selector = selector;
44 |
45 | [invocations addObject:invocation];
46 | }
47 |
48 | return invocations;
49 | }
50 |
51 | + (NSArray<_QuickSelectorWrapper *> *)_qck_testMethodSelectors {
52 | return @[];
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/Example/Pods/Quick/Sources/QuickSpecBase/include/QuickSpecBase.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface _QuickSelectorWrapper : NSObject
5 | - (instancetype)initWithSelector:(SEL)selector;
6 | @end
7 |
8 | @interface _QuickSpecBase : XCTestCase
9 | + (NSArray<_QuickSelectorWrapper *> *)_qck_testMethodSelectors;
10 | - (instancetype)init NS_DESIGNATED_INITIALIZER;
11 | @end
12 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
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 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintConfig.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | public typealias ConstraintInterfaceLayoutDirection = UIUserInterfaceLayoutDirection
27 | #else
28 | import AppKit
29 | public typealias ConstraintInterfaceLayoutDirection = NSUserInterfaceLayoutDirection
30 | #endif
31 |
32 |
33 | public struct ConstraintConfig {
34 |
35 | public static var interfaceLayoutDirection: ConstraintInterfaceLayoutDirection = .leftToRight
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintDescription.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintDescription {
32 |
33 | internal let item: LayoutConstraintItem
34 | internal var attributes: ConstraintAttributes
35 | internal var relation: ConstraintRelation? = nil
36 | internal var sourceLocation: (String, UInt)? = nil
37 | internal var label: String? = nil
38 | internal var related: ConstraintItem? = nil
39 | internal var multiplier: ConstraintMultiplierTarget = 1.0
40 | internal var constant: ConstraintConstantTarget = 0.0
41 | internal var priority: ConstraintPriorityTarget = 1000.0
42 | internal lazy var constraint: Constraint? = {
43 | guard let relation = self.relation,
44 | let related = self.related,
45 | let sourceLocation = self.sourceLocation else {
46 | return nil
47 | }
48 | let from = ConstraintItem(target: self.item, attributes: self.attributes)
49 |
50 | return Constraint(
51 | from: from,
52 | to: related,
53 | relation: relation,
54 | sourceLocation: sourceLocation,
55 | label: self.label,
56 | multiplier: self.multiplier,
57 | constant: self.constant,
58 | priority: self.priority
59 | )
60 | }()
61 |
62 | // MARK: Initialization
63 |
64 | internal init(item: LayoutConstraintItem, attributes: ConstraintAttributes) {
65 | self.item = item
66 | self.attributes = attributes
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintInsetTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintInsetTarget: ConstraintConstantTarget {
32 | }
33 |
34 | extension Int: ConstraintInsetTarget {
35 | }
36 |
37 | extension UInt: ConstraintInsetTarget {
38 | }
39 |
40 | extension Float: ConstraintInsetTarget {
41 | }
42 |
43 | extension Double: ConstraintInsetTarget {
44 | }
45 |
46 | extension CGFloat: ConstraintInsetTarget {
47 | }
48 |
49 | extension ConstraintInsets: ConstraintInsetTarget {
50 | }
51 |
52 | extension ConstraintInsetTarget {
53 |
54 | internal var constraintInsetTargetValue: ConstraintInsets {
55 | if let amount = self as? ConstraintInsets {
56 | return amount
57 | } else if let amount = self as? Float {
58 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
59 | } else if let amount = self as? Double {
60 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
61 | } else if let amount = self as? CGFloat {
62 | return ConstraintInsets(top: amount, left: amount, bottom: amount, right: amount)
63 | } else if let amount = self as? Int {
64 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
65 | } else if let amount = self as? UInt {
66 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
67 | } else {
68 | return ConstraintInsets(top: 0, left: 0, bottom: 0, right: 0)
69 | }
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintInsets.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | public typealias ConstraintInsets = UIEdgeInsets
33 | #else
34 | public typealias ConstraintInsets = NSEdgeInsets
35 | #endif
36 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public final class ConstraintItem {
32 |
33 | internal weak var target: AnyObject?
34 | internal let attributes: ConstraintAttributes
35 |
36 | internal init(target: AnyObject?, attributes: ConstraintAttributes) {
37 | self.target = target
38 | self.attributes = attributes
39 | }
40 |
41 | internal var layoutConstraintItem: LayoutConstraintItem? {
42 | return self.target as? LayoutConstraintItem
43 | }
44 |
45 | }
46 |
47 | public func ==(lhs: ConstraintItem, rhs: ConstraintItem) -> Bool {
48 | // pointer equality
49 | guard lhs !== rhs else {
50 | return true
51 | }
52 |
53 | // must both have valid targets and identical attributes
54 | guard let target1 = lhs.target,
55 | let target2 = rhs.target,
56 | target1 === target2 && lhs.attributes == rhs.attributes else {
57 | return false
58 | }
59 |
60 | return true
61 | }
62 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #endif
27 |
28 |
29 | @available(iOS 9.0, OSX 10.11, *)
30 | public extension ConstraintLayoutGuide {
31 |
32 | public var snp: ConstraintLayoutGuideDSL {
33 | return ConstraintLayoutGuideDSL(guide: self)
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutGuide.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | @available(iOS 9.0, *)
33 | public typealias ConstraintLayoutGuide = UILayoutGuide
34 | #else
35 | @available(OSX 10.11, *)
36 | public typealias ConstraintLayoutGuide = NSLayoutGuide
37 | #endif
38 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | @available(iOS 9.0, OSX 10.11, *)
32 | public struct ConstraintLayoutGuideDSL: ConstraintAttributesDSL {
33 |
34 | @discardableResult
35 | public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] {
36 | return ConstraintMaker.prepareConstraints(item: self.guide, closure: closure)
37 | }
38 |
39 | public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
40 | ConstraintMaker.makeConstraints(item: self.guide, closure: closure)
41 | }
42 |
43 | public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
44 | ConstraintMaker.remakeConstraints(item: self.guide, closure: closure)
45 | }
46 |
47 | public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
48 | ConstraintMaker.updateConstraints(item: self.guide, closure: closure)
49 | }
50 |
51 | public func removeConstraints() {
52 | ConstraintMaker.removeConstraints(item: self.guide)
53 | }
54 |
55 | public var target: AnyObject? {
56 | return self.guide
57 | }
58 |
59 | internal let guide: ConstraintLayoutGuide
60 |
61 | internal init(guide: ConstraintLayoutGuide) {
62 | self.guide = guide
63 |
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutSupport.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | @available(iOS 8.0, *)
33 | public typealias ConstraintLayoutSupport = UILayoutSupport
34 | #else
35 | public class ConstraintLayoutSupport {}
36 | #endif
37 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | @available(iOS 8.0, *)
32 | public struct ConstraintLayoutSupportDSL: ConstraintDSL {
33 |
34 | public var target: AnyObject? {
35 | return self.support
36 | }
37 |
38 | internal let support: ConstraintLayoutSupport
39 |
40 | internal init(support: ConstraintLayoutSupport) {
41 | self.support = support
42 |
43 | }
44 |
45 | public var top: ConstraintItem {
46 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top)
47 | }
48 |
49 | public var bottom: ConstraintItem {
50 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom)
51 | }
52 |
53 | public var height: ConstraintItem {
54 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height)
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMakerEditable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerEditable: ConstraintMakerPriortizable {
32 |
33 | @discardableResult
34 | public func multipliedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable {
35 | self.description.multiplier = amount
36 | return self
37 | }
38 |
39 | @discardableResult
40 | public func dividedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable {
41 | return self.multipliedBy(1.0 / amount.constraintMultiplierTargetValue)
42 | }
43 |
44 | @discardableResult
45 | public func offset(_ amount: ConstraintOffsetTarget) -> ConstraintMakerEditable {
46 | self.description.constant = amount.constraintOffsetTargetValue
47 | return self
48 | }
49 |
50 | @discardableResult
51 | public func inset(_ amount: ConstraintInsetTarget) -> ConstraintMakerEditable {
52 | self.description.constant = amount.constraintInsetTargetValue
53 | return self
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerFinalizable {
32 |
33 | internal let description: ConstraintDescription
34 |
35 | internal init(_ description: ConstraintDescription) {
36 | self.description = description
37 | }
38 |
39 | @discardableResult
40 | public func labeled(_ label: String) -> ConstraintMakerFinalizable {
41 | self.description.label = label
42 | return self
43 | }
44 |
45 | public var constraint: Constraint {
46 | return self.description.constraint!
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerPriortizable: ConstraintMakerFinalizable {
32 |
33 | @discardableResult
34 | public func priority(_ amount: ConstraintPriority) -> ConstraintMakerFinalizable {
35 | self.description.priority = amount.value
36 | return self
37 | }
38 |
39 | @discardableResult
40 | public func priority(_ amount: ConstraintPriorityTarget) -> ConstraintMakerFinalizable {
41 | self.description.priority = amount
42 | return self
43 | }
44 |
45 | @available(*, deprecated:3.0, message:"Use priority(.required) instead.")
46 | @discardableResult
47 | public func priorityRequired() -> ConstraintMakerFinalizable {
48 | return self.priority(.required)
49 | }
50 |
51 | @available(*, deprecated:3.0, message:"Use priority(.high) instead.")
52 | @discardableResult
53 | public func priorityHigh() -> ConstraintMakerFinalizable {
54 | return self.priority(.high)
55 | }
56 |
57 | @available(*, deprecated:3.0, message:"Use priority(.medium) instead.")
58 | @discardableResult
59 | public func priorityMedium() -> ConstraintMakerFinalizable {
60 | return self.priority(.medium)
61 | }
62 |
63 | @available(*, deprecated:3.0, message:"Use priority(.low) instead.")
64 | @discardableResult
65 | public func priorityLow() -> ConstraintMakerFinalizable {
66 | return self.priority(.low)
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintMultiplierTarget {
32 |
33 | var constraintMultiplierTargetValue: CGFloat { get }
34 |
35 | }
36 |
37 | extension Int: ConstraintMultiplierTarget {
38 |
39 | public var constraintMultiplierTargetValue: CGFloat {
40 | return CGFloat(self)
41 | }
42 |
43 | }
44 |
45 | extension UInt: ConstraintMultiplierTarget {
46 |
47 | public var constraintMultiplierTargetValue: CGFloat {
48 | return CGFloat(self)
49 | }
50 |
51 | }
52 |
53 | extension Float: ConstraintMultiplierTarget {
54 |
55 | public var constraintMultiplierTargetValue: CGFloat {
56 | return CGFloat(self)
57 | }
58 |
59 | }
60 |
61 | extension Double: ConstraintMultiplierTarget {
62 |
63 | public var constraintMultiplierTargetValue: CGFloat {
64 | return CGFloat(self)
65 | }
66 |
67 | }
68 |
69 | extension CGFloat: ConstraintMultiplierTarget {
70 |
71 | public var constraintMultiplierTargetValue: CGFloat {
72 | return self
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintOffsetTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintOffsetTarget: ConstraintConstantTarget {
32 | }
33 |
34 | extension Int: ConstraintOffsetTarget {
35 | }
36 |
37 | extension UInt: ConstraintOffsetTarget {
38 | }
39 |
40 | extension Float: ConstraintOffsetTarget {
41 | }
42 |
43 | extension Double: ConstraintOffsetTarget {
44 | }
45 |
46 | extension CGFloat: ConstraintOffsetTarget {
47 | }
48 |
49 | extension ConstraintOffsetTarget {
50 |
51 | internal var constraintOffsetTargetValue: CGFloat {
52 | let offset: CGFloat
53 | if let amount = self as? Float {
54 | offset = CGFloat(amount)
55 | } else if let amount = self as? Double {
56 | offset = CGFloat(amount)
57 | } else if let amount = self as? CGFloat {
58 | offset = CGFloat(amount)
59 | } else if let amount = self as? Int {
60 | offset = CGFloat(amount)
61 | } else if let amount = self as? UInt {
62 | offset = CGFloat(amount)
63 | } else {
64 | offset = 0.0
65 | }
66 | return offset
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintPriority.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 | public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable, Strideable {
31 | public typealias FloatLiteralType = Float
32 |
33 | public let value: Float
34 |
35 | public init(floatLiteral value: Float) {
36 | self.value = value
37 | }
38 |
39 | public init(_ value: Float) {
40 | self.value = value
41 | }
42 |
43 | public static var required: ConstraintPriority {
44 | return 1000.0
45 | }
46 |
47 | public static var high: ConstraintPriority {
48 | return 750.0
49 | }
50 |
51 | public static var medium: ConstraintPriority {
52 | #if os(OSX)
53 | return 501.0
54 | #else
55 | return 500.0
56 | #endif
57 |
58 | }
59 |
60 | public static var low: ConstraintPriority {
61 | return 250.0
62 | }
63 |
64 | public static func ==(lhs: ConstraintPriority, rhs: ConstraintPriority) -> Bool {
65 | return lhs.value == rhs.value
66 | }
67 |
68 | // MARK: Strideable
69 |
70 | public func advanced(by n: FloatLiteralType) -> ConstraintPriority {
71 | return ConstraintPriority(floatLiteral: value + n)
72 | }
73 |
74 | public func distance(to other: ConstraintPriority) -> FloatLiteralType {
75 | return other.value - value
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintPriorityTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintPriorityTarget {
32 |
33 | var constraintPriorityTargetValue: Float { get }
34 |
35 | }
36 |
37 | extension Int: ConstraintPriorityTarget {
38 |
39 | public var constraintPriorityTargetValue: Float {
40 | return Float(self)
41 | }
42 |
43 | }
44 |
45 | extension UInt: ConstraintPriorityTarget {
46 |
47 | public var constraintPriorityTargetValue: Float {
48 | return Float(self)
49 | }
50 |
51 | }
52 |
53 | extension Float: ConstraintPriorityTarget {
54 |
55 | public var constraintPriorityTargetValue: Float {
56 | return self
57 | }
58 |
59 | }
60 |
61 | extension Double: ConstraintPriorityTarget {
62 |
63 | public var constraintPriorityTargetValue: Float {
64 | return Float(self)
65 | }
66 |
67 | }
68 |
69 | extension CGFloat: ConstraintPriorityTarget {
70 |
71 | public var constraintPriorityTargetValue: Float {
72 | return Float(self)
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintRelatableTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintRelatableTarget {
32 | }
33 |
34 | extension Int: ConstraintRelatableTarget {
35 | }
36 |
37 | extension UInt: ConstraintRelatableTarget {
38 | }
39 |
40 | extension Float: ConstraintRelatableTarget {
41 | }
42 |
43 | extension Double: ConstraintRelatableTarget {
44 | }
45 |
46 | extension CGFloat: ConstraintRelatableTarget {
47 | }
48 |
49 | extension CGSize: ConstraintRelatableTarget {
50 | }
51 |
52 | extension CGPoint: ConstraintRelatableTarget {
53 | }
54 |
55 | extension ConstraintInsets: ConstraintRelatableTarget {
56 | }
57 |
58 | extension ConstraintItem: ConstraintRelatableTarget {
59 | }
60 |
61 | extension ConstraintView: ConstraintRelatableTarget {
62 | }
63 |
64 | @available(iOS 9.0, OSX 10.11, *)
65 | extension ConstraintLayoutGuide: ConstraintRelatableTarget {
66 | }
67 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintRelation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | internal enum ConstraintRelation : Int {
32 | case equal = 1
33 | case lessThanOrEqual
34 | case greaterThanOrEqual
35 |
36 | internal var layoutRelation: LayoutRelation {
37 | get {
38 | switch(self) {
39 | case .equal:
40 | return .equal
41 | case .lessThanOrEqual:
42 | return .lessThanOrEqual
43 | case .greaterThanOrEqual:
44 | return .greaterThanOrEqual
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | public typealias ConstraintView = UIView
33 | #else
34 | public typealias ConstraintView = NSView
35 | #endif
36 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/LayoutConstraint.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class LayoutConstraint : NSLayoutConstraint {
32 |
33 | public var label: String? {
34 | get {
35 | return self.identifier
36 | }
37 | set {
38 | self.identifier = newValue
39 | }
40 | }
41 |
42 | internal weak var constraint: Constraint? = nil
43 |
44 | }
45 |
46 | internal func ==(lhs: LayoutConstraint, rhs: LayoutConstraint) -> Bool {
47 | guard lhs.firstItem === rhs.firstItem &&
48 | lhs.secondItem === rhs.secondItem &&
49 | lhs.firstAttribute == rhs.firstAttribute &&
50 | lhs.secondAttribute == rhs.secondAttribute &&
51 | lhs.relation == rhs.relation &&
52 | lhs.priority == rhs.priority &&
53 | lhs.multiplier == rhs.multiplier else {
54 | return false
55 | }
56 | return true
57 | }
58 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/LayoutConstraintItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol LayoutConstraintItem: class {
32 | }
33 |
34 | @available(iOS 9.0, OSX 10.11, *)
35 | extension ConstraintLayoutGuide : LayoutConstraintItem {
36 | }
37 |
38 | extension ConstraintView : LayoutConstraintItem {
39 | }
40 |
41 |
42 | extension LayoutConstraintItem {
43 |
44 | internal func prepare() {
45 | if let view = self as? ConstraintView {
46 | view.translatesAutoresizingMaskIntoConstraints = false
47 | }
48 | }
49 |
50 | internal var superview: ConstraintView? {
51 | if let view = self as? ConstraintView {
52 | return view.superview
53 | }
54 |
55 | if #available(iOS 9.0, OSX 10.11, *), let guide = self as? ConstraintLayoutGuide {
56 | return guide.owningView
57 | }
58 |
59 | return nil
60 | }
61 | internal var constraints: [Constraint] {
62 | return self.constraintsSet.allObjects as! [Constraint]
63 | }
64 |
65 | internal func add(constraints: [Constraint]) {
66 | let constraintsSet = self.constraintsSet
67 | for constraint in constraints {
68 | constraintsSet.add(constraint)
69 | }
70 | }
71 |
72 | internal func remove(constraints: [Constraint]) {
73 | let constraintsSet = self.constraintsSet
74 | for constraint in constraints {
75 | constraintsSet.remove(constraint)
76 | }
77 | }
78 |
79 | private var constraintsSet: NSMutableSet {
80 | let constraintsSet: NSMutableSet
81 |
82 | if let existing = objc_getAssociatedObject(self, &constraintsKey) as? NSMutableSet {
83 | constraintsSet = existing
84 | } else {
85 | constraintsSet = NSMutableSet()
86 | objc_setAssociatedObject(self, &constraintsKey, constraintsSet, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
87 | }
88 | return constraintsSet
89 |
90 | }
91 |
92 | }
93 | private var constraintsKey: UInt8 = 0
94 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/Typealiases.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | import Foundation
25 |
26 | #if os(iOS) || os(tvOS)
27 | import UIKit
28 | typealias LayoutRelation = NSLayoutRelation
29 | typealias LayoutAttribute = NSLayoutAttribute
30 | typealias LayoutPriority = UILayoutPriority
31 | #else
32 | import AppKit
33 | typealias LayoutRelation = NSLayoutConstraint.Relation
34 | typealias LayoutAttribute = NSLayoutConstraint.Attribute
35 | typealias LayoutPriority = NSLayoutConstraint.Priority
36 | #endif
37 |
38 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #endif
27 |
28 |
29 | @available(iOS 8.0, *)
30 | public extension ConstraintLayoutSupport {
31 |
32 | public var snp: ConstraintLayoutSupportDSL {
33 | return ConstraintLayoutSupportDSL(support: self)
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/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 | 7.0.2
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 "CwlCatchException.h"
14 | #import "CwlMachBadInstructionHandler.h"
15 | #import "mach_excServer.h"
16 | #import "CwlPreconditionTesting.h"
17 | #import "Nimble.h"
18 | #import "DSL.h"
19 | #import "NMBExceptionCapture.h"
20 | #import "NMBStringify.h"
21 |
22 | FOUNDATION_EXPORT double NimbleVersionNumber;
23 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
24 |
25 |
--------------------------------------------------------------------------------
/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.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Nimble
2 | ENABLE_BITCODE = NO
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
6 | OTHER_LDFLAGS = -weak-lswiftXCTest -weak_framework "XCTest"
7 | OTHER_SWIFT_FLAGS = $(inherited) -suppress-warnings $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = $BUILD_DIR
9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_ROOT = ${SRCROOT}
11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Nimble
12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
13 | SKIP_INSTALL = YES
14 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_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-HTTP-Status-Codes-for-Swift_Example/Pods-HTTP-Status-Codes-for-Swift_Example-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## SnapKit
5 |
6 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
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 |
27 | ## StatusCodes
28 |
29 | MIT License
30 |
31 | Copyright (c) 2017 Ondrej Rafaj
32 |
33 | Permission is hereby granted, free of charge, to any person obtaining a copy
34 | of this software and associated documentation files (the "Software"), to deal
35 | in the Software without restriction, including without limitation the rights
36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37 | copies of the Software, and to permit persons to whom the Software is
38 | furnished to do so, subject to the following conditions:
39 |
40 | The above copyright notice and this permission notice shall be included in all
41 | copies or substantial portions of the Software.
42 |
43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
49 | SOFTWARE.
50 |
51 | Generated by CocoaPods - https://cocoapods.org
52 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_Example/Pods-HTTP-Status-Codes-for-Swift_Example-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_HTTP_Status_Codes_for_Swift_Example : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_HTTP_Status_Codes_for_Swift_Example
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_Example/Pods-HTTP-Status-Codes-for-Swift_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_HTTP_Status_Codes_for_Swift_ExampleVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_HTTP_Status_Codes_for_Swift_ExampleVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_Example/Pods-HTTP-Status-Codes-for-Swift_Example.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/StatusCodes"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/StatusCodes/StatusCodes.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "SnapKit" -framework "StatusCodes"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = $BUILD_DIR
9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_Example/Pods-HTTP-Status-Codes-for-Swift_Example.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_HTTP_Status_Codes_for_Swift_Example {
2 | umbrella header "Pods-HTTP-Status-Codes-for-Swift_Example-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_Example/Pods-HTTP-Status-Codes-for-Swift_Example.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/StatusCodes"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/StatusCodes/StatusCodes.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "SnapKit" -framework "StatusCodes"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = $BUILD_DIR
9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_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-HTTP-Status-Codes-for-Swift_Tests/Pods-HTTP-Status-Codes-for-Swift_Tests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_HTTP_Status_Codes_for_Swift_Tests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_HTTP_Status_Codes_for_Swift_Tests
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_Tests/Pods-HTTP-Status-Codes-for-Swift_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_HTTP_Status_Codes_for_Swift_TestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_HTTP_Status_Codes_for_Swift_TestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_Tests/Pods-HTTP-Status-Codes-for-Swift_Tests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "$PODS_CONFIGURATION_BUILD_DIR/Nimble" "$PODS_CONFIGURATION_BUILD_DIR/Quick" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/StatusCodes"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Nimble/Nimble.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Quick/Quick.framework/Headers" $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/StatusCodes/StatusCodes.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "Nimble" -framework "Quick"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = $BUILD_DIR
9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_Tests/Pods-HTTP-Status-Codes-for-Swift_Tests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_HTTP_Status_Codes_for_Swift_Tests {
2 | umbrella header "Pods-HTTP-Status-Codes-for-Swift_Tests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-HTTP-Status-Codes-for-Swift_Tests/Pods-HTTP-Status-Codes-for-Swift_Tests.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "$PODS_CONFIGURATION_BUILD_DIR/Nimble" "$PODS_CONFIGURATION_BUILD_DIR/Quick" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/StatusCodes"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Nimble/Nimble.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Quick/Quick.framework/Headers" $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/StatusCodes/StatusCodes.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "Nimble" -framework "Quick"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = $BUILD_DIR
9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/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 | 1.2.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.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.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Quick
2 | ENABLE_BITCODE = NO
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
6 | OTHER_LDFLAGS = -framework "XCTest"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = $BUILD_DIR
9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_ROOT = ${SRCROOT}
11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Quick
12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
13 | SKIP_INSTALL = YES
14 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 4.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SnapKit : NSObject
3 | @end
4 | @implementation PodsDummy_SnapKit
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit-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/SnapKit/SnapKit-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 SnapKitVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char SnapKitVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit.modulemap:
--------------------------------------------------------------------------------
1 | framework module SnapKit {
2 | umbrella header "SnapKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SnapKit
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SnapKit
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/StatusCodes/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 2.0.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/StatusCodes/StatusCodes-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_StatusCodes : NSObject
3 | @end
4 | @implementation PodsDummy_StatusCodes
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/StatusCodes/StatusCodes-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/StatusCodes/StatusCodes-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 StatusCodesVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char StatusCodesVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/StatusCodes/StatusCodes.modulemap:
--------------------------------------------------------------------------------
1 | framework module StatusCodes {
2 | umbrella header "StatusCodes-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/StatusCodes/StatusCodes.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/StatusCodes
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/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/Tests.swift:
--------------------------------------------------------------------------------
1 | // https://github.com/Quick/Quick
2 |
3 | import Quick
4 | import Nimble
5 | @testable import StatusCodes
6 |
7 |
8 | class StatusCodesSpec: QuickSpec {
9 |
10 | override func spec() {
11 | describe("StatusCodes") {
12 |
13 | it("should return right value for a few example codes") {
14 | expect(StatusCodes.Code200OK.code).to(equal(200))
15 | expect(StatusCodes.Code301MovedPermanently.code).to(equal(301))
16 | expect(StatusCodes.Code400BadRequest.code).to(equal(400))
17 | expect(StatusCodes.Code418IamATeapot.code).to(equal(418))
18 | expect(StatusCodes.Code500InternalServerError.code).to(equal(500))
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/HTTP-Status-Codes-for-Swift/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manGoweb/StatusCodes/d9f90b56f9b178d891ecb4a222a3636ea620416a/HTTP-Status-Codes-for-Swift/Assets/.gitkeep
--------------------------------------------------------------------------------
/HTTP-Status-Codes-for-Swift/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manGoweb/StatusCodes/d9f90b56f9b178d891ecb4a222a3636ea620416a/HTTP-Status-Codes-for-Swift/Classes/.gitkeep
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Ondrej Rafaj
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/StatusCodes.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint HTTP-Status-Codes-for-Swift.podspec' to ensure this is a
3 | # valid spec before submitting.
4 | #
5 | # Any lines starting with a # are optional, but their use is encouraged
6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
7 | #
8 |
9 | Pod::Spec.new do |s|
10 | s.name = 'StatusCodes'
11 | s.version = '2.0.2'
12 | s.summary = 'HTTP status codes for Swift'
13 |
14 | s.description = "Swift enum which contans (at least to my knowledge) all available status codes as Int values."
15 |
16 | s.homepage = 'http://github.com/manGoweb/StatusCodes'
17 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
18 | s.license = { :type => 'MIT', :file => 'LICENSE' }
19 | s.author = { 'Ondrej Rafaj' => 'developers@mangoweb.cz' }
20 | s.source = { :git => 'https://github.com/manGoweb/StatusCodes.git', :tag => s.version.to_s }
21 | s.social_media_url = 'http://twitter.com/mangowebuk'
22 |
23 | s.ios.deployment_target = '10.3'
24 | s.tvos.deployment_target = '10.0'
25 | s.macos.deployment_target = '10.12'
26 |
27 | s.source_files = 'HTTP-Status-Codes-for-Swift/Classes/**/*'
28 |
29 | # s.resource_bundles = {
30 | # 'HTTP-Status-Codes-for-Swift' => ['HTTP-Status-Codes-for-Swift/Assets/*.png']
31 | # }
32 |
33 | # s.public_header_files = 'Pod/Classes/**/*.h'
34 | # s.frameworks = 'UIKit', 'MapKit'
35 | # s.dependency 'AFNetworking', '~> 2.3'
36 | end
37 |
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------