├── .gitignore ├── .jazzy.yaml ├── .ruby-version ├── .swift-version ├── .travis.yml ├── ConcentricProgressRingView.podspec ├── ConcentricProgressRingView ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ └── ConcentricProgressRing.swift ├── Example ├── ConcentricProgressRingView.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── ConcentricProgressRingView.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── xcschemes │ │ └── ConcentricProgressRingView-Example.xcscheme ├── ConcentricProgressRingView │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── ViewController.swift ├── ConcentricProgressRingView_ExampleTests │ ├── ConcentricProgressRingView_ExampleTests.swift │ └── Info.plist ├── ConcentricProgressRingView_Tests │ ├── ConcentricProgressRingView_Tests.swift │ └── Info.plist ├── Podfile ├── Podfile.lock └── Pods │ ├── LionheartExtensions │ ├── LICENSE │ ├── Pod │ │ └── Classes │ │ │ ├── ActivityIndicatorButton.swift │ │ │ ├── ColorRepresentation.swift │ │ │ ├── Core │ │ │ ├── Any+LionheartExtensions.swift │ │ │ ├── Array+LionheartExtensions.swift │ │ │ ├── Bundle+LionheartExtensions.swift │ │ │ ├── CIImage+LionheartExtensions.swift │ │ │ ├── DateFormatter+LionheartExtensions.swift │ │ │ ├── FileManager+LionheartExtensions.swift │ │ │ ├── IndexPath+LionheartExtensions.swift │ │ │ ├── Int+LionheartExtensions.swift │ │ │ ├── NSDecimalNumber+LionheartExtensions.swift │ │ │ ├── NSRegularExpression+LionheartExtensions.swift │ │ │ ├── NSURLSession+LionheartExtensions.swift │ │ │ ├── Optional+LionheartExtensions.swift │ │ │ ├── String+LionheartExtensions.swift │ │ │ ├── UIAlertController+LionheartExtensions.swift │ │ │ ├── UIApplicationDelegate+LionheartExtensions.swift │ │ │ ├── UIColor+LionheartExtensions.swift │ │ │ ├── UIDevice+LionheartExtensions.swift │ │ │ ├── UIFont+LionheartExtensions.swift │ │ │ ├── UIImage+LionheartExtensions.swift │ │ │ ├── UIPrintPageRenderer+LionheartExtensions.swift │ │ │ ├── UIScreen+LionheartExtensions.swift │ │ │ ├── UITextField+LionheartExtensions.swift │ │ │ ├── UIView+LionheartExtensions.swift │ │ │ ├── UIViewController+LionheartExtensions.swift │ │ │ ├── UIWindow+LionheartExtensions.swift │ │ │ └── WKWebView+LionheartExtensions.swift │ │ │ ├── CustomButtonType.swift │ │ │ ├── File.swift │ │ │ ├── Functional.swift │ │ │ ├── Main.swift │ │ │ ├── Summable.swift │ │ │ └── TitleButton.swift │ └── README.md │ ├── Local Podspecs │ └── ConcentricProgressRingView.podspec.json │ ├── Manifest.lock │ ├── Nimble │ ├── Carthage │ │ └── Checkouts │ │ │ ├── CwlCatchException │ │ │ └── Sources │ │ │ │ ├── CwlCatchException │ │ │ │ └── CwlCatchException.swift │ │ │ │ └── CwlCatchExceptionSupport │ │ │ │ ├── CwlCatchException.m │ │ │ │ └── include │ │ │ │ └── CwlCatchException.h │ │ │ └── CwlPreconditionTesting │ │ │ └── Sources │ │ │ ├── CwlMachBadInstructionHandler │ │ │ ├── CwlMachBadInstructionHandler.m │ │ │ ├── include │ │ │ │ └── CwlMachBadInstructionHandler.h │ │ │ ├── mach_excServer.c │ │ │ └── mach_excServer.h │ │ │ └── CwlPreconditionTesting │ │ │ ├── CwlBadInstructionException.swift │ │ │ ├── CwlCatchBadInstruction.swift │ │ │ ├── CwlDarwinDefinitions.swift │ │ │ └── Mach │ │ │ └── CwlPreconditionTesting.h │ ├── LICENSE │ ├── README.md │ └── Sources │ │ ├── Nimble │ │ ├── Adapters │ │ │ ├── AdapterProtocols.swift │ │ │ ├── AssertionDispatcher.swift │ │ │ ├── AssertionRecorder.swift │ │ │ ├── NMBExpectation.swift │ │ │ ├── NMBObjCMatcher.swift │ │ │ ├── NimbleEnvironment.swift │ │ │ └── NimbleXCTestHandler.swift │ │ ├── DSL+Wait.swift │ │ ├── DSL.swift │ │ ├── Expectation.swift │ │ ├── ExpectationMessage.swift │ │ ├── Expression.swift │ │ ├── FailureMessage.swift │ │ ├── Matchers │ │ │ ├── AllPass.swift │ │ │ ├── Async.swift │ │ │ ├── BeAKindOf.swift │ │ │ ├── BeAnInstanceOf.swift │ │ │ ├── BeCloseTo.swift │ │ │ ├── BeEmpty.swift │ │ │ ├── BeGreaterThan.swift │ │ │ ├── BeGreaterThanOrEqualTo.swift │ │ │ ├── BeIdenticalTo.swift │ │ │ ├── BeLessThan.swift │ │ │ ├── BeLessThanOrEqual.swift │ │ │ ├── BeLogical.swift │ │ │ ├── BeNil.swift │ │ │ ├── BeVoid.swift │ │ │ ├── BeginWith.swift │ │ │ ├── Contain.swift │ │ │ ├── ContainElementSatisfying.swift │ │ │ ├── EndWith.swift │ │ │ ├── Equal.swift │ │ │ ├── HaveCount.swift │ │ │ ├── Match.swift │ │ │ ├── MatchError.swift │ │ │ ├── MatcherFunc.swift │ │ │ ├── MatcherProtocols.swift │ │ │ ├── PostNotification.swift │ │ │ ├── Predicate.swift │ │ │ ├── RaisesException.swift │ │ │ ├── SatisfyAllOf.swift │ │ │ ├── SatisfyAnyOf.swift │ │ │ ├── ThrowAssertion.swift │ │ │ ├── ThrowError.swift │ │ │ └── ToSucceed.swift │ │ ├── Nimble.h │ │ └── Utils │ │ │ ├── Await.swift │ │ │ ├── Errors.swift │ │ │ ├── Functional.swift │ │ │ ├── SourceLocation.swift │ │ │ └── Stringers.swift │ │ └── NimbleObjectiveC │ │ ├── DSL.h │ │ ├── DSL.m │ │ ├── NMBExceptionCapture.h │ │ ├── NMBExceptionCapture.m │ │ ├── NMBStringify.h │ │ ├── NMBStringify.m │ │ └── XCTestObservationCenter+Register.m │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── 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 │ │ ├── Quick.h │ │ ├── QuickSpec.h │ │ ├── QuickSpec.m │ │ └── XCTestSuite+QuickTestSuiteBuilder.m │ │ └── QuickSpecBase │ │ ├── QuickSpecBase.m │ │ └── include │ │ └── QuickSpecBase.h │ └── Target Support Files │ ├── ConcentricProgressRingView │ ├── ConcentricProgressRingView-Info.plist │ ├── ConcentricProgressRingView-dummy.m │ ├── ConcentricProgressRingView-prefix.pch │ ├── ConcentricProgressRingView-umbrella.h │ ├── ConcentricProgressRingView.modulemap │ ├── ConcentricProgressRingView.xcconfig │ └── Info.plist │ ├── LionheartExtensions │ ├── Info.plist │ ├── LionheartExtensions-Info.plist │ ├── LionheartExtensions-dummy.m │ ├── LionheartExtensions-prefix.pch │ ├── LionheartExtensions-umbrella.h │ ├── LionheartExtensions.modulemap │ └── LionheartExtensions.xcconfig │ ├── Nimble │ ├── Info.plist │ ├── Nimble-Info.plist │ ├── Nimble-dummy.m │ ├── Nimble-prefix.pch │ ├── Nimble-umbrella.h │ ├── Nimble.modulemap │ └── Nimble.xcconfig │ ├── Pods-ConcentricProgressRingView_Example │ ├── Info.plist │ ├── Pods-ConcentricProgressRingView_Example-Info.plist │ ├── Pods-ConcentricProgressRingView_Example-acknowledgements.markdown │ ├── Pods-ConcentricProgressRingView_Example-acknowledgements.plist │ ├── Pods-ConcentricProgressRingView_Example-dummy.m │ ├── Pods-ConcentricProgressRingView_Example-frameworks.sh │ ├── Pods-ConcentricProgressRingView_Example-resources.sh │ ├── Pods-ConcentricProgressRingView_Example-umbrella.h │ ├── Pods-ConcentricProgressRingView_Example.debug.xcconfig │ ├── Pods-ConcentricProgressRingView_Example.modulemap │ └── Pods-ConcentricProgressRingView_Example.release.xcconfig │ ├── Pods-ConcentricProgressRingView_ExampleTests │ ├── Info.plist │ ├── Pods-ConcentricProgressRingView_ExampleTests-Info.plist │ ├── Pods-ConcentricProgressRingView_ExampleTests-acknowledgements.markdown │ ├── Pods-ConcentricProgressRingView_ExampleTests-acknowledgements.plist │ ├── Pods-ConcentricProgressRingView_ExampleTests-dummy.m │ ├── Pods-ConcentricProgressRingView_ExampleTests-frameworks.sh │ ├── Pods-ConcentricProgressRingView_ExampleTests-resources.sh │ ├── Pods-ConcentricProgressRingView_ExampleTests-umbrella.h │ ├── Pods-ConcentricProgressRingView_ExampleTests.debug.xcconfig │ ├── Pods-ConcentricProgressRingView_ExampleTests.modulemap │ └── Pods-ConcentricProgressRingView_ExampleTests.release.xcconfig │ └── Quick │ ├── Info.plist │ ├── Quick-Info.plist │ ├── Quick-dummy.m │ ├── Quick-prefix.pch │ ├── Quick-umbrella.h │ ├── Quick.modulemap │ └── Quick.xcconfig ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── _Pods.xcodeproj ├── animation.gif ├── docs ├── Classes.html ├── Classes │ ├── CircleLayer.html │ ├── ConcentricProgressRingView.html │ └── ProgressRingLayer.html ├── Structs.html ├── Structs │ └── ProgressRing.html ├── badge.svg ├── css │ ├── highlight.css │ └── jazzy.css ├── docsets │ ├── ConcentricProgressRingView.docset │ │ └── Contents │ │ │ ├── Info.plist │ │ │ └── Resources │ │ │ ├── Documents │ │ │ ├── Classes.html │ │ │ ├── Classes │ │ │ │ ├── CircleLayer.html │ │ │ │ ├── ConcentricProgressRingView.html │ │ │ │ └── ProgressRingLayer.html │ │ │ ├── Structs.html │ │ │ ├── Structs │ │ │ │ └── ProgressRing.html │ │ │ ├── css │ │ │ │ ├── highlight.css │ │ │ │ └── jazzy.css │ │ │ ├── img │ │ │ │ ├── carat.png │ │ │ │ ├── dash.png │ │ │ │ ├── gh.png │ │ │ │ └── spinner.gif │ │ │ ├── index.html │ │ │ ├── js │ │ │ │ ├── jazzy.js │ │ │ │ ├── jazzy.search.js │ │ │ │ ├── jquery.min.js │ │ │ │ ├── lunr.min.js │ │ │ │ └── typeahead.jquery.js │ │ │ └── search.json │ │ │ └── docSet.dsidx │ └── ConcentricProgressRingView.tgz ├── filelist ├── filelist-local ├── filelist-local-md5 ├── filelist-md5 ├── img │ ├── carat.png │ ├── dash.png │ ├── gh.png │ └── spinner.gif ├── index.html ├── js │ ├── jazzy.js │ ├── jazzy.search.js │ ├── jquery.min.js │ ├── lunr.min.js │ └── typeahead.jquery.js ├── search.json └── undocumented.json ├── example1.png ├── example2.png ├── example3.png └── meta ├── header.sketch ├── repo-banner-bottom.png └── repo-banner.png /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage/Build 26 | -------------------------------------------------------------------------------- /.jazzy.yaml: -------------------------------------------------------------------------------- 1 | author: "Lionheart Software" 2 | author_url: "https://lionheartsw.com" 3 | github_url: "https://github.com/lionheart/ConcentricProgressRingView" 4 | github_file_prefix: "https://github.com/lionheart/ConcentricProgressRingView/tree/2.0.1" 5 | xcodebuild_arguments: ["-workspace", "Example/ConcentricProgressRingView.xcworkspace", "-scheme", "ConcentricProgressRingView"] 6 | readme: "README.md" 7 | copyright: "© 2016-2017 Lionheart Software LLC" 8 | theme: fullwidth 9 | head: "" 10 | use_safe_filenames: true 11 | 12 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.5.0 2 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.0 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | script: 2 | - set -o pipefail && xcodebuild test -workspace Example/ConcentricProgressRingView.xcworkspace -scheme ConcentricProgressRingView-Example -destination "platform=iOS Simulator,name=iPhone X" | xcpretty 3 | - bundle exec pod lib lint 4 | 5 | before_install: 6 | - gem update --system 7 | - gem install bundler 8 | 9 | language: objective-c 10 | osx_image: xcode9.2 11 | -------------------------------------------------------------------------------- /ConcentricProgressRingView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'ConcentricProgressRingView' 3 | s.version = "2.0.2" 4 | s.summary = 'Fully customizable circular progress bar written in Swift' 5 | s.homepage = 'https://github.com/lionheart/ConcentricProgressRingView' 6 | s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } 7 | s.author = { 'Dan Loewenherz' => 'dan@lionheartsw.com' } 8 | s.source = { :git => 'https://github.com/lionheart/ConcentricProgressRingView.git', :tag => s.version.to_s } 9 | s.social_media_url = 'https://twitter.com/lionheartsw' 10 | 11 | s.ios.deployment_target = '10.3' 12 | 13 | s.pod_target_xcconfig = { 14 | 'SWIFT_VERSION' => '4.2' 15 | } 16 | 17 | s.source_files = 'ConcentricProgressRingView/Classes/**/*' 18 | s.dependency 'LionheartExtensions' 19 | end 20 | -------------------------------------------------------------------------------- /ConcentricProgressRingView/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/ConcentricProgressRingView/Assets/.gitkeep -------------------------------------------------------------------------------- /ConcentricProgressRingView/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/ConcentricProgressRingView/Classes/.gitkeep -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ConcentricProgressRingView 4 | // 5 | // Created by Dan Loewenherz on 06/30/2016. 6 | // Copyright (c) 2016 Dan Loewenherz. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | var window: UIWindow? 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | return true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView/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/ConcentricProgressRingView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ConcentricProgressRingView 4 | // 5 | // Created by Dan Loewenherz on 06/30/2016. 6 | // Copyright (c) 2016 Dan Loewenherz. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ConcentricProgressRingView 11 | import LionheartExtensions 12 | 13 | class ViewController: UIViewController { 14 | var progressRingView: ConcentricProgressRingView! 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | 19 | let margin: CGFloat = 1 20 | let radius: CGFloat = 80 21 | 22 | let rings = [ 23 | ProgressRing(color: UIColor(.RGB(232, 11, 45)), backgroundColor: UIColor(.RGB(34, 3, 11))), 24 | ProgressRing(color: UIColor(.RGB(137, 242, 0)), backgroundColor: UIColor(.RGB(22, 33, 0))), 25 | ProgressRing(color: UIColor(.RGB(0, 200, 222)), backgroundColor: UIColor(.RGB(0, 30, 28))) 26 | ] 27 | progressRingView = try! ConcentricProgressRingView(center: view.center, radius: radius, margin: margin, rings: rings, defaultColor: UIColor.clear, defaultWidth: 18) 28 | 29 | for ring in progressRingView { 30 | ring.progress = 0.5 31 | } 32 | 33 | view.backgroundColor = UIColor.black 34 | view.addSubview(progressRingView) 35 | } 36 | 37 | override func viewDidAppear(_ animated: Bool) { 38 | super.viewDidAppear(animated) 39 | 40 | for (i, _) in progressRingView.enumerated() { 41 | Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(randomAnimation(_:)), userInfo: i, repeats: true) 42 | } 43 | } 44 | 45 | @objc func randomAnimation(_ timer: Timer?) { 46 | guard let index = timer?.userInfo as? Int else { 47 | return 48 | } 49 | 50 | let f = Int64(0.2 * Double(index) * Double(NSEC_PER_SEC)) 51 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(f) / Double(NSEC_PER_SEC), execute: { 52 | self.progressRingView[index].setProgress(CGFloat(drand48()), duration: max(0.4, CGFloat(drand48()))) 53 | }) 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView_ExampleTests/ConcentricProgressRingView_ExampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConcentricProgressRingView_ExampleTests.swift 3 | // ConcentricProgressRingView_ExampleTests 4 | // 5 | // Created by Daniel Loewenherz on 11/27/17. 6 | // Copyright © 2017 CocoaPods. All rights reserved. 7 | // 8 | 9 | // https://github.com/Quick/Quick 10 | 11 | import Quick 12 | import Nimble 13 | import LionheartExtensions 14 | @testable import ConcentricProgressRingView 15 | 16 | class ConcentricProgressRingSpec: XCTestCase { 17 | static let width: CGFloat = 18 18 | static let margin: CGFloat = 2 19 | static let radius: CGFloat = 80 20 | 21 | static let bars: [ProgressRing] = [ 22 | ProgressRing(color: UIColor(.RGB(160, 255, 0)), backgroundColor: UIColor(.RGB(44, 66, 4)), width: width), 23 | ProgressRing(color: UIColor(.RGB(255, 211, 0)), backgroundColor: UIColor(.RGB(85, 78, 0)), width: width), 24 | ProgressRing(color: UIColor(.RGB(255, 28, 93)), backgroundColor: UIColor(.RGB(52, 0, 19)), width: width), 25 | ] 26 | 27 | func testConcentricProgressRingViewArcs() { 28 | let view = ConcentricProgressRingView(center: CGPoint.zero, radius: ConcentricProgressRingSpec.radius, margin: ConcentricProgressRingSpec.margin, rings: ConcentricProgressRingSpec.bars) 29 | 30 | expect(view.arcs.count) == 3 31 | expect(view.circles.count) == 3 32 | expect(view[0]) == view.arcs.first 33 | expect(view[2]) == view.arcs.last 34 | } 35 | 36 | func testConcentricProgressRingViewCircles() { 37 | let view = ConcentricProgressRingView(center: CGPoint.zero, radius: ConcentricProgressRingSpec.radius, margin: ConcentricProgressRingSpec.margin, rings: ConcentricProgressRingSpec.bars) 38 | 39 | expect(view.arcs.count) == 3 40 | expect(view.circles.count) == 3 41 | expect(view[0]) == view.arcs.first 42 | expect(view[2]) == view.arcs.last 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView_ExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView_Tests/ConcentricProgressRingView_Tests.swift: -------------------------------------------------------------------------------- 1 | // https://github.com/Quick/Quick 2 | 3 | import XCTest 4 | import Nimble 5 | import LionheartExtensions 6 | @testable import ConcentricProgressRingView 7 | 8 | class ConcentricProgressRingSpec: XCTestCase { 9 | static let width: CGFloat = 18 10 | static let margin: CGFloat = 2 11 | static let radius: CGFloat = 80 12 | 13 | static let bars: [ProgressRing] = [ 14 | ProgressRing(color: UIColor(.RGB(160, 255, 0)), backgroundColor: UIColor(.RGB(44, 66, 4)), width: width), 15 | ProgressRing(color: UIColor(.RGB(255, 211, 0)), backgroundColor: UIColor(.RGB(85, 78, 0)), width: width), 16 | ProgressRing(color: UIColor(.RGB(255, 28, 93)), backgroundColor: UIColor(.RGB(52, 0, 19)), width: width), 17 | ] 18 | 19 | func testConcentricProgressRingViewArcs() { 20 | let view = ConcentricProgressRingView(center: CGPoint.zero, radius: ConcentricProgressRingSpec.radius, margin: ConcentricProgressRingSpec.margin, rings: ConcentricProgressRingSpec.bars) 21 | 22 | expect(view.arcs.count) == 3 23 | expect(view.circles.count) == 3 24 | expect(view[0]) == view.arcs.first 25 | expect(view[2]) == view.arcs.last 26 | } 27 | 28 | func testConcentricProgressRingViewCircles() { 29 | let view = ConcentricProgressRingView(center: CGPoint.zero, radius: ConcentricProgressRingSpec.radius, margin: ConcentricProgressRingSpec.margin, rings: ConcentricProgressRingSpec.bars) 30 | 31 | expect(view.arcs.count) == 3 32 | expect(view.circles.count) == 3 33 | expect(view[0]) == view.arcs.first 34 | expect(view[2]) == view.arcs.last 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Example/ConcentricProgressRingView_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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | project 'ConcentricProgressRingView.xcodeproj' 4 | platform :ios, '10.3' 5 | use_frameworks! 6 | 7 | target 'ConcentricProgressRingView_Example' do 8 | pod 'ConcentricProgressRingView', :path => '../' 9 | pod 'LionheartExtensions' 10 | 11 | target 'ConcentricProgressRingView_ExampleTests' do 12 | inherit! :search_paths 13 | 14 | pod 'Quick', '~> 1' 15 | pod 'Nimble', '~> 7' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ConcentricProgressRingView (2.0.2): 3 | - LionheartExtensions 4 | - LionheartExtensions (5.0.2): 5 | - LionheartExtensions/Core (= 5.0.2) 6 | - LionheartExtensions/Core (5.0.2) 7 | - Nimble (7.3.4) 8 | - Quick (1.3.4) 9 | 10 | DEPENDENCIES: 11 | - ConcentricProgressRingView (from `../`) 12 | - LionheartExtensions 13 | - Nimble (~> 7) 14 | - Quick (~> 1) 15 | 16 | SPEC REPOS: 17 | https://github.com/cocoapods/specs.git: 18 | - LionheartExtensions 19 | - Nimble 20 | - Quick 21 | 22 | EXTERNAL SOURCES: 23 | ConcentricProgressRingView: 24 | :path: "../" 25 | 26 | SPEC CHECKSUMS: 27 | ConcentricProgressRingView: e123c811722e610aeeb40201abf033b23fd393aa 28 | LionheartExtensions: 09fa816d98176012c8f9adf7f21774f528dbc90e 29 | Nimble: 051e3d8912d40138fa5591c78594f95fb172af37 30 | Quick: f4f7f063c524394c73ed93ac70983c609805d481 31 | 32 | PODFILE CHECKSUM: 9870839634870d9146dc16ddb8cc0bbe0be1bb88 33 | 34 | COCOAPODS: 1.7.1 35 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/ActivityIndicatorButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ActivityIndicatorButton.swift 3 | // LionheartExtensions 4 | // 5 | // Created by Dan Loewenherz on 4/10/18. 6 | // 7 | 8 | import Foundation 9 | 10 | public final class ActivityIndicatorButton: UIButton { 11 | var activity: UIActivityIndicatorView! 12 | 13 | static let titleAttributes = [ 14 | NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 17), 15 | ] 16 | 17 | static let subtitleAttributes = [ 18 | NSAttributedString.Key.font: UIFont.systemFont(ofSize: 11), 19 | NSAttributedString.Key.foregroundColor: UIColor.darkGray 20 | ] 21 | 22 | @objc convenience init() { 23 | self.init(frame: .zero) 24 | } 25 | 26 | override init(frame: CGRect) { 27 | super.init(frame: .zero) 28 | 29 | activity = UIActivityIndicatorView(style: .gray) 30 | activity.translatesAutoresizingMaskIntoConstraints = false 31 | 32 | addSubview(activity) 33 | 34 | activity.leftAnchor.constraint(equalTo: leftAnchor).isActive = true 35 | activity.centerOnYAxis() 36 | 37 | sizeToFit() 38 | } 39 | 40 | @available(*, unavailable) 41 | required public init?(coder aDecoder: NSCoder) { 42 | fatalError("init(coder:) has not been implemented") 43 | } 44 | } 45 | 46 | // MARK: - CustomButtonType 47 | extension ActivityIndicatorButton: CustomButtonType { 48 | public func setTitle(title: String) { 49 | setTitle(title: title, subtitle: nil) 50 | } 51 | 52 | public func setTitle(title: String, subtitle: String?) { 53 | let string = NSMutableAttributedString(string: title, attributes: ActivityIndicatorButton.titleAttributes) 54 | if let subtitle = subtitle { 55 | string.append(NSAttributedString(string: "\n" + subtitle, attributes: ActivityIndicatorButton.subtitleAttributes)) 56 | titleLabel?.lineBreakMode = .byWordWrapping 57 | } else { 58 | titleLabel?.lineBreakMode = .byTruncatingTail 59 | } 60 | 61 | setAttributedTitle(string, for: .normal) 62 | 63 | sizeToFit() 64 | } 65 | 66 | public func startAnimating() { 67 | activity.startAnimating() 68 | 69 | contentEdgeInsets = UIEdgeInsets(top: 0, left: 30, bottom: 0, right: 0) 70 | } 71 | 72 | public func stopAnimating() { 73 | activity.stopAnimating() 74 | 75 | contentEdgeInsets = .zero 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/Any+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import Foundation 19 | 20 | /** 21 | If an optional is contained in any `Any` value, this function "lifts" the non-optional value out of it. 22 | 23 | - note: May no longer be useful as of Swift 3. 24 | */ 25 | public func liftOptionalFromAny(_ value: Any) -> Any { 26 | let mirror = Mirror(reflecting: value) 27 | if mirror.displayStyle != .optional { 28 | return value 29 | } 30 | 31 | if mirror.children.count == 0 { 32 | return NSNull() 33 | } 34 | 35 | let (_, some) = mirror.children.first! 36 | return some 37 | } 38 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/Array+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import Foundation 19 | 20 | public extension Array { 21 | /// Returns an iterator that splits `self` into chunks of `Array`, each with `size` elements. 22 | func chunks(_ size: Int) -> AnyIterator<[Element]> { 23 | if size == 0 { 24 | return AnyIterator { 25 | return nil 26 | } 27 | } 28 | 29 | let indices = stride(from: startIndex, to: count, by: size) 30 | var generator = indices.makeIterator() 31 | 32 | return AnyIterator { 33 | guard let i = generator.next() else { 34 | return nil 35 | } 36 | 37 | var j = self.index(i, offsetBy: size) 38 | repeat { 39 | j = self.index(before: j) 40 | } while j >= self.endIndex 41 | 42 | return self[i...j].lazy.map { $0 } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/Bundle+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Bundle+LionheartExtensions.swift 3 | // Pods 4 | // 5 | // Created by Daniel Loewenherz on 8/31/17. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public extension Bundle { 12 | /// The version string. 13 | static var appVersion: String? { 14 | return main.infoDictionary?["CFBundleShortVersionString"] as? String 15 | } 16 | 17 | /// The bundle version. 18 | static var appBuildNumber: String? { 19 | return main.infoDictionary?[kCFBundleVersionKey as String] as? String 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/CIImage+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CIImage+LionheartExtensions.swift 3 | // Pods 4 | // 5 | // Created by Daniel Loewenherz on 5/23/17. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public extension CIImage { 12 | /** 13 | - Returns: A CGImage that represents the current CIImage. 14 | - Date: May 24, 2017 15 | */ 16 | var toCGImage: CGImage? { 17 | return CIContext(options: nil).createCGImage(self, from: extent) 18 | } 19 | 20 | /** 21 | Calculate the RGBA values for the specified point in a CIImage. 22 | 23 | - parameter point: A `CGPoint` in the `CIImage` to extract RGBA information. 24 | - Returns: A tuple containing red, green, blue, and alpha values at the specified point if they could be extracted, or a `nil` value otherwise. 25 | - Date: May 24, 2017 26 | */ 27 | func rgbValues(atPoint point: CGPoint) -> (red: UInt8, green: UInt8, blue: UInt8, alpha: UInt8)? { 28 | guard let data = toCGImage?.dataProvider?.data, 29 | let ptr = CFDataGetBytePtr(data) else { 30 | return nil 31 | } 32 | 33 | let bytesPerPixel = 4 34 | let offset = Int(point.x + point.y * extent.size.width) * bytesPerPixel 35 | return (ptr[offset], ptr[offset+1], ptr[offset+2], ptr[offset+3]) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/FileManager+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FileManager+LionheartExtensions.swift 3 | // Pods 4 | // 5 | // Created by Daniel Loewenherz on 2/8/17. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public extension FileManager { 12 | /// A `URL` for a temporary file. 13 | static func temporaryURL(forFileName fileName: String) -> URL { 14 | if #available(iOS 10.0, *) { 15 | return FileManager.default.temporaryDirectory.appendingPathComponent(fileName) 16 | } else { 17 | return URL(fileURLWithPath: temporaryPath(forFileName: fileName)) 18 | } 19 | } 20 | 21 | /// A path `String` for a temporary file. 22 | static func temporaryPath(forFileName fileName: String) -> String { 23 | if #available(iOS 10.0, *) { 24 | return temporaryURL(forFileName: fileName).path 25 | } else { 26 | return NSTemporaryDirectory().appending(fileName) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/IndexPath+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import Foundation 19 | 20 | public extension IndexPath { 21 | /// Creates an `IndexPath` given the specified `RawRepresentable` value for the row and a section. 22 | init(row: T, section: Int) where T.RawValue == Int { 23 | self.init(row: row.rawValue, section: section) 24 | } 25 | 26 | /// Creates an `IndexPath` given the specified row and a `RawRepresentable` value for the section. 27 | init(row: Int, section: T) where T.RawValue == Int { 28 | self.init(row: row, section: section.rawValue) 29 | } 30 | 31 | /// Creates an `IndexPath` given the specified `RawRepresentable` values for both the row and section. 32 | init(row: T, section: T) where T.RawValue == Int { 33 | self.init(row: row.rawValue, section: section.rawValue) 34 | } 35 | 36 | static func ==(tuple: (Int, Int), indexPath: IndexPath) -> Bool { 37 | return indexPath.section == tuple.0 && indexPath.row == tuple.1 38 | } 39 | 40 | static func ==(indexPath: IndexPath, tuple: (Int, Int)) -> Bool { 41 | return indexPath.section == tuple.0 && indexPath.row == tuple.1 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/Int+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import UIKit 19 | 20 | public extension Int { 21 | /** 22 | Scale a value proportionally to the current screen width. Useful for making designed sizes look proportionally similar on all devices. 23 | 24 | For instance, let's say a certain button was meant to take up 30px of an iPhone 6s screen, but you'd like the width to scale proportionally to an iPhone SE: 25 | 26 | ``` 27 | >>> 30.scaledToDeviceWidth(baseWidth: 375) 28 | 25.6 29 | ``` 30 | 31 | - Parameters: 32 | - baseWidth: The base width for the provided value. 33 | - Returns: A `CGFloat` that represents the proportionally sized value. 34 | - Date: February 17, 2016 35 | */ 36 | func scaledToDeviceWidth(_ baseWidth: CGFloat) -> CGFloat { 37 | let screen = UIScreen.main 38 | return (screen.bounds.width / baseWidth) * CGFloat(self) 39 | } 40 | 41 | /** 42 | Convert an Int value representing RGBA color components into red, green, blue, and alpha CGFloat representations. 43 | 44 | This is useful for converting something like a HEX representation of a color to RGBA. For instance: 45 | 46 | ``` 47 | var r: CGFloat! 48 | var g: CGFloat! 49 | var b: CGFloat! 50 | var a: CGFloat! 51 | 0xFF000000.toRGBA(&r, &g, &b, &a) 52 | // r = 1, g = 0, b = 0, a = 0 53 | ``` 54 | 55 | - Parameters: 56 | * r: The variable to write the red color value to. 57 | * g: The variable to write the green color value to. 58 | * b: The variable to write the blue color value to. 59 | * a: The variable to write the alpha value to. 60 | - Date: May 24, 2017 61 | */ 62 | func toRGBA(_ r: inout CGFloat!, _ g: inout CGFloat!, _ b: inout CGFloat!, _ a: inout CGFloat!) { 63 | if self > 0xFFFFFF { 64 | r = CGFloat((self>>24) & 0xFF) / 0xFF 65 | g = CGFloat((self>>16) & 0xFF) / 0xFF 66 | b = CGFloat((self>>8) & 0xFF) / 0xFF 67 | a = CGFloat(self & 0xFF) / 0xFF 68 | } else if self > 0xFFF { 69 | r = CGFloat((self>>16) & 0xFF) / 0xFF 70 | g = CGFloat((self>>8) & 0xFF) / 0xFF 71 | b = CGFloat(self & 0xFF) / 0xFF 72 | a = 1 73 | } else { 74 | r = CGFloat((self>>8) & 0xF) / 0xF 75 | g = CGFloat((self>>4) & 0xF) / 0xF 76 | b = CGFloat(self & 0xF) / 0xF 77 | a = 1 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/NSDecimalNumber+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSDecimalNumber.swift 3 | // Pods 4 | // 5 | // Created by Daniel Loewenherz on 3/16/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | - source: https://gist.github.com/mattt/1ed12090d7c89f36fd28 13 | */ 14 | 15 | extension NSDecimalNumber: Comparable {} 16 | 17 | public extension NSDecimalNumber { 18 | /// Returns `true` if two `NSDecimalNumber` values are equal, `false` otherwise. 19 | static func ==(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool { 20 | return lhs.compare(rhs) == .orderedSame 21 | } 22 | 23 | /// Returns `true` if the first `NSDecimalNumber` parameter is less than the second, `false` otherwise. 24 | static func <(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool { 25 | return lhs.compare(rhs) == .orderedAscending 26 | } 27 | 28 | /// Returns `true` if the first `NSDecimalNumber` parameter is greater than the second, `false` otherwise. 29 | static func >(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool { 30 | return lhs.compare(rhs) == .orderedDescending 31 | } 32 | 33 | /// Returns the [additive inverse](https://en.wikipedia.org/wiki/Additive_inverse) of the provided `NSDecimalNumber`. 34 | static prefix func -(value: NSDecimalNumber) -> NSDecimalNumber { 35 | return value.multiplying(by: NSDecimalNumber(mantissa: 1, exponent: 0, isNegative: true)) 36 | } 37 | 38 | /// Returns the sum of two `NSDecimalNumber` values. 39 | static func +(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> NSDecimalNumber { 40 | return lhs.adding(rhs) 41 | } 42 | 43 | /// Returns the difference of two `NSDecimalNumber` values. 44 | static func -(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> NSDecimalNumber { 45 | return lhs.subtracting(rhs) 46 | } 47 | 48 | /// Returns the product of two `NSDecimalNumber` values. 49 | static func *(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> NSDecimalNumber { 50 | return lhs.multiplying(by: rhs) 51 | } 52 | 53 | /// Returns the quotient of two `NSDecimalNumber` values. 54 | static func /(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> NSDecimalNumber { 55 | return lhs.dividing(by: rhs) 56 | } 57 | 58 | /// Returns the result of raising the provided `NSDecimalNumber` to a specified power. 59 | static func ^(lhs: NSDecimalNumber, rhs: Int) -> NSDecimalNumber { 60 | return lhs.raising(toPower: rhs) 61 | } 62 | 63 | // MARK: - Assignment 64 | 65 | static func +=(lhs: inout NSDecimalNumber, rhs: NSDecimalNumber) { 66 | lhs = lhs + rhs 67 | } 68 | 69 | static func -=(lhs: inout NSDecimalNumber, rhs: NSDecimalNumber) { 70 | lhs = lhs - rhs 71 | } 72 | 73 | static func *=(lhs: inout NSDecimalNumber, rhs: NSDecimalNumber) { 74 | lhs = lhs * rhs 75 | } 76 | 77 | static func /=(lhs: inout NSDecimalNumber, rhs: NSDecimalNumber) { 78 | lhs = lhs / rhs 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/NSRegularExpression+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import Foundation 19 | 20 | public extension NSRegularExpression { 21 | func replaceMatchesInString(_ string: inout String, options: NSRegularExpression.MatchingOptions, range: NSRange, withTemplate templ: String) -> Int { 22 | let mutableString = NSMutableString(string: string) 23 | let result = replaceMatches(in: mutableString, options: options, range: range, withTemplate: templ) 24 | string = String(mutableString) 25 | return result 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/NSURLSession+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import Foundation 19 | 20 | @available(iOS 9.0, *) 21 | public extension URLSession { 22 | /// Cancels all `URLSession` tasks associated with `self`. 23 | func cancelAllTasks(withCompletion completion: @escaping () -> Void) { 24 | getAllTasks { tasks in 25 | for task in tasks { 26 | task.cancel() 27 | } 28 | 29 | completion() 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/Optional+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import Foundation 19 | 20 | public extension Optional where Wrapped == String { 21 | /** 22 | A string identifical to `self` if not an empty string, `nil` otherwise. 23 | 24 | - SeeAlso: `String.nilIfEmpty` 25 | */ 26 | var nilIfEmpty: String? { 27 | guard let value = self, value != "" else { 28 | return nil 29 | } 30 | 31 | return value 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/UIAlertController+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import Foundation 19 | 20 | public extension UIAlertController { 21 | /** 22 | Adds an action to `self` with the specified title, style, and handler. 23 | 24 | - Parameters: 25 | * title: The text to use for the button title. The value you specify should be localized for the user’s current language. This parameter must not be nil. 26 | * style: Additional styling information to apply to the button. Use the style information to convey the type of action that is performed by the button. For a list of possible values, see the constants in `UIAlertActionStyle`. 27 | * handler: A block to execute when the user selects the action. This block has no return value and takes the selected action object as its only parameter. 28 | - Date: February 17, 2016 29 | */ 30 | func addAction(title: String, style: UIAlertAction.Style, handler: ((UIAlertAction) -> Void)?) { 31 | addAction(UIAlertAction(title: title, style: style, handler: handler)) 32 | } 33 | 34 | @available(*, unavailable, renamed: "addAction(title:style:handler:)") 35 | func addAction(withTitle title: String, style: UIAlertAction.Style, handler: ((UIAlertAction) -> Void)?) { } 36 | } 37 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/UIApplicationDelegate+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplicationDelegate+Extensions.swift 3 | // LionheartExtensions 4 | // 5 | // Created by Dan Loewenherz on 2/10/18. 6 | // 7 | 8 | import UIKit 9 | 10 | public protocol UIApplicationDelegateWithWindow: UIApplicationDelegate { 11 | var window: UIWindow? { get set } 12 | } 13 | 14 | /// Usage: `rootViewController = controller` 15 | public extension UIApplicationDelegateWithWindow { 16 | var rootViewController: UIViewController? { 17 | set { 18 | window = UIWindow(frame: UIScreen.main.bounds) 19 | window?.rootViewController = newValue 20 | window?.makeKeyAndVisible() 21 | } 22 | 23 | get { 24 | return window?.rootViewController 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/UIDevice+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIDevice.swift 3 | // Pods 4 | // 5 | // Created by Daniel Loewenherz on 8/16/16. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | public extension UIDevice { 12 | /// The current device's UUID 13 | static var UUIDString: String? { 14 | return current.identifierForVendor?.uuidString 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/UIFont+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import Foundation 19 | 20 | let fontDisplayNameRegularExpression = try! NSRegularExpression(pattern: "([a-z])([A-Z])", options: []) 21 | 22 | public extension UIFont { 23 | /// The display name for a given `UIFont`. 24 | var displayName: String { 25 | let _fontName = NSMutableString(string: fontName) 26 | fontDisplayNameRegularExpression.replaceMatches(in: _fontName, options: [], range: _fontName.range, withTemplate: "$1 $2") 27 | let components = _fontName.components(separatedBy: "-") 28 | return components.joined(separator: " ") 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/UIPrintPageRenderer+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2017 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | import UIKit 18 | 19 | public extension UIPrintPageRenderer { 20 | /// The printable page rendered as a PDF. 21 | var PDF: Data { 22 | let data = NSMutableData() 23 | 24 | UIGraphicsBeginPDFContextToData(data, paperRect, nil) 25 | prepare(forDrawingPages: NSMakeRange(0, numberOfPages)) 26 | 27 | let bounds = UIGraphicsGetPDFContextBounds() 28 | for i in 0.. Bool { 32 | guard let window = LionheartExtensions.sharedUIApplication?.keyWindow else { 33 | return false 34 | } 35 | 36 | let bounds = window.bounds 37 | UIGraphicsBeginImageContextWithOptions(bounds.size, false, 0) 38 | window.drawHierarchy(in: bounds, afterScreenUpdates: true) 39 | let _image = UIGraphicsGetImageFromCurrentImageContext() 40 | UIGraphicsEndImageContext() 41 | 42 | guard let image = _image, 43 | let data = image.pngData() else { 44 | return false 45 | } 46 | 47 | let url = URL(fileURLWithPath: path) 48 | 49 | guard let _ = try? data.write(to: url, options: []) else { 50 | return false 51 | } 52 | 53 | return true 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Core/WKWebView+LionheartExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WKWebView+LionheartExtensions.swift 3 | // LionheartExtensions 4 | // 5 | // Created by Dan Loewenherz on 5/30/18. 6 | // 7 | 8 | import WebKit 9 | 10 | /// Helper methods for WKWebView 11 | public extension WKWebView { 12 | /// Loads an HTTP request with the specified cookies 13 | func load(_ request: URLRequest, with cookies: [HTTPCookie]) { 14 | var request = request 15 | let headers = HTTPCookie.requestHeaderFields(with: cookies) 16 | for (name, value) in headers { 17 | request.addValue(value, forHTTPHeaderField: name) 18 | } 19 | 20 | load(request) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/CustomButtonType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomButtonType.swift 3 | // LionheartExtensions 4 | // 5 | // Created by Dan Loewenherz on 4/10/18. 6 | // 7 | 8 | import Foundation 9 | 10 | public protocol CustomButtonType { 11 | func setTitle(title: String) 12 | func setTitle(title: String, subtitle: String?) 13 | func sizeToFit() 14 | func startAnimating() 15 | func stopAnimating() 16 | } 17 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Functional.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2016 Lionheart Software LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // 17 | 18 | import Foundation 19 | 20 | public struct TruthTeller { 21 | public var value: Bool 22 | 23 | public init(_ value: T?) { 24 | guard let value = value else { 25 | self.value = false 26 | return 27 | } 28 | 29 | if let value = value as? Int { 30 | self.value = value > 0 31 | } else if let value = value as? String { 32 | self.value = value.length > 0 && value != "" 33 | } else if let value = value as? Bool { 34 | self.value = value 35 | } else if value is Date { 36 | self.value = true 37 | } else { 38 | self.value = false 39 | } 40 | } 41 | } 42 | 43 | public func truthy(_ item: T) -> Bool { 44 | return TruthTeller(item).value 45 | } 46 | 47 | public func all(_ elements: [Any?], test: ((Any?) -> Bool) = truthy) -> Bool { 48 | for element in elements { 49 | if !test(element) { 50 | return false 51 | } 52 | } 53 | return true 54 | } 55 | 56 | public func any(_ elements: [Any?], test: ((Any?) -> Bool) = truthy) -> Bool { 57 | for element in elements { 58 | if test(element) { 59 | return true 60 | } 61 | } 62 | 63 | return false 64 | } 65 | 66 | public func all(_ elements: [T?], test: ((Any?) -> Bool)? = nil) -> Bool { 67 | for element in elements { 68 | if !truthy(element) { 69 | return false 70 | } 71 | } 72 | 73 | return true 74 | } 75 | 76 | public func any(_ elements: [T?], test: ((Any?) -> Bool) = truthy) -> Bool { 77 | for element in elements { 78 | if let element = element { 79 | if test(element as AnyObject?) { 80 | return true 81 | } 82 | } 83 | } 84 | 85 | return false 86 | } 87 | 88 | public extension Array { 89 | func all(_ predicate: (Iterator.Element) throws -> Bool = truthy) rethrows -> Bool { 90 | for element in self { 91 | guard try predicate(element) else { return false } 92 | } 93 | return true 94 | } 95 | 96 | func any(_ predicate: (Iterator.Element) throws -> Bool = truthy) rethrows -> Bool { 97 | for element in self { 98 | if let result = try? predicate(element), result { 99 | return true 100 | } 101 | } 102 | return false 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Main.swift 3 | // LionheartExtensions 4 | // 5 | // Created by Dan Loewenherz on 1/2/18. 6 | // 7 | 8 | import Foundation 9 | 10 | struct LionheartExtensions { 11 | static var sharedUIApplication: UIApplication? { 12 | guard let sharedApplication = UIApplication.perform(NSSelectorFromString("sharedApplication")).takeUnretainedValue() as? UIApplication else { 13 | return nil 14 | } 15 | 16 | return sharedApplication 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/Pods/LionheartExtensions/Pod/Classes/Summable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Summable.swift 3 | // Pods 4 | // 5 | // Created by Daniel Loewenherz on 1/16/17. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol ExpressibleByDecimal { 12 | var decimalNumber: NSDecimalNumber { get } 13 | static func makeFromNumber(_ number: NSNumber) -> Self 14 | } 15 | 16 | protocol NSNumberBridgeable: ExpressibleByIntegerLiteral, ExpressibleByDecimal { 17 | var number: NSNumber { get } 18 | init(_ number: NSNumber) 19 | } 20 | 21 | extension NSNumberBridgeable { 22 | public var decimalNumber: NSDecimalNumber { return NSDecimalNumber(decimal: number.decimalValue) } 23 | 24 | public static func makeFromNumber(_ number: NSNumber) -> Self { 25 | return Self(number) 26 | } 27 | } 28 | 29 | // 30 | 31 | extension Double: NSNumberBridgeable { 32 | var number: NSNumber { return self as NSNumber } 33 | } 34 | 35 | extension Float: NSNumberBridgeable { 36 | var number: NSNumber { return self as NSNumber } 37 | } 38 | 39 | // 40 | 41 | extension Int: NSNumberBridgeable { 42 | var number: NSNumber { return self as NSNumber } 43 | } 44 | 45 | extension Int8: NSNumberBridgeable { 46 | var number: NSNumber { return self as NSNumber } 47 | } 48 | 49 | extension Int16: NSNumberBridgeable { 50 | var number: NSNumber { return self as NSNumber } 51 | } 52 | 53 | extension Int32: NSNumberBridgeable { 54 | var number: NSNumber { return self as NSNumber } 55 | } 56 | 57 | extension Int64: NSNumberBridgeable { 58 | var number: NSNumber { return self as NSNumber } 59 | } 60 | 61 | extension UInt: NSNumberBridgeable { 62 | var number: NSNumber { return self as NSNumber } 63 | } 64 | 65 | extension UInt8: NSNumberBridgeable { 66 | var number: NSNumber { return self as NSNumber } 67 | } 68 | 69 | extension UInt16: NSNumberBridgeable { 70 | var number: NSNumber { return self as NSNumber } 71 | } 72 | 73 | extension UInt32: NSNumberBridgeable { 74 | var number: NSNumber { return self as NSNumber } 75 | } 76 | 77 | extension UInt64: NSNumberBridgeable { 78 | var number: NSNumber { return self as NSNumber } 79 | } 80 | 81 | extension NSDecimalNumber: ExpressibleByDecimal { 82 | public var decimalNumber: NSDecimalNumber { return self } 83 | 84 | public static func makeFromNumber(_ number: NSNumber) -> Self { 85 | return self.init(decimal: number.decimalValue) 86 | } 87 | } 88 | 89 | extension Array where Element: ExpressibleByDecimal { 90 | public var sum: Element { 91 | let value = reduce(0, { $1.decimalNumber.adding($0) }) 92 | return Element.makeFromNumber(value) 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/ConcentricProgressRingView.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ConcentricProgressRingView", 3 | "version": "2.0.2", 4 | "summary": "Fully customizable circular progress bar written in Swift", 5 | "homepage": "https://github.com/lionheart/ConcentricProgressRingView", 6 | "license": { 7 | "type": "Apache 2.0", 8 | "file": "LICENSE" 9 | }, 10 | "authors": { 11 | "Dan Loewenherz": "dan@lionheartsw.com" 12 | }, 13 | "source": { 14 | "git": "https://github.com/lionheart/ConcentricProgressRingView.git", 15 | "tag": "2.0.2" 16 | }, 17 | "social_media_url": "https://twitter.com/lionheartsw", 18 | "platforms": { 19 | "ios": "10.3" 20 | }, 21 | "pod_target_xcconfig": { 22 | "SWIFT_VERSION": "4.2" 23 | }, 24 | "source_files": "ConcentricProgressRingView/Classes/**/*", 25 | "dependencies": { 26 | "LionheartExtensions": [ 27 | 28 | ] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ConcentricProgressRingView (2.0.2): 3 | - LionheartExtensions 4 | - LionheartExtensions (5.0.2): 5 | - LionheartExtensions/Core (= 5.0.2) 6 | - LionheartExtensions/Core (5.0.2) 7 | - Nimble (7.3.4) 8 | - Quick (1.3.4) 9 | 10 | DEPENDENCIES: 11 | - ConcentricProgressRingView (from `../`) 12 | - LionheartExtensions 13 | - Nimble (~> 7) 14 | - Quick (~> 1) 15 | 16 | SPEC REPOS: 17 | https://github.com/cocoapods/specs.git: 18 | - LionheartExtensions 19 | - Nimble 20 | - Quick 21 | 22 | EXTERNAL SOURCES: 23 | ConcentricProgressRingView: 24 | :path: "../" 25 | 26 | SPEC CHECKSUMS: 27 | ConcentricProgressRingView: e123c811722e610aeeb40201abf033b23fd393aa 28 | LionheartExtensions: 09fa816d98176012c8f9adf7f21774f528dbc90e 29 | Nimble: 051e3d8912d40138fa5591c78594f95fb172af37 30 | Quick: f4f7f063c524394c73ed93ac70983c609805d481 31 | 32 | PODFILE CHECKSUM: 9870839634870d9146dc16ddb8cc0bbe0be1bb88 33 | 34 | COCOAPODS: 1.7.1 35 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Carthage/Checkouts/CwlCatchException/Sources/CwlCatchException/CwlCatchException.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CwlCatchException.swift 3 | // CwlAssertionTesting 4 | // 5 | // Created by Matt Gallagher on 2016/01/10. 6 | // Copyright © 2016 Matt Gallagher ( 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(_ type: T.Type, block: () -> Void) -> T? { 28 | return catchExceptionOfKind(type, block) as? T 29 | } 30 | 31 | extension NSException { 32 | public static func catchException(in block: () -> Void) -> Self? { 33 | return catchReturnTypeConverter(self, block: block) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Carthage/Checkouts/CwlCatchException/Sources/CwlCatchExceptionSupport/CwlCatchException.m: -------------------------------------------------------------------------------- 1 | // 2 | // CwlCatchException.m 3 | // CwlAssertionTesting 4 | // 5 | // Created by Matt Gallagher on 2016/01/10. 6 | // Copyright © 2016 Matt Gallagher ( 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/Carthage/Checkouts/CwlCatchException/Sources/CwlCatchExceptionSupport/include/CwlCatchException.h: -------------------------------------------------------------------------------- 1 | // 2 | // CwlCatchException.h 3 | // CwlCatchException 4 | // 5 | // Created by Matt Gallagher on 2016/01/10. 6 | // Copyright © 2016 Matt Gallagher ( 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 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Sources/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/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/include/CwlMachBadInstructionHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // CwlMachBadInstructionHandler.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/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CwlDarwinDefinitions.swift 3 | // CwlPreconditionTesting 4 | // 5 | // Created by Matt Gallagher on 2016/01/10. 6 | // Copyright © 2016 Matt Gallagher ( 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/Carthage/Checkouts/CwlPreconditionTesting/Sources/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 | extern bool _swift_reportFatalErrorsToDebugger; 24 | 25 | //! Project version number for CwlUtils. 26 | FOUNDATION_EXPORT double CwlPreconditionTestingVersionNumber; 27 | 28 | //! Project version string for CwlUtils. 29 | FOUNDATION_EXPORT const unsigned char CwlAssertingTestingVersionString[]; 30 | 31 | #include "CwlMachBadInstructionHandler.h" 32 | #include "CwlCatchException.h" 33 | -------------------------------------------------------------------------------- /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/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: NSObject { 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 | override 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 | super.init() 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /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 NMBPredicate { actualExpression in 63 | return try beAKindOf(expected).satisfies(actualExpression).toObjectiveC() 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 NMBPredicate { actualExpression in 52 | return try beAnInstanceOf(expected).satisfies(actualExpression).toObjectiveC() 53 | } 54 | } 55 | } 56 | #endif 57 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThan.swift: -------------------------------------------------------------------------------- 1 | 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 | let errorMessage = "be greater than <\(stringify(expectedValue))>" 17 | return Predicate.simple(errorMessage) { actualExpression in 18 | let actualValue = try actualExpression.evaluate() 19 | let matches = actualValue != nil 20 | && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedDescending 21 | return PredicateStatus(bool: matches) 22 | } 23 | } 24 | 25 | public func >(lhs: Expectation, rhs: T) { 26 | lhs.to(beGreaterThan(rhs)) 27 | } 28 | 29 | public func > (lhs: Expectation, rhs: NMBComparable?) { 30 | lhs.to(beGreaterThan(rhs)) 31 | } 32 | 33 | #if 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 | let message = "be greater than or equal to <\(stringify(expectedValue))>" 7 | return Predicate.simple(message) { actualExpression in 8 | let actualValue = try actualExpression.evaluate() 9 | if let actual = actualValue, let expected = expectedValue { 10 | return PredicateStatus(bool: actual >= expected) 11 | } 12 | return .fail 13 | } 14 | } 15 | 16 | /// A Nimble matcher that succeeds when the actual value is greater than 17 | /// or equal to the expected value. 18 | public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> Predicate { 19 | let message = "be greater than or equal to <\(stringify(expectedValue))>" 20 | return Predicate.simple(message) { actualExpression in 21 | let actualValue = try actualExpression.evaluate() 22 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) != ComparisonResult.orderedAscending 23 | return PredicateStatus(bool: matches) 24 | } 25 | } 26 | 27 | public func >=(lhs: Expectation, rhs: T) { 28 | lhs.to(beGreaterThanOrEqualTo(rhs)) 29 | } 30 | 31 | public func >=(lhs: Expectation, rhs: T) { 32 | lhs.to(beGreaterThanOrEqualTo(rhs)) 33 | } 34 | 35 | #if 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.define { actualExpression in 7 | #if os(Linux) 8 | #if swift(>=4.0) 9 | #if !swift(>=4.1.50) 10 | let actual = try actualExpression.evaluate() as? AnyObject 11 | #else 12 | let actual = try actualExpression.evaluate() as AnyObject? 13 | #endif 14 | #else 15 | #if !swift(>=3.4) 16 | let actual = try actualExpression.evaluate() as? AnyObject 17 | #else 18 | let actual = try actualExpression.evaluate() as AnyObject? 19 | #endif 20 | #endif 21 | #else 22 | let actual = try actualExpression.evaluate() as AnyObject? 23 | #endif 24 | 25 | let bool: Bool 26 | #if os(Linux) 27 | #if swift(>=4.0) 28 | #if !swift(>=4.1.50) 29 | bool = actual === (expected as? AnyObject) && actual !== nil 30 | #else 31 | bool = actual === (expected as AnyObject?) && actual !== nil 32 | #endif 33 | #else 34 | #if !swift(>=3.4) 35 | bool = actual === (expected as? AnyObject) && actual !== nil 36 | #else 37 | bool = actual === (expected as AnyObject?) && actual !== nil 38 | #endif 39 | #endif 40 | #else 41 | bool = actual === (expected as AnyObject?) && actual !== nil 42 | #endif 43 | return PredicateResult( 44 | bool: bool, 45 | message: .expectedCustomValueTo( 46 | "be identical to \(identityAsString(expected))", 47 | "\(identityAsString(actual))" 48 | ) 49 | ) 50 | } 51 | } 52 | 53 | public func === (lhs: Expectation, rhs: Any?) { 54 | lhs.to(beIdenticalTo(rhs)) 55 | } 56 | public func !== (lhs: Expectation, rhs: Any?) { 57 | lhs.toNot(beIdenticalTo(rhs)) 58 | } 59 | 60 | /// A Nimble matcher that succeeds when the actual value is the same instance 61 | /// as the expected instance. 62 | /// 63 | /// Alias for "beIdenticalTo". 64 | public func be(_ expected: Any?) -> Predicate { 65 | return beIdenticalTo(expected) 66 | } 67 | 68 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 69 | extension NMBObjCMatcher { 70 | @objc public class func beIdenticalToMatcher(_ expected: NSObject?) -> NMBObjCMatcher { 71 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 72 | let aExpr = actualExpression.cast { $0 as Any? } 73 | return try beIdenticalTo(expected).matches(aExpr, failureMessage: failureMessage) 74 | } 75 | } 76 | } 77 | #endif 78 | -------------------------------------------------------------------------------- /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 | let message = "be less than <\(stringify(expectedValue))>" 6 | return Predicate.simple(message) { 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 less than the expected value. 15 | public func beLessThan(_ expectedValue: NMBComparable?) -> Predicate { 16 | let message = "be less than <\(stringify(expectedValue))>" 17 | return Predicate.simple(message) { actualExpression in 18 | let actualValue = try actualExpression.evaluate() 19 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedAscending 20 | return PredicateStatus(bool: matches) 21 | } 22 | } 23 | 24 | public func <(lhs: Expectation, rhs: T) { 25 | lhs.to(beLessThan(rhs)) 26 | } 27 | 28 | public func < (lhs: Expectation, rhs: NMBComparable?) { 29 | lhs.to(beLessThan(rhs)) 30 | } 31 | 32 | #if 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.simple("be less than or equal to <\(stringify(expectedValue))>") { 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 less than 15 | /// or equal to the expected value. 16 | public func beLessThanOrEqualTo(_ expectedValue: T?) -> Predicate { 17 | return Predicate.simple("be less than or equal to <\(stringify(expectedValue))>") { actualExpression in 18 | let actualValue = try actualExpression.evaluate() 19 | let matches = actualValue.map { $0.NMB_compare(expectedValue) != .orderedDescending } ?? false 20 | return PredicateStatus(bool: matches) 21 | } 22 | } 23 | 24 | public func <=(lhs: Expectation, rhs: T) { 25 | lhs.to(beLessThanOrEqualTo(rhs)) 26 | } 27 | 28 | public func <=(lhs: Expectation, rhs: T) { 29 | lhs.to(beLessThanOrEqualTo(rhs)) 30 | } 31 | 32 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 33 | extension NMBObjCMatcher { 34 | @objc public class func beLessThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBObjCMatcher { 35 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 36 | let expr = actualExpression.cast { $0 as? NMBComparable } 37 | return try beLessThanOrEqualTo(expected).matches(expr, failureMessage: failureMessage) 38 | } 39 | } 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /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.simpleNilable("be void") { actualExpression in 6 | let actualValue: ()? = try actualExpression.evaluate() 7 | return PredicateStatus(bool: actualValue != nil) 8 | } 9 | } 10 | 11 | public func == (lhs: Expectation<()>, rhs: ()) { 12 | lhs.to(beVoid()) 13 | } 14 | 15 | public func != (lhs: Expectation<()>, rhs: ()) { 16 | lhs.toNot(beVoid()) 17 | } 18 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/BeginWith.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual sequence's first element 4 | /// is equal to the expected value. 5 | public func beginWith(_ startingElement: 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 | return PredicateStatus(bool: actual.hasPrefix(startingSubstring)) 39 | } 40 | return .fail 41 | } 42 | } 43 | 44 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 45 | extension NMBObjCMatcher { 46 | @objc public class func beginWithMatcher(_ expected: Any) -> NMBObjCMatcher { 47 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 48 | let actual = try actualExpression.evaluate() 49 | if (actual as? String) != nil { 50 | let expr = actualExpression.cast { $0 as? String } 51 | return try beginWith(expected as! String).matches(expr, failureMessage: failureMessage) 52 | } else { 53 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection } 54 | return try beginWith(expected).matches(expr, failureMessage: failureMessage) 55 | } 56 | } 57 | } 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /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.define { actualExpression in 6 | let message: ExpectationMessage 7 | if predicateDescription == "" { 8 | message = .expectedTo("find object in collection that satisfies predicate") 9 | } else { 10 | message = .expectedTo("find object in collection \(predicateDescription)") 11 | } 12 | 13 | if let sequence = try actualExpression.evaluate() { 14 | for object in sequence { 15 | if predicate(object) { 16 | return PredicateResult(bool: true, message: message) 17 | } 18 | } 19 | 20 | return PredicateResult(bool: false, message: message) 21 | } 22 | 23 | return PredicateResult(status: .fail, message: message) 24 | } 25 | } 26 | 27 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 28 | extension NMBObjCMatcher { 29 | @objc public class func containElementSatisfyingMatcher(_ predicate: @escaping ((NSObject) -> Bool)) -> NMBObjCMatcher { 30 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 31 | let value = try actualExpression.evaluate() 32 | guard let enumeration = value as? NSFastEnumeration else { 33 | // swiftlint:disable:next line_length 34 | failureMessage.postfixMessage = "containElementSatisfying must be provided an NSFastEnumeration object" 35 | failureMessage.actualValue = nil 36 | failureMessage.expected = "" 37 | failureMessage.to = "" 38 | return false 39 | } 40 | 41 | var iterator = NSFastEnumerationIterator(enumeration) 42 | while let item = iterator.next() { 43 | guard let object = item as? NSObject else { 44 | continue 45 | } 46 | 47 | if predicate(object) { 48 | return true 49 | } 50 | } 51 | 52 | failureMessage.actualValue = nil 53 | failureMessage.postfixMessage = "find object in collection that satisfies predicate" 54 | return false 55 | } 56 | } 57 | } 58 | #endif 59 | -------------------------------------------------------------------------------- /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.simple("end with <\(endingElement)>") { actualExpression in 8 | if let actualValue = try actualExpression.evaluate() { 9 | var actualGenerator = actualValue.makeIterator() 10 | var lastItem: T? 11 | var item: T? 12 | repeat { 13 | lastItem = item 14 | item = actualGenerator.next() 15 | } while(item != nil) 16 | 17 | return PredicateStatus(bool: lastItem == endingElement) 18 | } 19 | return .fail 20 | } 21 | } 22 | 23 | /// A Nimble matcher that succeeds when the actual collection's last element 24 | /// is equal to the expected object. 25 | public func endWith(_ endingElement: Any) -> Predicate { 26 | return Predicate.simple("end with <\(endingElement)>") { actualExpression in 27 | guard let collection = try actualExpression.evaluate() else { return .fail } 28 | guard collection.count > 0 else { return PredicateStatus(bool: false) } 29 | #if os(Linux) 30 | guard let collectionValue = collection.object(at: collection.count - 1) as? NSObject else { 31 | return .fail 32 | } 33 | #else 34 | let collectionValue = collection.object(at: collection.count - 1) as AnyObject 35 | #endif 36 | 37 | return PredicateStatus(bool: collectionValue.isEqual(endingElement)) 38 | } 39 | } 40 | 41 | /// A Nimble matcher that succeeds when the actual string contains the expected substring 42 | /// where the expected substring's location is the actual string's length minus the 43 | /// expected substring's length. 44 | public func endWith(_ endingSubstring: String) -> Predicate { 45 | return Predicate.simple("end with <\(endingSubstring)>") { actualExpression in 46 | if let collection = try actualExpression.evaluate() { 47 | return PredicateStatus(bool: collection.hasSuffix(endingSubstring)) 48 | } 49 | return .fail 50 | } 51 | } 52 | 53 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 54 | extension NMBObjCMatcher { 55 | @objc public class func endWithMatcher(_ expected: Any) -> NMBObjCMatcher { 56 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 57 | let actual = try actualExpression.evaluate() 58 | if (actual as? String) != nil { 59 | let expr = actualExpression.cast { $0 as? String } 60 | return try endWith(expected as! String).matches(expr, failureMessage: failureMessage) 61 | } else { 62 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection } 63 | return try endWith(expected).matches(expr, failureMessage: failureMessage) 64 | } 65 | } 66 | } 67 | } 68 | #endif 69 | -------------------------------------------------------------------------------- /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.define { actualExpression in 12 | if let actualValue = try actualExpression.evaluate() { 13 | let message = ExpectationMessage 14 | .expectedCustomValueTo( 15 | "have \(prettyCollectionType(actualValue)) with count \(stringify(expectedValue))", 16 | "\(actualValue.count)" 17 | ) 18 | .appended(details: "Actual Value: \(stringify(actualValue))") 19 | 20 | let result = expectedValue == actualValue.count 21 | return PredicateResult(bool: result, message: message) 22 | } else { 23 | return PredicateResult(status: .fail, message: .fail("")) 24 | } 25 | } 26 | } 27 | 28 | /// A Nimble matcher that succeeds when the actual collection's count equals 29 | /// the expected value 30 | public func haveCount(_ expectedValue: Int) -> Predicate { 31 | return Predicate { actualExpression in 32 | if let actualValue = try actualExpression.evaluate() { 33 | let message = ExpectationMessage 34 | .expectedCustomValueTo( 35 | "have \(prettyCollectionType(actualValue)) with count \(stringify(expectedValue))", 36 | "\(actualValue.count)" 37 | ) 38 | .appended(details: "Actual Value: \(stringify(actualValue))") 39 | 40 | let result = expectedValue == actualValue.count 41 | return PredicateResult(bool: result, message: message) 42 | } else { 43 | return PredicateResult(status: .fail, message: .fail("")) 44 | } 45 | } 46 | } 47 | 48 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 49 | extension NMBObjCMatcher { 50 | @objc public class func haveCountMatcher(_ expected: NSNumber) -> NMBObjCMatcher { 51 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 52 | let location = actualExpression.location 53 | let actualValue = try actualExpression.evaluate() 54 | if let value = actualValue as? NMBCollection { 55 | let expr = Expression(expression: ({ value as NMBCollection}), location: location) 56 | return try haveCount(expected.intValue).matches(expr, failureMessage: failureMessage) 57 | } else if let actualValue = actualValue { 58 | failureMessage.postfixMessage = "get type of NSArray, NSSet, NSDictionary, or NSHashTable" 59 | failureMessage.actualValue = "\(String(describing: type(of: actualValue)))" 60 | } 61 | return false 62 | } 63 | } 64 | } 65 | #endif 66 | -------------------------------------------------------------------------------- /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.simple("match <\(stringify(expectedValue))>") { actualExpression in 7 | if let actual = try actualExpression.evaluate() { 8 | if let regexp = expectedValue { 9 | let bool = actual.range(of: regexp, options: .regularExpression) != nil 10 | return PredicateStatus(bool: bool) 11 | } 12 | } 13 | 14 | return .fail 15 | } 16 | } 17 | 18 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 19 | 20 | extension NMBObjCMatcher { 21 | @objc public class func matchMatcher(_ expected: NSString) -> NMBMatcher { 22 | return NMBPredicate { actualExpression in 23 | let actual = actualExpression.cast { $0 as? String } 24 | return try match(expected.description).satisfies(actual).toObjectiveC() 25 | } 26 | } 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /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.define { actualExpression in 10 | let actualError = try actualExpression.evaluate() 11 | 12 | let failureMessage = FailureMessage() 13 | setFailureMessageForError( 14 | failureMessage, 15 | postfixMessageVerb: "match", 16 | actualError: actualError, 17 | error: error 18 | ) 19 | 20 | var matches = false 21 | if let actualError = actualError, errorMatchesExpectedError(actualError, expectedError: error) { 22 | matches = true 23 | } 24 | 25 | return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) 26 | } 27 | } 28 | 29 | /// A Nimble matcher that succeeds when the actual expression evaluates to an 30 | /// error from the specified case. 31 | /// 32 | /// Errors are tried to be compared by their implementation of Equatable, 33 | /// otherwise they fallback to comparision by _domain and _code. 34 | public func matchError(_ error: T) -> Predicate { 35 | return Predicate.define { actualExpression in 36 | let actualError = try actualExpression.evaluate() 37 | 38 | let failureMessage = FailureMessage() 39 | setFailureMessageForError( 40 | failureMessage, 41 | postfixMessageVerb: "match", 42 | actualError: actualError, 43 | error: error 44 | ) 45 | 46 | var matches = false 47 | if let actualError = actualError as? T, error == actualError { 48 | matches = true 49 | } 50 | 51 | return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) 52 | } 53 | } 54 | 55 | /// A Nimble matcher that succeeds when the actual expression evaluates to an 56 | /// error of the specified type 57 | public func matchError(_ errorType: T.Type) -> Predicate { 58 | return Predicate.define { actualExpression in 59 | let actualError = try actualExpression.evaluate() 60 | 61 | let failureMessage = FailureMessage() 62 | setFailureMessageForError( 63 | failureMessage, 64 | postfixMessageVerb: "match", 65 | actualError: actualError, 66 | errorType: errorType 67 | ) 68 | 69 | var matches = false 70 | if actualError as? T != nil { 71 | matches = true 72 | } 73 | 74 | return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/Nimble/Matchers/ThrowAssertion.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public func throwAssertion() -> Predicate { 4 | return Predicate { actualExpression in 5 | #if arch(x86_64) && (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE 6 | let message = ExpectationMessage.expectedTo("throw an assertion") 7 | 8 | var actualError: Error? 9 | let caughtException: BadInstructionException? = catchBadInstruction { 10 | #if os(tvOS) 11 | if !NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning { 12 | print() 13 | print("[Nimble Warning]: If you're getting stuck on a debugger breakpoint for a " + 14 | "fatal error while using throwAssertion(), please disable 'Debug Executable' " + 15 | "in your scheme. Go to 'Edit Scheme > Test > Info' and uncheck " + 16 | "'Debug Executable'. If you've already done that, suppress this warning " + 17 | "by setting `NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true`. " + 18 | "This is required because the standard methods of catching assertions " + 19 | "(mach APIs) are unavailable for tvOS. Instead, the same mechanism the " + 20 | "debugger uses is the fallback method for tvOS." 21 | ) 22 | print() 23 | NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true 24 | } 25 | #endif 26 | do { 27 | try actualExpression.evaluate() 28 | } catch { 29 | actualError = error 30 | } 31 | } 32 | 33 | if let actualError = actualError { 34 | return PredicateResult( 35 | bool: false, 36 | message: message.appended(message: "; threw error instead <\(actualError)>") 37 | ) 38 | } else { 39 | return PredicateResult(bool: caughtException != nil, message: message) 40 | } 41 | #elseif SWIFT_PACKAGE 42 | fatalError("The throwAssertion Nimble matcher does not currently support Swift CLI." + 43 | " You can silence this error by placing the test case inside an #if !SWIFT_PACKAGE" + 44 | " conditional statement") 45 | #else 46 | fatalError("The throwAssertion Nimble matcher can only run on x86_64 platforms with " + 47 | "Objective-C (e.g. Mac, iPhone 5s or later simulators). You can silence this error " + 48 | "by placing the test case inside an #if arch(x86_64) or (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) conditional statement") 49 | // swiftlint:disable:previous line_length 50 | #endif 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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 | #if TARGET_OS_TV 7 | #import "CwlPreconditionTesting_POSIX.h" 8 | #else 9 | #import "CwlPreconditionTesting.h" 10 | #endif 11 | 12 | FOUNDATION_EXPORT double NimbleVersionNumber; 13 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[]; 14 | -------------------------------------------------------------------------------- /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/NMBExceptionCapture.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface NMBExceptionCapture : NSObject 5 | 6 | - (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)(void))finally; 7 | - (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock NS_SWIFT_NAME(tryBlock(_:)); 8 | 9 | @end 10 | 11 | typedef void(^NMBSourceCallbackBlock)(BOOL successful); 12 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.m: -------------------------------------------------------------------------------- 1 | #import "NMBExceptionCapture.h" 2 | 3 | @interface NMBExceptionCapture () 4 | @property (nonatomic, copy) void(^ _Nullable handler)(NSException * _Nullable); 5 | @property (nonatomic, copy) void(^ _Nullable finally)(void); 6 | @end 7 | 8 | @implementation NMBExceptionCapture 9 | 10 | - (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)(void))finally { 11 | self = [super init]; 12 | if (self) { 13 | self.handler = handler; 14 | self.finally = finally; 15 | } 16 | return self; 17 | } 18 | 19 | - (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock { 20 | @try { 21 | unsafeBlock(); 22 | } 23 | @catch (NSException *exception) { 24 | if (self.handler) { 25 | self.handler(exception); 26 | } 27 | } 28 | @finally { 29 | if (self.finally) { 30 | self.finally(); 31 | } 32 | } 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.h: -------------------------------------------------------------------------------- 1 | @class NSString; 2 | 3 | /** 4 | * Returns a string appropriate for displaying in test output 5 | * from the provided value. 6 | * 7 | * @param anyObject A value that will show up in a test's output. 8 | * 9 | * @return The string that is returned can be 10 | * customized per type by conforming a type to the `TestOutputStringConvertible` 11 | * protocol. When stringifying a non-`TestOutputStringConvertible` type, this 12 | * function will return the value's debug description and then its 13 | * normal description if available and in that order. Otherwise it 14 | * will return the result of constructing a string from the value. 15 | * 16 | * @see `TestOutputStringConvertible` 17 | */ 18 | extern NSString *_Nonnull NMBStringify(id _Nullable anyObject) __attribute__((warn_unused_result)); 19 | -------------------------------------------------------------------------------- /Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.m: -------------------------------------------------------------------------------- 1 | #import "NMBStringify.h" 2 | 3 | #if __has_include("Nimble-Swift.h") 4 | #import "Nimble-Swift.h" 5 | #else 6 | #import 7 | #endif 8 | 9 | NSString *_Nonnull NMBStringify(id _Nullable anyObject) { 10 | return [NMBStringer stringify:anyObject]; 11 | } 12 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | public 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/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 | extension NSString { 5 | private static var invalidCharacters: CharacterSet = { 6 | var invalidCharacters = CharacterSet() 7 | 8 | let invalidCharacterSets: [CharacterSet] = [ 9 | .whitespacesAndNewlines, 10 | .illegalCharacters, 11 | .controlCharacters, 12 | .punctuationCharacters, 13 | .nonBaseCharacters, 14 | .symbols 15 | ] 16 | 17 | for invalidSet in invalidCharacterSets { 18 | invalidCharacters.formUnion(invalidSet) 19 | } 20 | 21 | return invalidCharacters 22 | }() 23 | 24 | /// This API is not meant to be used outside Quick, so will be unavaialbe in 25 | /// a next major version. 26 | @objc(qck_c99ExtendedIdentifier) 27 | public var c99ExtendedIdentifier: String { 28 | let validComponents = components(separatedBy: NSString.invalidCharacters) 29 | let result = validComponents.joined(separator: "_") 30 | 31 | return result.isEmpty ? "_" : result 32 | } 33 | } 34 | 35 | /// Extension methods or properties for NSObject subclasses are invisible from 36 | /// the Objective-C runtime on static linking unless the consumers add `-ObjC` 37 | /// linker flag, so let's make a wrapper class to mitigate that situation. 38 | /// 39 | /// See: https://github.com/Quick/Quick/issues/785 and https://github.com/Quick/Quick/pull/803 40 | @objc 41 | class QCKObjCStringUtils: NSObject { 42 | override private init() {} 43 | 44 | @objc 45 | static func c99ExtendedIdentifier(from string: String) -> String { 46 | return string.c99ExtendedIdentifier 47 | } 48 | } 49 | #endif 50 | -------------------------------------------------------------------------------- /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 3 | 4 | #if __has_include("Quick-Swift.h") 5 | #import "Quick-Swift.h" 6 | #else 7 | #import 8 | #endif 9 | 10 | typedef void (^QCKClassEnumerationBlock)(Class klass); 11 | 12 | /** 13 | Finds all direct subclasses of the given class and passes them to the block provided. 14 | The classes are iterated over in the order that objc_getClassList returns them. 15 | 16 | @param klass The base class to find subclasses of. 17 | @param block A block that takes a Class. This block will be executed once for each subclass of klass. 18 | */ 19 | void qck_enumerateSubclasses(Class klass, QCKClassEnumerationBlock block) { 20 | Class *classes = NULL; 21 | int classesCount = objc_getClassList(NULL, 0); 22 | 23 | if (classesCount > 0) { 24 | classes = (Class *)calloc(sizeof(Class), classesCount); 25 | classesCount = objc_getClassList(classes, classesCount); 26 | 27 | Class subclass, superclass; 28 | for(int i = 0; i < classesCount; i++) { 29 | subclass = classes[i]; 30 | superclass = class_getSuperclass(subclass); 31 | if (superclass == klass && block) { 32 | block(subclass); 33 | } 34 | } 35 | 36 | free(classes); 37 | } 38 | } 39 | 40 | @implementation QuickConfiguration 41 | 42 | #pragma mark - Object Lifecycle 43 | 44 | /** 45 | QuickConfiguration is not meant to be instantiated; it merely provides a hook 46 | for users to configure how Quick behaves. Raise an exception if an instance of 47 | QuickConfiguration is created. 48 | */ 49 | - (instancetype)init { 50 | NSString *className = NSStringFromClass([self class]); 51 | NSString *selectorName = NSStringFromSelector(@selector(configure:)); 52 | [NSException raise:NSInternalInconsistencyException 53 | format:@"%@ is not meant to be instantiated; " 54 | @"subclass %@ and override %@ to configure Quick.", 55 | className, className, selectorName]; 56 | return nil; 57 | } 58 | 59 | #pragma mark - NSObject Overrides 60 | 61 | /** 62 | Hook into when QuickConfiguration is initialized in the runtime in order to 63 | call +[QuickConfiguration configure:] on each of its subclasses. 64 | */ 65 | + (void)initialize { 66 | // Only enumerate over the subclasses of QuickConfiguration, not any of its subclasses. 67 | if ([self class] == [QuickConfiguration class]) { 68 | 69 | // Only enumerate over subclasses once, even if +[QuickConfiguration initialize] 70 | // were to be called several times. This is necessary because +[QuickSpec initialize] 71 | // manually calls +[QuickConfiguration initialize]. 72 | static dispatch_once_t onceToken; 73 | dispatch_once(&onceToken, ^{ 74 | qck_enumerateSubclasses([QuickConfiguration class], ^(__unsafe_unretained Class klass) { 75 | [[World sharedWorld] configure:^(Configuration *configuration) { 76 | [klass configure:configuration]; 77 | }]; 78 | }); 79 | [[World sharedWorld] finalizeConfiguration]; 80 | }); 81 | } 82 | } 83 | 84 | #pragma mark - Public Interface 85 | 86 | + (void)configure:(Configuration *)configuration { } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/QuickObjectiveC/DSL/QCKDSL.m: -------------------------------------------------------------------------------- 1 | #import "QCKDSL.h" 2 | 3 | #if __has_include("Quick-Swift.h") 4 | #import "Quick-Swift.h" 5 | #else 6 | #import 7 | #endif 8 | 9 | void qck_beforeSuite(QCKDSLEmptyBlock closure) { 10 | [[World sharedWorld] beforeSuite:closure]; 11 | } 12 | 13 | void qck_afterSuite(QCKDSLEmptyBlock closure) { 14 | [[World sharedWorld] afterSuite:closure]; 15 | } 16 | 17 | void qck_sharedExamples(NSString *name, QCKDSLSharedExampleBlock closure) { 18 | [[World sharedWorld] sharedExamples:name closure:closure]; 19 | } 20 | 21 | void qck_describe(NSString *description, QCKDSLEmptyBlock closure) { 22 | [[World sharedWorld] describe:description flags:@{} closure:closure]; 23 | } 24 | 25 | void qck_context(NSString *description, QCKDSLEmptyBlock closure) { 26 | qck_describe(description, closure); 27 | } 28 | 29 | void qck_beforeEach(QCKDSLEmptyBlock closure) { 30 | [[World sharedWorld] beforeEach:closure]; 31 | } 32 | 33 | void qck_beforeEachWithMetadata(QCKDSLExampleMetadataBlock closure) { 34 | [[World sharedWorld] beforeEachWithMetadata:closure]; 35 | } 36 | 37 | void qck_afterEach(QCKDSLEmptyBlock closure) { 38 | [[World sharedWorld] afterEach:closure]; 39 | } 40 | 41 | void qck_afterEachWithMetadata(QCKDSLExampleMetadataBlock closure) { 42 | [[World sharedWorld] afterEachWithMetadata:closure]; 43 | } 44 | 45 | QCKItBlock qck_it_builder(NSDictionary *flags, NSString *file, NSUInteger line) { 46 | return ^(NSString *description, QCKDSLEmptyBlock closure) { 47 | [[World sharedWorld] itWithDescription:description 48 | flags:flags 49 | file:file 50 | line:line 51 | closure:closure]; 52 | }; 53 | } 54 | 55 | QCKItBehavesLikeBlock qck_itBehavesLike_builder(NSDictionary *flags, NSString *file, NSUInteger line) { 56 | return ^(NSString *name, QCKDSLSharedExampleContext context) { 57 | [[World sharedWorld] itBehavesLikeSharedExampleNamed:name 58 | sharedExampleContext:context 59 | flags:flags 60 | file:file 61 | line:line]; 62 | }; 63 | } 64 | 65 | void qck_pending(NSString *description, QCKDSLEmptyBlock closure) { 66 | [[World sharedWorld] pending:description closure:closure]; 67 | } 68 | 69 | void qck_xdescribe(NSString *description, QCKDSLEmptyBlock closure) { 70 | [[World sharedWorld] xdescribe:description flags:@{} closure:closure]; 71 | } 72 | 73 | void qck_xcontext(NSString *description, QCKDSLEmptyBlock closure) { 74 | qck_xdescribe(description, closure); 75 | } 76 | 77 | void qck_fdescribe(NSString *description, QCKDSLEmptyBlock closure) { 78 | [[World sharedWorld] fdescribe:description flags:@{} closure:closure]; 79 | } 80 | 81 | void qck_fcontext(NSString *description, QCKDSLEmptyBlock closure) { 82 | qck_fdescribe(description, closure); 83 | } 84 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/QuickObjectiveC/Quick.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for Quick. 4 | FOUNDATION_EXPORT double QuickVersionNumber; 5 | 6 | //! Project version string for Quick. 7 | FOUNDATION_EXPORT const unsigned char QuickVersionString[]; 8 | 9 | #import "QuickSpec.h" 10 | #import "QCKDSL.h" 11 | #import "QuickConfiguration.h" 12 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/QuickObjectiveC/QuickSpec.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | QuickSpec is a base class all specs written in Quick inherit from. 5 | They need to inherit from QuickSpec, a subclass of XCTestCase, in 6 | order to be discovered by the XCTest framework. 7 | 8 | XCTest automatically compiles a list of XCTestCase subclasses included 9 | in the test target. It iterates over each class in that list, and creates 10 | a new instance of that class for each test method. It then creates an 11 | "invocation" to execute that test method. The invocation is an instance of 12 | NSInvocation, which represents a single message send in Objective-C. 13 | The invocation is set on the XCTestCase instance, and the test is run. 14 | 15 | Most of the code in QuickSpec is dedicated to hooking into XCTest events. 16 | First, when the spec is first loaded and before it is sent any messages, 17 | the +[NSObject initialize] method is called. QuickSpec overrides this method 18 | to call +[QuickSpec spec]. This builds the example group stacks and 19 | registers them with Quick.World, a global register of examples. 20 | 21 | Then, XCTest queries QuickSpec for a list of test methods. Normally, XCTest 22 | automatically finds all methods whose selectors begin with the string "test". 23 | However, QuickSpec overrides this default behavior by implementing the 24 | +[XCTestCase testInvocations] method. This method iterates over each example 25 | registered in Quick.World, defines a new method for that example, and 26 | returns an invocation to call that method to XCTest. Those invocations are 27 | the tests that are run by XCTest. Their selector names are displayed in 28 | the Xcode test navigation bar. 29 | */ 30 | @interface QuickSpec : XCTestCase 31 | 32 | /** 33 | Override this method in your spec to define a set of example groups 34 | and examples. 35 | 36 | @code 37 | override func spec() { 38 | describe("winter") { 39 | it("is coming") { 40 | // ... 41 | } 42 | } 43 | } 44 | @endcode 45 | 46 | See DSL.swift for more information on what syntax is available. 47 | */ 48 | - (void)spec; 49 | 50 | /** 51 | Returns the currently executing spec. Use in specs that require XCTestCase 52 | methds, e.g. expectationWithDescription. 53 | */ 54 | @property (class, nonatomic, readonly) QuickSpec *current; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/Pods/Quick/Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #if __has_include("Quick-Swift.h") 5 | #import "Quick-Swift.h" 6 | #else 7 | #import 8 | #endif 9 | 10 | @interface XCTestSuite (QuickTestSuiteBuilder) 11 | @end 12 | 13 | @implementation XCTestSuite (QuickTestSuiteBuilder) 14 | 15 | /** 16 | In order to ensure we can correctly build dynamic test suites, we need to 17 | replace some of the default test suite constructors. 18 | */ 19 | + (void)load { 20 | Method testCaseWithName = class_getClassMethod(self, @selector(testSuiteForTestCaseWithName:)); 21 | Method hooked_testCaseWithName = class_getClassMethod(self, @selector(qck_hooked_testSuiteForTestCaseWithName:)); 22 | method_exchangeImplementations(testCaseWithName, hooked_testCaseWithName); 23 | } 24 | 25 | /** 26 | The `+testSuiteForTestCaseWithName:` method is called when a specific test case 27 | class is run from the Xcode test navigator. If the built test suite is `nil`, 28 | Xcode will not run any tests for that test case. 29 | 30 | Given if the following test case class is run from the Xcode test navigator: 31 | 32 | FooSpec 33 | testFoo 34 | testBar 35 | 36 | XCTest will invoke this once per test case, with test case names following this format: 37 | 38 | FooSpec/testFoo 39 | FooSpec/testBar 40 | */ 41 | + (nullable instancetype)qck_hooked_testSuiteForTestCaseWithName:(nonnull NSString *)name { 42 | return [QuickTestSuite selectedTestSuiteForTestCaseWithName:name]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Example/Pods/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/Target Support Files/ConcentricProgressRingView/ConcentricProgressRingView-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.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ConcentricProgressRingView/ConcentricProgressRingView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_ConcentricProgressRingView : NSObject 3 | @end 4 | @implementation PodsDummy_ConcentricProgressRingView 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ConcentricProgressRingView/ConcentricProgressRingView-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/ConcentricProgressRingView/ConcentricProgressRingView-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 ConcentricProgressRingViewVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char ConcentricProgressRingViewVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ConcentricProgressRingView/ConcentricProgressRingView.modulemap: -------------------------------------------------------------------------------- 1 | framework module ConcentricProgressRingView { 2 | umbrella header "ConcentricProgressRingView-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ConcentricProgressRingView/ConcentricProgressRingView.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ConcentricProgressRingView 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 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 | SWIFT_VERSION = 4.2 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ConcentricProgressRingView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LionheartExtensions/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.11.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LionheartExtensions/LionheartExtensions-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 5.0.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LionheartExtensions/LionheartExtensions-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_LionheartExtensions : NSObject 3 | @end 4 | @implementation PodsDummy_LionheartExtensions 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LionheartExtensions/LionheartExtensions-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/LionheartExtensions/LionheartExtensions-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 LionheartExtensionsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char LionheartExtensionsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LionheartExtensions/LionheartExtensions.modulemap: -------------------------------------------------------------------------------- 1 | framework module LionheartExtensions { 2 | umbrella header "LionheartExtensions-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LionheartExtensions/LionheartExtensions.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/LionheartExtensions 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /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.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | 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.3.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Nimble : NSObject 3 | @end 4 | @implementation PodsDummy_Nimble 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Nimble/Nimble-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "Nimble.h" 14 | #import "DSL.h" 15 | #import "NMBExceptionCapture.h" 16 | #import "NMBStringify.h" 17 | #import "CwlCatchException.h" 18 | #import "CwlMachBadInstructionHandler.h" 19 | #import "mach_excServer.h" 20 | #import "CwlPreconditionTesting.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 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Nimble 3 | ENABLE_BITCODE = NO 4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -weak-lswiftXCTest -weak_framework "XCTest" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS $(inherited) -suppress-warnings 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-ConcentricProgressRingView_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-ConcentricProgressRingView_Example/Pods-ConcentricProgressRingView_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-ConcentricProgressRingView_Example/Pods-ConcentricProgressRingView_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ConcentricProgressRingView_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ConcentricProgressRingView_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ConcentricProgressRingView_Example/Pods-ConcentricProgressRingView_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_ConcentricProgressRingView_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ConcentricProgressRingView_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ConcentricProgressRingView_Example/Pods-ConcentricProgressRingView_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ConcentricProgressRingView" "${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ConcentricProgressRingView/ConcentricProgressRingView.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions/LionheartExtensions.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ConcentricProgressRingView" -framework "LionheartExtensions" 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-ConcentricProgressRingView_Example/Pods-ConcentricProgressRingView_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ConcentricProgressRingView_Example { 2 | umbrella header "Pods-ConcentricProgressRingView_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ConcentricProgressRingView_Example/Pods-ConcentricProgressRingView_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ConcentricProgressRingView" "${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ConcentricProgressRingView/ConcentricProgressRingView.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions/LionheartExtensions.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ConcentricProgressRingView" -framework "LionheartExtensions" 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-ConcentricProgressRingView_ExampleTests/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-ConcentricProgressRingView_ExampleTests/Pods-ConcentricProgressRingView_ExampleTests-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-ConcentricProgressRingView_ExampleTests/Pods-ConcentricProgressRingView_ExampleTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ConcentricProgressRingView_ExampleTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ConcentricProgressRingView_ExampleTests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ConcentricProgressRingView_ExampleTests/Pods-ConcentricProgressRingView_ExampleTests-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_ConcentricProgressRingView_ExampleTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ConcentricProgressRingView_ExampleTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ConcentricProgressRingView_ExampleTests/Pods-ConcentricProgressRingView_ExampleTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/ConcentricProgressRingView" "${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble" "${PODS_CONFIGURATION_BUILD_DIR}/Quick" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ConcentricProgressRingView/ConcentricProgressRingView.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions/LionheartExtensions.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble/Nimble.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Quick/Quick.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ConcentricProgressRingView" -framework "LionheartExtensions" -framework "Nimble" -framework "Quick" -framework "XCTest" -weak_framework "XCTest" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ConcentricProgressRingView_ExampleTests/Pods-ConcentricProgressRingView_ExampleTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ConcentricProgressRingView_ExampleTests { 2 | umbrella header "Pods-ConcentricProgressRingView_ExampleTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ConcentricProgressRingView_ExampleTests/Pods-ConcentricProgressRingView_ExampleTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/ConcentricProgressRingView" "${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble" "${PODS_CONFIGURATION_BUILD_DIR}/Quick" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ConcentricProgressRingView/ConcentricProgressRingView.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LionheartExtensions/LionheartExtensions.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble/Nimble.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Quick/Quick.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ConcentricProgressRingView" -framework "LionheartExtensions" -framework "Nimble" -framework "Quick" -framework "XCTest" -weak_framework "XCTest" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_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-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.3.4 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 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Quick 3 | ENABLE_BITCODE = NO 4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -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 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'jazzy', "~> 0.9" 4 | gem 'cocoapods', "~> 1.0" 5 | gem 'xcpretty', "~> 0.2" 6 | gem 'yarn', "~> 0.1" 7 | gem 'rack', "~> 2.0.6" 8 | gem 'ffi', "~> 1.9.24" 9 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.0) 5 | activesupport (4.2.11.1) 6 | i18n (~> 0.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | atomos (0.1.3) 11 | claide (1.0.2) 12 | cocoapods (1.7.1) 13 | activesupport (>= 4.0.2, < 5) 14 | claide (>= 1.0.2, < 2.0) 15 | cocoapods-core (= 1.7.1) 16 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 17 | cocoapods-downloader (>= 1.2.2, < 2.0) 18 | cocoapods-plugins (>= 1.0.0, < 2.0) 19 | cocoapods-search (>= 1.0.0, < 2.0) 20 | cocoapods-stats (>= 1.0.0, < 2.0) 21 | cocoapods-trunk (>= 1.3.1, < 2.0) 22 | cocoapods-try (>= 1.1.0, < 2.0) 23 | colored2 (~> 3.1) 24 | escape (~> 0.0.4) 25 | fourflusher (>= 2.2.0, < 3.0) 26 | gh_inspector (~> 1.0) 27 | molinillo (~> 0.6.6) 28 | nap (~> 1.0) 29 | ruby-macho (~> 1.4) 30 | xcodeproj (>= 1.8.2, < 2.0) 31 | cocoapods-core (1.7.1) 32 | activesupport (>= 4.0.2, < 6) 33 | fuzzy_match (~> 2.0.4) 34 | nap (~> 1.0) 35 | cocoapods-deintegrate (1.0.4) 36 | cocoapods-downloader (1.2.2) 37 | cocoapods-plugins (1.0.0) 38 | nap 39 | cocoapods-search (1.0.0) 40 | cocoapods-stats (1.1.0) 41 | cocoapods-trunk (1.3.1) 42 | nap (>= 0.8, < 2.0) 43 | netrc (~> 0.11) 44 | cocoapods-try (1.1.0) 45 | colored2 (3.1.2) 46 | concurrent-ruby (1.1.5) 47 | escape (0.0.4) 48 | ffi (1.9.25) 49 | fourflusher (2.2.0) 50 | fuzzy_match (2.0.4) 51 | gh_inspector (1.1.3) 52 | i18n (0.9.5) 53 | concurrent-ruby (~> 1.0) 54 | jazzy (0.9.4) 55 | cocoapods (~> 1.0) 56 | mustache (~> 0.99) 57 | open4 58 | redcarpet (~> 3.2) 59 | rouge (>= 2.0.6, < 4.0) 60 | sass (~> 3.4) 61 | sqlite3 (~> 1.3) 62 | xcinvoke (~> 0.3.0) 63 | liferaft (0.0.6) 64 | minitest (5.11.3) 65 | molinillo (0.6.6) 66 | mustache (0.99.8) 67 | nanaimo (0.2.6) 68 | nap (1.1.0) 69 | netrc (0.11.0) 70 | open4 (1.3.4) 71 | parslet (1.8.2) 72 | rack (2.0.7) 73 | rb-fsevent (0.10.3) 74 | rb-inotify (0.10.0) 75 | ffi (~> 1.0) 76 | redcarpet (3.5.1) 77 | rouge (2.0.7) 78 | ruby-macho (1.4.0) 79 | sass (3.7.4) 80 | sass-listen (~> 4.0.0) 81 | sass-listen (4.0.0) 82 | rb-fsevent (~> 0.9, >= 0.9.4) 83 | rb-inotify (~> 0.9, >= 0.9.7) 84 | sqlite3 (1.4.1) 85 | thread_safe (0.3.6) 86 | trollop (2.9.9) 87 | tzinfo (1.2.5) 88 | thread_safe (~> 0.1) 89 | xcinvoke (0.3.0) 90 | liferaft (~> 0.0.6) 91 | xcodeproj (1.9.0) 92 | CFPropertyList (>= 2.3.3, < 4.0) 93 | atomos (~> 0.1.3) 94 | claide (>= 1.0.2, < 2.0) 95 | colored2 (~> 3.1) 96 | nanaimo (~> 0.2.6) 97 | xcpretty (0.3.0) 98 | rouge (~> 2.0.7) 99 | yarn (0.1.1) 100 | parslet (>= 1.2) 101 | rack (>= 1.3) 102 | trollop (>= 1.16) 103 | 104 | PLATFORMS 105 | ruby 106 | 107 | DEPENDENCIES 108 | cocoapods (~> 1.0) 109 | ffi (~> 1.9.24) 110 | jazzy (~> 0.9) 111 | rack (~> 2.0.6) 112 | xcpretty (~> 0.2) 113 | yarn (~> 0.1) 114 | 115 | BUNDLED WITH 116 | 1.17.1 117 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2015-2018 Lionheart Software LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Usage: make VERSION=0.1.2 16 | 17 | PODFILE := $(shell find . -name "*.podspec" -depth 1) 18 | DIRECTORY := $(shell basename $(PODFILE) .podspec) 19 | AWS_S3_BUCKET_NAME := lionheart-opensource 20 | AWS_S3_REGION := us-east-2 21 | AWS_CF_DISTRIBUTION_ID := E33XE7TKGUV1ZD 22 | 23 | all: publish 24 | 25 | version_provided: 26 | test -n "$(VERSION)" 27 | 28 | podspec_found: 29 | test -n "$(PODFILE)" 30 | 31 | quicklint: 32 | bundle exec pod spec lint --quick 33 | 34 | replace_text: podspec_found version_provided 35 | sed -i "" "s/\(s.version[ ]*=[ ]\).*/\1 \"$(VERSION)\"/g" $(PODFILE) 36 | sed -i "" "s/tree\/[\.0-9]*/tree\/$(VERSION)/g" .jazzy.yaml 37 | 38 | generate_docs: replace_text 39 | bundle exec jazzy 40 | git add docs/ 41 | git add .jazzy.yaml 42 | -git commit -m "documentation update" 43 | sync_directory_to_s3 "$(AWS_S3_REGION)" "$(AWS_S3_BUCKET_NAME)" "$(AWS_CF_DISTRIBUTION_ID)" "docs" "$(DIRECTORY)/" 44 | 45 | tag: quicklint generate_docs 46 | git add . 47 | # - ignores errors in this command 48 | -git commit -m "bump version to $(VERSION)" 49 | # Delete tag if already exists 50 | -git tag -d $(VERSION) 51 | -git push origin master :$(VERSION) 52 | git tag $(VERSION) 53 | git push origin master 54 | git push --tags 55 | 56 | publish: tag 57 | bundle exec pod trunk push --allow-warnings 58 | 59 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | $PROJECT_NAME 2 | Copyright 2016-2018 Lionheart Software LLC. 3 | 4 | This product includes software developed by Lionheart Software (https://lionheartsw.com/). 5 | 6 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/animation.gif -------------------------------------------------------------------------------- /docs/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | documentation 17 | 18 | 19 | documentation 20 | 21 | 22 | 5% 23 | 24 | 25 | 5% 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/docsets/ConcentricProgressRingView.docset/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.jazzy.concentricprogressringview 7 | CFBundleName 8 | ConcentricProgressRingView 9 | DocSetPlatformFamily 10 | concentricprogressringview 11 | isDashDocset 12 | 13 | dashIndexFilePath 14 | index.html 15 | isJavaScriptEnabled 16 | 17 | DashDocSetFamily 18 | dashtoc 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/img/carat.png -------------------------------------------------------------------------------- /docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/img/dash.png -------------------------------------------------------------------------------- /docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/img/gh.png -------------------------------------------------------------------------------- /docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/img/spinner.gif -------------------------------------------------------------------------------- /docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | $content = link.parent().parent().next(); 27 | $content.slideToggle(animationDuration); 28 | 29 | // Keeps the document from jumping to the hash. 30 | var href = $(this).attr('href'); 31 | if (history.pushState) { 32 | history.pushState({}, '', href); 33 | } else { 34 | location.hash = href; 35 | } 36 | event.preventDefault(); 37 | }); 38 | 39 | // Dumb down quotes within code blocks that delimit strings instead of quotations 40 | // https://github.com/realm/jazzy/issues/714 41 | $("code q").replaceWith(function () { 42 | return ["\"", $(this).contents(), "\""]; 43 | }); 44 | -------------------------------------------------------------------------------- /docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/Documents/js/jazzy.search.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var searchIndex = lunr(function() { 3 | this.ref('url'); 4 | this.field('name'); 5 | }); 6 | 7 | var $typeahead = $('[data-typeahead]'); 8 | var $form = $typeahead.parents('form'); 9 | var searchURL = $form.attr('action'); 10 | 11 | function displayTemplate(result) { 12 | return result.name; 13 | } 14 | 15 | function suggestionTemplate(result) { 16 | var t = '
'; 17 | t += '' + result.name + ''; 18 | if (result.parent_name) { 19 | t += '' + result.parent_name + ''; 20 | } 21 | t += '
'; 22 | return t; 23 | } 24 | 25 | $typeahead.one('focus', function() { 26 | $form.addClass('loading'); 27 | 28 | $.getJSON(searchURL).then(function(searchData) { 29 | $.each(searchData, function (url, doc) { 30 | searchIndex.add({url: url, name: doc.name}); 31 | }); 32 | 33 | $typeahead.typeahead( 34 | { 35 | highlight: true, 36 | minLength: 3 37 | }, 38 | { 39 | limit: 10, 40 | display: displayTemplate, 41 | templates: { suggestion: suggestionTemplate }, 42 | source: function(query, sync) { 43 | var results = searchIndex.search(query).map(function(result) { 44 | var doc = searchData[result.ref]; 45 | doc.url = result.ref; 46 | return doc; 47 | }); 48 | sync(results); 49 | } 50 | } 51 | ); 52 | $form.removeClass('loading'); 53 | $typeahead.trigger('focus'); 54 | }); 55 | }); 56 | 57 | var baseURL = searchURL.slice(0, -"search.json".length); 58 | 59 | $typeahead.on('typeahead:select', function(e, result) { 60 | window.location = baseURL + result.url; 61 | }); 62 | }); 63 | -------------------------------------------------------------------------------- /docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/docSet.dsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/docsets/ConcentricProgressRingView.docset/Contents/Resources/docSet.dsidx -------------------------------------------------------------------------------- /docs/docsets/ConcentricProgressRingView.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/docsets/ConcentricProgressRingView.tgz -------------------------------------------------------------------------------- /docs/filelist: -------------------------------------------------------------------------------- 1 | Classes.html 2 | Classes/CircleLayer.html 3 | Classes/ConcentricProgressRingView.html 4 | Classes/ProgressRingLayer.html 5 | Structs.html 6 | Structs/ProgressRing.html 7 | badge.svg 8 | css/highlight.css 9 | css/jazzy.css 10 | docsets/ConcentricProgressRingView.tgz 11 | filelist-local 12 | img/carat.png 13 | img/dash.png 14 | img/gh.png 15 | img/spinner.gif 16 | index.html 17 | js/jazzy.js 18 | js/jazzy.search.js 19 | js/jquery.min.js 20 | js/lunr.min.js 21 | js/typeahead.jquery.js 22 | search.json 23 | undocumented.json 24 | -------------------------------------------------------------------------------- /docs/filelist-local: -------------------------------------------------------------------------------- 1 | Classes.html 2 | Classes/CircleLayer.html 3 | Classes/ConcentricProgressRingView.html 4 | Classes/ProgressRingLayer.html 5 | Structs.html 6 | Structs/ProgressRing.html 7 | badge.svg 8 | css/highlight.css 9 | css/jazzy.css 10 | docsets/ConcentricProgressRingView.tgz 11 | filelist-local 12 | img/carat.png 13 | img/dash.png 14 | img/gh.png 15 | img/spinner.gif 16 | index.html 17 | js/jazzy.js 18 | js/jazzy.search.js 19 | js/jquery.min.js 20 | js/lunr.min.js 21 | js/typeahead.jquery.js 22 | search.json 23 | undocumented.json 24 | -------------------------------------------------------------------------------- /docs/filelist-local-md5: -------------------------------------------------------------------------------- 1 | 07a5d5877a8574a15543c0bc5c1c6de5 js/lunr.min.js 2 | 0aec5e490ceebbd819e89e49bdc2fa44 css/highlight.css 3 | 11539699fcb90b4a463eae41af83331c Classes.html 4 | 1a5ba44eaeb44b2bda2311272cb3a0cb docsets/ConcentricProgressRingView.tgz 5 | 39472cb4b9f49ad69beab1ca71801c90 js/typeahead.jquery.js 6 | 45a1597ad4ff10d393c591c9f1513649 img/carat.png 7 | 4bc7d81ff2fed9fe7687591d7e9039d0 undocumented.json 8 | 8101d596b2b8fa35fe3a634ea342d7c3 js/jquery.min.js 9 | 8497867e268adb2867f52c7e41c073de search.json 10 | 943f7b1410e97bc2cd6b82abc5b8562f Structs/ProgressRing.html 11 | 9662a035b84b6702e35323230351c144 badge.svg 12 | a0eda45184942cd630d34ca5a3f103e8 Classes/ConcentricProgressRingView.html 13 | a3f192921f1cb55aba4a7543c8d3dfa8 js/jazzy.js 14 | b222d816a98ec0d409e34051600eb4c0 img/dash.png 15 | bedb3f401827ac1209f591f915e248b3 js/jazzy.search.js 16 | c079081f3710f6351686cddb58e47323 Classes/CircleLayer.html 17 | d4e7ca0cc9b8fa301da5de52ed76602c Classes/ProgressRingLayer.html 18 | d56df49a807a9fd06eb1667a84d3810e img/gh.png 19 | d66c0aa98c3e5685735e614567b509d5 index.html 20 | dfd13cb70c00fe8621631392283d0d1b css/jazzy.css 21 | e19070e7678337ba9d70f4ffa2a252e4 filelist-local 22 | f2ab932b59382ee46b393328ae86eb0f Structs.html 23 | f6862e05ad5c2ed2f83d8d6fc48a4975 img/spinner.gif 24 | -------------------------------------------------------------------------------- /docs/filelist-md5: -------------------------------------------------------------------------------- 1 | 07a5d5877a8574a15543c0bc5c1c6de5 js/lunr.min.js 2 | 0aec5e490ceebbd819e89e49bdc2fa44 css/highlight.css 3 | 11539699fcb90b4a463eae41af83331c Classes.html 4 | 1a5ba44eaeb44b2bda2311272cb3a0cb docsets/ConcentricProgressRingView.tgz 5 | 39472cb4b9f49ad69beab1ca71801c90 js/typeahead.jquery.js 6 | 45a1597ad4ff10d393c591c9f1513649 img/carat.png 7 | 4bc7d81ff2fed9fe7687591d7e9039d0 undocumented.json 8 | 8101d596b2b8fa35fe3a634ea342d7c3 js/jquery.min.js 9 | 8497867e268adb2867f52c7e41c073de search.json 10 | 943f7b1410e97bc2cd6b82abc5b8562f Structs/ProgressRing.html 11 | 9662a035b84b6702e35323230351c144 badge.svg 12 | a0eda45184942cd630d34ca5a3f103e8 Classes/ConcentricProgressRingView.html 13 | a3f192921f1cb55aba4a7543c8d3dfa8 js/jazzy.js 14 | b222d816a98ec0d409e34051600eb4c0 img/dash.png 15 | bedb3f401827ac1209f591f915e248b3 js/jazzy.search.js 16 | c079081f3710f6351686cddb58e47323 Classes/CircleLayer.html 17 | d4e7ca0cc9b8fa301da5de52ed76602c Classes/ProgressRingLayer.html 18 | d56df49a807a9fd06eb1667a84d3810e img/gh.png 19 | d66c0aa98c3e5685735e614567b509d5 index.html 20 | dfd13cb70c00fe8621631392283d0d1b css/jazzy.css 21 | e19070e7678337ba9d70f4ffa2a252e4 filelist-local 22 | f2ab932b59382ee46b393328ae86eb0f Structs.html 23 | f6862e05ad5c2ed2f83d8d6fc48a4975 img/spinner.gif 24 | -------------------------------------------------------------------------------- /docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/img/carat.png -------------------------------------------------------------------------------- /docs/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/img/dash.png -------------------------------------------------------------------------------- /docs/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/img/gh.png -------------------------------------------------------------------------------- /docs/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/docs/img/spinner.gif -------------------------------------------------------------------------------- /docs/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | $content = link.parent().parent().next(); 27 | $content.slideToggle(animationDuration); 28 | 29 | // Keeps the document from jumping to the hash. 30 | var href = $(this).attr('href'); 31 | if (history.pushState) { 32 | history.pushState({}, '', href); 33 | } else { 34 | location.hash = href; 35 | } 36 | event.preventDefault(); 37 | }); 38 | 39 | // Dumb down quotes within code blocks that delimit strings instead of quotations 40 | // https://github.com/realm/jazzy/issues/714 41 | $("code q").replaceWith(function () { 42 | return ["\"", $(this).contents(), "\""]; 43 | }); 44 | -------------------------------------------------------------------------------- /docs/js/jazzy.search.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var searchIndex = lunr(function() { 3 | this.ref('url'); 4 | this.field('name'); 5 | }); 6 | 7 | var $typeahead = $('[data-typeahead]'); 8 | var $form = $typeahead.parents('form'); 9 | var searchURL = $form.attr('action'); 10 | 11 | function displayTemplate(result) { 12 | return result.name; 13 | } 14 | 15 | function suggestionTemplate(result) { 16 | var t = '
'; 17 | t += '' + result.name + ''; 18 | if (result.parent_name) { 19 | t += '' + result.parent_name + ''; 20 | } 21 | t += '
'; 22 | return t; 23 | } 24 | 25 | $typeahead.one('focus', function() { 26 | $form.addClass('loading'); 27 | 28 | $.getJSON(searchURL).then(function(searchData) { 29 | $.each(searchData, function (url, doc) { 30 | searchIndex.add({url: url, name: doc.name}); 31 | }); 32 | 33 | $typeahead.typeahead( 34 | { 35 | highlight: true, 36 | minLength: 3 37 | }, 38 | { 39 | limit: 10, 40 | display: displayTemplate, 41 | templates: { suggestion: suggestionTemplate }, 42 | source: function(query, sync) { 43 | var results = searchIndex.search(query).map(function(result) { 44 | var doc = searchData[result.ref]; 45 | doc.url = result.ref; 46 | return doc; 47 | }); 48 | sync(results); 49 | } 50 | } 51 | ); 52 | $form.removeClass('loading'); 53 | $typeahead.trigger('focus'); 54 | }); 55 | }); 56 | 57 | var baseURL = searchURL.slice(0, -"search.json".length); 58 | 59 | $typeahead.on('typeahead:select', function(e, result) { 60 | window.location = baseURL + result.url; 61 | }); 62 | }); 63 | -------------------------------------------------------------------------------- /example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/example1.png -------------------------------------------------------------------------------- /example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/example2.png -------------------------------------------------------------------------------- /example3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/example3.png -------------------------------------------------------------------------------- /meta/header.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/meta/header.sketch -------------------------------------------------------------------------------- /meta/repo-banner-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/meta/repo-banner-bottom.png -------------------------------------------------------------------------------- /meta/repo-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lionheart/ConcentricProgressRingView/8d997c122e6c9d862813b36b8e12b047aba5bdaf/meta/repo-banner.png --------------------------------------------------------------------------------