├── .ruby-version ├── Pods ├── Target Support Files │ ├── URLMock │ │ ├── URLMock.xcconfig │ │ ├── URLMock-prefix.pch │ │ ├── URLMock-dummy.m │ │ └── URLMock-Private.xcconfig │ ├── Mantle │ │ ├── Mantle.xcconfig │ │ ├── Mantle-prefix.pch │ │ ├── Mantle-dummy.m │ │ └── Mantle-Private.xcconfig │ ├── Pods │ │ ├── Pods-dummy.m │ │ ├── Pods.debug.xcconfig │ │ ├── Pods.release.xcconfig │ │ ├── Pods-acknowledgements.markdown │ │ └── Pods-acknowledgements.plist │ └── Pods-ToastTests │ │ ├── Pods-ToastTests-dummy.m │ │ ├── Pods-ToastTests.debug.xcconfig │ │ ├── Pods-ToastTests.release.xcconfig │ │ └── Pods-ToastTests-acknowledgements.markdown ├── Headers │ ├── Private │ │ ├── Mantle │ │ │ ├── Mantle.h │ │ │ ├── MTLModel.h │ │ │ ├── EXTScope.h │ │ │ ├── MTLJSONAdapter.h │ │ │ ├── MTLReflection.h │ │ │ ├── metamacros.h │ │ │ ├── MTLModel+NSCoding.h │ │ │ ├── MTLValueTransformer.h │ │ │ ├── EXTKeyPathCoding.h │ │ │ ├── EXTRuntimeExtensions.h │ │ │ ├── MTLManagedObjectAdapter.h │ │ │ ├── NSError+MTLModelException.h │ │ │ ├── NSObject+MTLComparisonAdditions.h │ │ │ ├── NSArray+MTLManipulationAdditions.h │ │ │ ├── NSDictionary+MTLManipulationAdditions.h │ │ │ ├── NSValueTransformer+MTLInversionAdditions.h │ │ │ └── NSValueTransformer+MTLPredefinedTransformerAdditions.h │ │ └── URLMock │ │ │ ├── UMKErrorUtilities.h │ │ │ ├── UMKParameterPair.h │ │ │ ├── UMKTestUtilities.h │ │ │ ├── NSURL+UMKQueryParameters.h │ │ │ ├── NSDictionary+UMKURLEncoding.h │ │ │ └── UMKURLEncodedParameterStringParser.h │ └── Public │ │ ├── Mantle │ │ ├── Mantle.h │ │ ├── MTLModel.h │ │ ├── EXTScope.h │ │ ├── MTLJSONAdapter.h │ │ ├── MTLReflection.h │ │ ├── metamacros.h │ │ ├── MTLModel+NSCoding.h │ │ ├── MTLValueTransformer.h │ │ ├── EXTKeyPathCoding.h │ │ ├── EXTRuntimeExtensions.h │ │ ├── MTLManagedObjectAdapter.h │ │ ├── NSError+MTLModelException.h │ │ ├── NSArray+MTLManipulationAdditions.h │ │ ├── NSObject+MTLComparisonAdditions.h │ │ ├── NSDictionary+MTLManipulationAdditions.h │ │ ├── NSValueTransformer+MTLInversionAdditions.h │ │ └── NSValueTransformer+MTLPredefinedTransformerAdditions.h │ │ └── URLMock │ │ ├── UMKErrorUtilities.h │ │ ├── UMKParameterPair.h │ │ ├── UMKTestUtilities.h │ │ ├── NSURL+UMKQueryParameters.h │ │ ├── NSDictionary+UMKURLEncoding.h │ │ └── UMKURLEncodedParameterStringParser.h ├── Mantle │ ├── Mantle │ │ ├── extobjc │ │ │ ├── EXTScope.m │ │ │ ├── EXTKeyPathCoding.h │ │ │ ├── EXTRuntimeExtensions.h │ │ │ └── EXTScope.h │ │ ├── NSObject+MTLComparisonAdditions.m │ │ ├── NSObject+MTLComparisonAdditions.h │ │ ├── NSValueTransformer+MTLInversionAdditions.h │ │ ├── Mantle.h │ │ ├── NSError+MTLModelException.h │ │ ├── NSValueTransformer+MTLInversionAdditions.m │ │ ├── NSDictionary+MTLManipulationAdditions.m │ │ ├── NSDictionary+MTLManipulationAdditions.h │ │ ├── NSArray+MTLManipulationAdditions.h │ │ ├── NSArray+MTLManipulationAdditions.m │ │ ├── MTLValueTransformer.h │ │ ├── NSError+MTLModelException.m │ │ ├── MTLReflection.h │ │ ├── MTLReflection.m │ │ ├── MTLValueTransformer.m │ │ └── NSValueTransformer+MTLPredefinedTransformerAdditions.h │ └── LICENSE.md ├── Manifest.lock └── URLMock │ ├── LICENSE │ └── URLMock │ ├── Utilities │ ├── UMKParameterPair.h │ ├── UMKErrorUtilities.m │ ├── UMKURLEncodedParameterStringParser.h │ ├── UMKParameterPair.m │ └── UMKErrorUtilities.h │ └── Categories │ └── NSURL+UMKQueryParameters.m ├── Gemfile ├── ToastTests ├── en.lproj │ └── InfoPlist.strings ├── ToastTests-Info.plist ├── TWTRandomizedTestCase.m └── TWTRandomizedTestCase.h ├── ExampleApplication ├── en.lproj │ └── InfoPlist.strings ├── ToastExamples.plist ├── Images.xcassets │ ├── LaunchImage.launchimage │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── TWTSampleViewController.h ├── TWTUIKitBlockSampleViewController.h ├── TWTAppDelegate.h ├── TWTCustomTransitionsSampleViewController.h ├── main.m ├── Toast-Info.plist ├── Toast-Prefix.pch ├── TWTAppDelegate.m └── TWTSampleViewController.m ├── Podfile ├── Toast.xcworkspace └── contents.xcworkspacedata ├── travis-scripts ├── before_install.sh ├── install.sh └── script.sh ├── Toast.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── .gitignore ├── Podfile.lock ├── LICENSE ├── Gemfile.lock ├── .travis.yml ├── UIKit ├── Blocks │ ├── UIActionSheet+TWTBlocks.h │ ├── UIAlertView+TWTBlocks.h │ ├── UIActionSheet+TWTBlocks.m │ └── UIAlertView+TWTBlocks.m ├── View Controller Transitions │ ├── TWTTransitionController.h │ ├── TWTSimpleAnimationController.h │ ├── TWTNavigationControllerDelegate.h │ └── TWTSimpleAnimationController.m ├── Prepare for Segue │ ├── UIViewController+TWTPrepareForSegue.h │ └── UIViewController+TWTPrepareForSegue.m ├── View Controller Completion │ ├── UIViewController+TWTCompletion.h │ └── UIViewController+TWTCompletion.m ├── Snapshot Image │ ├── UIView+TWTSnapshotImage.m │ └── UIView+TWTSnapshotImage.h ├── Text Style │ ├── TWTTextStyle.h │ └── TWTTextStyle.m ├── Color │ ├── UIColor+TWTColorHelpers.h │ └── UIColor+TWTColorHelpers.m ├── Device │ └── UIDevice+TWTSystemVersion.h ├── Nib-Backed View │ └── TWTNibBackedView.m └── Block Actions │ ├── UIControl+TWTBlockActions.h │ └── UIControl+TWTBlockActions.m ├── Foundation ├── Subclass Responsibility │ ├── NSException+TWTSubclassResponsibility.m │ └── NSException+TWTSubclassResponsibility.h ├── Tree Node │ ├── TWTTreeNode.h │ └── TWTTreeNode.m ├── NSArray Index Path Additions │ ├── NSArray+TWTIndexPath.h │ └── NSArray+TWTIndexPath.m ├── Error Utilities │ ├── TWTErrorUtilities.m │ └── TWTErrorUtilities.h ├── Concurrent Accessor │ └── TWTConcurrentAccessor.m └── Asynchronous Operation │ ├── TWTAsynchronousOperation.h │ └── TWTAsynchronousOperation.m └── Mantle ├── Selective JSON Adapter ├── TWTSelectiveJSONAdapter.m └── TWTSelectiveJSONAdapter.h ├── Mantle Model ├── TWTMantleModel.m └── TWTMantleModel.h └── Model Class Deserialization └── TWTModelClassDeserialization.m /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.1.2 2 | -------------------------------------------------------------------------------- /Pods/Target Support Files/URLMock/URLMock.xcconfig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'cocoapods' 4 | -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/Mantle.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/Mantle.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/Mantle.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/Mantle.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/MTLModel.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLModel.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/MTLModel.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLModel.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/EXTScope.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/extobjc/EXTScope.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/EXTScope.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/extobjc/EXTScope.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/MTLJSONAdapter.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLJSONAdapter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/MTLReflection.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLReflection.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/metamacros.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/extobjc/metamacros.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/MTLJSONAdapter.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLJSONAdapter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/MTLReflection.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLReflection.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/metamacros.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/extobjc/metamacros.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/MTLModel+NSCoding.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLModel+NSCoding.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/MTLModel+NSCoding.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLModel+NSCoding.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/MTLValueTransformer.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLValueTransformer.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/MTLValueTransformer.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLValueTransformer.h -------------------------------------------------------------------------------- /ToastTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ExampleApplication/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/EXTKeyPathCoding.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/extobjc/EXTKeyPathCoding.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/EXTKeyPathCoding.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/extobjc/EXTKeyPathCoding.h -------------------------------------------------------------------------------- /Pods/Target Support Files/Mantle/Mantle.xcconfig: -------------------------------------------------------------------------------- 1 | MANTLE_OTHER_LDFLAGS = -framework "Foundation" -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/EXTRuntimeExtensions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/extobjc/EXTRuntimeExtensions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/MTLManagedObjectAdapter.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLManagedObjectAdapter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/URLMock/UMKErrorUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Utilities/UMKErrorUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Private/URLMock/UMKParameterPair.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Utilities/UMKParameterPair.h -------------------------------------------------------------------------------- /Pods/Headers/Private/URLMock/UMKTestUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Utilities/UMKTestUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/EXTRuntimeExtensions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/extobjc/EXTRuntimeExtensions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/MTLManagedObjectAdapter.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/MTLManagedObjectAdapter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/URLMock/UMKErrorUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Utilities/UMKErrorUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/URLMock/UMKParameterPair.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Utilities/UMKParameterPair.h -------------------------------------------------------------------------------- /Pods/Headers/Public/URLMock/UMKTestUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Utilities/UMKTestUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/NSError+MTLModelException.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSError+MTLModelException.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/NSError+MTLModelException.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSError+MTLModelException.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/NSObject+MTLComparisonAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSObject+MTLComparisonAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/URLMock/NSURL+UMKQueryParameters.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Categories/NSURL+UMKQueryParameters.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/NSArray+MTLManipulationAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSArray+MTLManipulationAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/NSObject+MTLComparisonAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSObject+MTLComparisonAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/URLMock/NSURL+UMKQueryParameters.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Categories/NSURL+UMKQueryParameters.h -------------------------------------------------------------------------------- /Pods/Target Support Files/Mantle/Mantle-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/URLMock/URLMock-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/NSArray+MTLManipulationAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSArray+MTLManipulationAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/URLMock/NSDictionary+UMKURLEncoding.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Categories/NSDictionary+UMKURLEncoding.h -------------------------------------------------------------------------------- /Pods/Headers/Public/URLMock/NSDictionary+UMKURLEncoding.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Categories/NSDictionary+UMKURLEncoding.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/NSDictionary+MTLManipulationAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSDictionary+MTLManipulationAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/NSDictionary+MTLManipulationAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSDictionary+MTLManipulationAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/NSValueTransformer+MTLInversionAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSValueTransformer+MTLInversionAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/URLMock/UMKURLEncodedParameterStringParser.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Utilities/UMKURLEncodedParameterStringParser.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/NSValueTransformer+MTLInversionAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSValueTransformer+MTLInversionAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/URLMock/UMKURLEncodedParameterStringParser.h: -------------------------------------------------------------------------------- 1 | ../../../URLMock/URLMock/Utilities/UMKURLEncodedParameterStringParser.h -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | 3 | pod 'Mantle', '~> 1.4.0' 4 | 5 | target "ToastTests" do 6 | pod 'URLMock/TestHelpers', '~> 1.1.2' 7 | end 8 | -------------------------------------------------------------------------------- /Pods/Headers/Public/Mantle/NSValueTransformer+MTLPredefinedTransformerAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSValueTransformer+MTLPredefinedTransformerAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Mantle/NSValueTransformer+MTLPredefinedTransformerAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Mantle/Mantle/NSValueTransformer+MTLPredefinedTransformerAdditions.h -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Mantle/Mantle-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Mantle : NSObject 3 | @end 4 | @implementation PodsDummy_Mantle 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/URLMock/URLMock-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_URLMock : NSObject 3 | @end 4 | @implementation PodsDummy_URLMock 5 | @end 6 | -------------------------------------------------------------------------------- /Toast.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ToastTests/Pods-ToastTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ToastTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ToastTests 5 | @end 6 | -------------------------------------------------------------------------------- /travis-scripts/before_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -v 2 | 3 | # -v makes this script print commands before executing them 4 | 5 | # Update Homebrew before installing dependencies in install.sh 6 | brew update &> /dev/null 7 | -------------------------------------------------------------------------------- /Toast.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /travis-scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -v 2 | 3 | # -v makes this script print commands before executing them 4 | 5 | # install dependencies from Homebrew 6 | brew upgrade xctool 7 | 8 | # update CocoaPods 9 | gem update cocoapods --no-ri --no-rdoc 10 | 11 | # install gems 12 | bundle install 13 | 14 | # install pods 15 | bundle exec pod install 16 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/extobjc/EXTScope.m: -------------------------------------------------------------------------------- 1 | // 2 | // EXTScope.m 3 | // extobjc 4 | // 5 | // Created by Justin Spahr-Summers on 2011-05-04. 6 | // Copyright (C) 2012 Justin Spahr-Summers. 7 | // Released under the MIT license. 8 | // 9 | 10 | #import "EXTScope.h" 11 | 12 | void mtl_executeCleanupBlock (__strong mtl_cleanupBlock_t *block) { 13 | (*block)(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/URLMock/URLMock-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "URLMock.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/URLMock" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/URLMock" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Mantle (1.4.1): 3 | - Mantle/extobjc (= 1.4.1) 4 | - Mantle/extobjc (1.4.1) 5 | - URLMock/TestHelpers (1.1.2) 6 | 7 | DEPENDENCIES: 8 | - Mantle (~> 1.4.0) 9 | - URLMock/TestHelpers (~> 1.1.2) 10 | 11 | SPEC CHECKSUMS: 12 | Mantle: 3219c0181d918508689af61c77891b12dbb28215 13 | URLMock: b47a0ee77ee14a529bb7dc8c9e35c3306a6aca00 14 | 15 | COCOAPODS: 0.38.2 16 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Mantle (1.4.1): 3 | - Mantle/extobjc (= 1.4.1) 4 | - Mantle/extobjc (1.4.1) 5 | - URLMock/TestHelpers (1.1.2) 6 | 7 | DEPENDENCIES: 8 | - Mantle (~> 1.4.0) 9 | - URLMock/TestHelpers (~> 1.1.2) 10 | 11 | SPEC CHECKSUMS: 12 | Mantle: 3219c0181d918508689af61c77891b12dbb28215 13 | URLMock: b47a0ee77ee14a529bb7dc8c9e35c3306a6aca00 14 | 15 | COCOAPODS: 0.38.2 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Mantle/Mantle-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Mantle.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Mantle" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/URLMock" 4 | OTHER_LDFLAGS = ${MANTLE_OTHER_LDFLAGS} 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /travis-scripts/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -v 2 | 3 | # -v makes this script print commands before executing them 4 | 5 | # Print relevant environment variables for reference in the build log 6 | printenv | egrep XCODE | sort 7 | 8 | set -e 9 | 10 | # Build, and optionally run tests, depending on the value of the test flag 11 | xctool -workspace "$TRAVIS_XCODE_WORKSPACE" -scheme "$TRAVIS_XCODE_SCHEME" -sdk "$TRAVIS_XCODE_SDK" "$TWT_XCODE_BUILD_ACTION" 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/URLMock" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Mantle" -isystem "${PODS_ROOT}/Headers/Public/URLMock" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Mantle" -framework "Foundation" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/URLMock" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Mantle" -isystem "${PODS_ROOT}/Headers/Public/URLMock" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Mantle" -framework "Foundation" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSObject+MTLComparisonAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MTLComparisonAdditions.m 3 | // Mantle 4 | // 5 | // Created by Josh Vera on 10/26/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | // Portions copyright (c) 2011 Bitswift. All rights reserved. 9 | // See the LICENSE file for more information. 10 | // 11 | 12 | #import "NSObject+MTLComparisonAdditions.h" 13 | 14 | BOOL MTLEqualObjects(id obj1, id obj2) { 15 | return (obj1 == obj2 || [obj1 isEqual:obj2]); 16 | } 17 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSObject+MTLComparisonAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MTLComparisonAdditions.h 3 | // Mantle 4 | // 5 | // Created by Josh Vera on 10/26/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | // Portions copyright (c) 2011 Bitswift. All rights reserved. 9 | // See the LICENSE file for more information. 10 | // 11 | 12 | #import 13 | 14 | // Returns whether both objects are identical or equal via -isEqual: 15 | BOOL MTLEqualObjects(id obj1, id obj2); 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ToastTests/Pods-ToastTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/URLMock" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Mantle" -isystem "${PODS_ROOT}/Headers/Public/URLMock" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Mantle" -l"URLMock" -framework "Foundation" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ToastTests/Pods-ToastTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/URLMock" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Mantle" -isystem "${PODS_ROOT}/Headers/Public/URLMock" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Mantle" -l"URLMock" -framework "Foundation" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /ExampleApplication/ToastExamples.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Title 7 | UIActionSheet and UIAlertView with Blocks 8 | ViewController 9 | TWTUIKitBlockSampleViewController 10 | 11 | 12 | Title 13 | Custom View Controller Transitions 14 | ViewController 15 | TWTCustomTransitionsSampleViewController 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSValueTransformer+MTLInversionAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSValueTransformer+MTLInversionAdditions.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2013-05-18. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSValueTransformer (MTLInversionAdditions) 12 | 13 | // Flips the direction of the receiver's transformation, such that 14 | // -transformedValue: will become -reverseTransformedValue:, and vice-versa. 15 | // 16 | // The receiver must allow reverse transformation. 17 | // 18 | // Returns an inverted transformer. 19 | - (NSValueTransformer *)mtl_invertedTransformer; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/Mantle.h: -------------------------------------------------------------------------------- 1 | // 2 | // Mantle.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-04. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSError+MTLModelException.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+MTLModelException.h 3 | // Mantle 4 | // 5 | // Created by Robert Böhnke on 7/6/13. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSError (MTLModelException) 12 | 13 | // Creates a new error for an exception that occured during updating an 14 | // MTLModel. 15 | // 16 | // exception - The exception that was thrown while updating the model. 17 | // This argument must not be nil. 18 | // 19 | // Returns an error that takes its localized description and failure reason 20 | // from the exception. 21 | + (instancetype)mtl_modelErrorWithException:(NSException *)exception; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /ToastTests/ToastTests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSValueTransformer+MTLInversionAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSValueTransformer+MTLInversionAdditions.m 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2013-05-18. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSValueTransformer+MTLInversionAdditions.h" 10 | #import "MTLValueTransformer.h" 11 | 12 | @implementation NSValueTransformer (MTLInversionAdditions) 13 | 14 | - (NSValueTransformer *)mtl_invertedTransformer { 15 | NSParameterAssert(self.class.allowsReverseTransformation); 16 | 17 | return [MTLValueTransformer reversibleTransformerWithForwardBlock:^(id value) { 18 | return [self reverseTransformedValue:value]; 19 | } reverseBlock:^(id value) { 20 | return [self transformedValue:value]; 21 | }]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSDictionary+MTLManipulationAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+MTLManipulationAdditions.m 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-24. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSDictionary+MTLManipulationAdditions.h" 10 | 11 | @implementation NSDictionary (MTLManipulationAdditions) 12 | 13 | - (NSDictionary *)mtl_dictionaryByAddingEntriesFromDictionary:(NSDictionary *)dictionary { 14 | NSMutableDictionary *result = [self mutableCopy]; 15 | [result addEntriesFromDictionary:dictionary]; 16 | return result; 17 | } 18 | 19 | - (NSDictionary *)mtl_dictionaryByRemovingEntriesWithKeys:(NSSet *)keys { 20 | NSMutableDictionary *result = [self mutableCopy]; 21 | [result removeObjectsForKeys:keys.allObjects]; 22 | return result; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSDictionary+MTLManipulationAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+MTLManipulationAdditions.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-24. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSDictionary (MTLManipulationAdditions) 12 | 13 | // Merges the keys and values from the given dictionary into the receiver. If 14 | // both the receiver and `dictionary` have a given key, the value from 15 | // `dictionary` is used. 16 | // 17 | // Returns a new dictionary containing the entries of the receiver combined with 18 | // those of `dictionary`. 19 | - (NSDictionary *)mtl_dictionaryByAddingEntriesFromDictionary:(NSDictionary *)dictionary; 20 | 21 | // Creates a new dictionary with all the entries for the given keys removed from 22 | // the receiver. 23 | - (NSDictionary *)mtl_dictionaryByRemovingEntriesWithKeys:(NSSet *)keys; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSArray+MTLManipulationAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MTLManipulationAdditions.h 3 | // Mantle 4 | // 5 | // Created by Josh Abernathy on 9/19/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSArray (MTLManipulationAdditions) 12 | 13 | // The first object in the array or nil if the array is empty. 14 | // Forwards to `firstObject` which has been first declared in iOS7, but works with iOS4/10.6. 15 | @property (nonatomic, readonly, strong) id mtl_firstObject; 16 | 17 | // Returns a new array without all instances of the given object. 18 | - (NSArray *)mtl_arrayByRemovingObject:(id)object; 19 | 20 | // Returns a new array without the first object. If the array is empty, it 21 | // returns the empty array. 22 | - (NSArray *)mtl_arrayByRemovingFirstObject; 23 | 24 | // Returns a new array without the last object. If the array is empty, it 25 | // returns the empty array. 26 | - (NSArray *)mtl_arrayByRemovingLastObject; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2015 Ticketmaster 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSArray+MTLManipulationAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MTLManipulationAdditions.m 3 | // Mantle 4 | // 5 | // Created by Josh Abernathy on 9/19/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MTLManipulationAdditions.h" 10 | 11 | @interface NSArray (MTLDeclarations) 12 | 13 | // This declaration is needed so Mantle can be compiled with SDK 6 / 10.8. 14 | - (id)firstObject; 15 | 16 | @end 17 | 18 | @implementation NSArray (MTLManipulationAdditions) 19 | 20 | - (id)mtl_firstObject { 21 | return self.firstObject; 22 | } 23 | 24 | - (instancetype)mtl_arrayByRemovingObject:(id)object { 25 | NSMutableArray *result = [self mutableCopy]; 26 | [result removeObject:object]; 27 | return result; 28 | } 29 | 30 | - (instancetype)mtl_arrayByRemovingFirstObject { 31 | if (self.count == 0) return self; 32 | 33 | return [self subarrayWithRange:NSMakeRange(1, self.count - 1)]; 34 | } 35 | 36 | - (instancetype)mtl_arrayByRemovingLastObject { 37 | if (self.count == 0) return self; 38 | 39 | return [self subarrayWithRange:NSMakeRange(0, self.count - 1)]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/MTLValueTransformer.h: -------------------------------------------------------------------------------- 1 | // 2 | // MTLValueTransformer.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-11. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef id (^MTLValueTransformerBlock)(id); 12 | 13 | // 14 | // A value transformer supporting block-based transformation. 15 | // 16 | @interface MTLValueTransformer : NSValueTransformer 17 | 18 | // Returns a transformer which transforms values using the given block. Reverse 19 | // transformations will not be allowed. 20 | + (instancetype)transformerWithBlock:(MTLValueTransformerBlock)transformationBlock; 21 | 22 | // Returns a transformer which transforms values using the given block, for 23 | // forward or reverse transformations. 24 | + (instancetype)reversibleTransformerWithBlock:(MTLValueTransformerBlock)transformationBlock; 25 | 26 | // Returns a transformer which transforms values using the given blocks. 27 | + (instancetype)reversibleTransformerWithForwardBlock:(MTLValueTransformerBlock)forwardBlock reverseBlock:(MTLValueTransformerBlock)reverseBlock; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/URLMock/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2013–2014 Two Toasters, LLC. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the “Software”), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | the Software, and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSError+MTLModelException.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+MTLModelException.m 3 | // Mantle 4 | // 5 | // Created by Robert Böhnke on 7/6/13. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import "MTLModel.h" 10 | 11 | #import "NSError+MTLModelException.h" 12 | 13 | // The domain for errors originating from MTLModel. 14 | static NSString * const MTLModelErrorDomain = @"MTLModelErrorDomain"; 15 | 16 | // An exception was thrown and caught. 17 | static const NSInteger MTLModelErrorExceptionThrown = 1; 18 | 19 | // Associated with the NSException that was caught. 20 | static NSString * const MTLModelThrownExceptionErrorKey = @"MTLModelThrownException"; 21 | 22 | @implementation NSError (MTLModelException) 23 | 24 | + (instancetype)mtl_modelErrorWithException:(NSException *)exception { 25 | NSParameterAssert(exception != nil); 26 | 27 | NSDictionary *userInfo = @{ 28 | NSLocalizedDescriptionKey: exception.description, 29 | NSLocalizedFailureReasonErrorKey: exception.reason, 30 | MTLModelThrownExceptionErrorKey: exception 31 | }; 32 | 33 | return [NSError errorWithDomain:MTLModelErrorDomain code:MTLModelErrorExceptionThrown userInfo:userInfo]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/MTLReflection.h: -------------------------------------------------------------------------------- 1 | // 2 | // MTLReflection.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2013-03-12. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // Creates a selector from a key and a constant string. 12 | // 13 | // key - The key to insert into the generated selector. This key should be in 14 | // its natural case. 15 | // suffix - A string to append to the key as part of the selector. 16 | // 17 | // Returns a selector, or NULL if the input strings cannot form a valid 18 | // selector. 19 | SEL MTLSelectorWithKeyPattern(NSString *key, const char *suffix) __attribute__((pure, nonnull(1, 2))); 20 | 21 | // Creates a selector from a key and a constant prefix and suffix. 22 | // 23 | // prefix - A string to prepend to the key as part of the selector. 24 | // key - The key to insert into the generated selector. This key should be in 25 | // its natural case, and will have its first letter capitalized when 26 | // inserted. 27 | // suffix - A string to append to the key as part of the selector. 28 | // 29 | // Returns a selector, or NULL if the input strings cannot form a valid 30 | // selector. 31 | SEL MTLSelectorWithCapitalizedKeyPattern(const char *prefix, NSString *key, const char *suffix) __attribute__((pure, nonnull(1, 2, 3))); 32 | -------------------------------------------------------------------------------- /ExampleApplication/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /ExampleApplication/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /ExampleApplication/TWTSampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTSampleViewController.h 3 | // Toast 4 | // 5 | // Created by Josh Johnson on 1/12/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface TWTSampleViewController : UITableViewController 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | activesupport (4.2.1) 5 | i18n (~> 0.7) 6 | json (~> 1.7, >= 1.7.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | claide (0.8.1) 11 | cocoapods (0.36.0) 12 | activesupport (>= 3.2.15) 13 | claide (~> 0.8.1) 14 | cocoapods-core (= 0.36.0) 15 | cocoapods-downloader (~> 0.8.1) 16 | cocoapods-plugins (~> 0.4.1) 17 | cocoapods-trunk (~> 0.6.0) 18 | cocoapods-try (~> 0.4.3) 19 | colored (~> 1.2) 20 | escape (~> 0.0.4) 21 | molinillo (~> 0.2.1) 22 | nap (~> 0.8) 23 | open4 (~> 1.3) 24 | xcodeproj (~> 0.23.0) 25 | cocoapods-core (0.36.0) 26 | activesupport (>= 3.2.15) 27 | fuzzy_match (~> 2.0.4) 28 | nap (~> 0.8.0) 29 | cocoapods-downloader (0.8.1) 30 | cocoapods-plugins (0.4.1) 31 | nap 32 | cocoapods-trunk (0.6.0) 33 | nap (>= 0.8) 34 | netrc (= 0.7.8) 35 | cocoapods-try (0.4.3) 36 | colored (1.2) 37 | escape (0.0.4) 38 | fuzzy_match (2.0.4) 39 | i18n (0.7.0) 40 | json (1.8.2) 41 | minitest (5.5.1) 42 | molinillo (0.2.1) 43 | nap (0.8.0) 44 | netrc (0.7.8) 45 | open4 (1.3.4) 46 | thread_safe (0.3.5) 47 | tzinfo (1.2.2) 48 | thread_safe (~> 0.1) 49 | xcodeproj (0.23.0) 50 | activesupport (>= 3) 51 | colored (~> 1.2) 52 | 53 | PLATFORMS 54 | ruby 55 | 56 | DEPENDENCIES 57 | cocoapods 58 | -------------------------------------------------------------------------------- /ExampleApplication/TWTUIKitBlockSampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTUIKitBlockSampleViewController.h 3 | // Toast 4 | // 5 | // Created by Josh Johnson on 1/13/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface TWTUIKitBlockSampleViewController : UIViewController 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ExampleApplication/TWTAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTAppDelegate.h 3 | // Toast 4 | // 5 | // Created by Josh Johnson on 1/12/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface TWTAppDelegate : UIResponder 30 | 31 | @property (strong, nonatomic) UIWindow *window; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /ExampleApplication/TWTCustomTransitionsSampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTCustomTransitionsSampleViewController.h 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 3/4/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | 30 | @interface TWTCustomTransitionsSampleViewController : UITableViewController 31 | @end 32 | -------------------------------------------------------------------------------- /ExampleApplication/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Toast 4 | // 5 | // Created by Josh Johnson on 1/12/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | #import "TWTAppDelegate.h" 30 | 31 | int main(int argc, char * argv[]) 32 | { 33 | @autoreleasepool { 34 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([TWTAppDelegate class])); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ExampleApplication/Toast-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ExampleApplication/Toast-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | // Created by Josh Johnson on 1/13/14. 7 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | #ifndef __IPHONE_3_0 31 | #warning "This project uses features only available in iOS SDK 3.0 and later." 32 | #endif 33 | 34 | #ifdef __OBJC__ 35 | #import 36 | #import 37 | #endif 38 | -------------------------------------------------------------------------------- /ToastTests/TWTRandomizedTestCase.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTRandomizedTestCase.m 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 1/8/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTRandomizedTestCase.h" 28 | 29 | @implementation TWTRandomizedTestCase 30 | 31 | + (void)setUp 32 | { 33 | [super setUp]; 34 | srandomdev(); 35 | } 36 | 37 | 38 | - (void)setUp 39 | { 40 | [super setUp]; 41 | unsigned seed = (unsigned)random(); 42 | NSLog(@"Using seed %d", seed); 43 | srandom(seed); 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | 3 | # These Travis settings are specific to `language: objective-c` 4 | xcode_workspace: Toast.xcworkspace 5 | xcode_scheme: Toast 6 | xcode_sdk: iphonesimulator 7 | 8 | env: 9 | 10 | # global environment variables apply to every build in the build matrix 11 | global: 12 | 13 | # CocoaPods requires the environment to be using UTF-8 encoding. 14 | - LANG=en_US.UTF-8 15 | 16 | # Only enable tests if this is a pull request. You are welcome to modify the logic here, but the result 17 | # must be to assign a valid xctool build action to TWT_XCODE_BUILD_ACTION 18 | - TWT_XCODE_BUILD_ACTION=$(if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then echo 'test'; else echo 'build'; fi) 19 | 20 | before_install: 21 | 22 | # Set the Ruby version to work around https://github.com/travis-ci/travis-ci/issues/2152 23 | # This also makes it so that we can specify the ruby version in a single place: 24 | # .ruby-version. This command cannot go in before_install.sh because it works by 25 | # modifying the environment 26 | - rvm use . 27 | 28 | # Run travis-scripts/before_install.sh 29 | # You can modify its contents to customize the setup that is performed here 30 | - bash -v travis-scripts/before_install.sh 31 | 32 | install: 33 | 34 | # Run travis-scripts/install.sh 35 | # You can modify its contents to customize the setup that is performed here 36 | - chmod +x ./travis-scripts/install.sh 37 | - ./travis-scripts/install.sh 38 | 39 | # Run travis-scripts/install.sh 40 | # You can modify its contents to customize the setup that is performed here 41 | install: bash -v travis-scripts/install.sh 42 | 43 | # Run travis-scripts/script.sh 44 | # You can modify its contents if needed 45 | script: bash -v travis-scripts/script.sh 46 | -------------------------------------------------------------------------------- /UIKit/Blocks/UIActionSheet+TWTBlocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIActionSheet+TWTBlocks.h 3 | // Toast 4 | // 5 | // Based on SXYAlertView, created by Jeremy Ellison on 2/9/12. 6 | // Created by Andrew Hershberger on 6 February 2013 7 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | typedef void(^TWTActionSheetBlock)(UIActionSheet *actionSheet, NSInteger buttonIndex); 31 | 32 | @interface UIActionSheet (TWTBlocks) 33 | 34 | @property (nonatomic, copy, getter = twt_tapHandler, setter = twt_setTapHandler:) TWTActionSheetBlock twt_tapHandler; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /UIKit/Blocks/UIAlertView+TWTBlocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+TWTBlocks.h 3 | // Toast 4 | // 5 | // Based on SXYAlertView, created by Jeremy Ellison on 2/9/12. 6 | // Created by Andrew Hershberger on 6 February 2013 7 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | typedef void(^TWTAlertBlock)(UIAlertView *alertView, NSInteger buttonIndex); 31 | 32 | @interface UIAlertView (TWTBlocks) 33 | 34 | @property (nonatomic, copy, getter = twt_tapHandler, setter = twt_setTapHandler:) TWTAlertBlock twt_tapHandler; 35 | @property (nonatomic, copy, getter = twt_dismissHandler, setter = twt_setDismissHandler:) TWTAlertBlock twt_dismissHandler; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Foundation/Subclass Responsibility/NSException+TWTSubclassResponsibility.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSException+TWTSubclassResponsibility.m 3 | // TWTToast 4 | // 5 | // Created by Prachi Gauriar on 1/5/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "NSException+TWTSubclassResponsibility.h" 28 | 29 | #import "TWTErrorUtilities.h" 30 | 31 | @implementation NSException (TWTSubclassResponsibility) 32 | 33 | + (instancetype)twt_subclassResponsibilityExceptionWithReceiver:(id)receiver selector:(SEL)selector 34 | { 35 | return [NSException exceptionWithName:NSInternalInconsistencyException 36 | reason:TWTExceptionString(receiver, selector, @"subclasses must provide an implementation of this method") 37 | userInfo:nil]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /UIKit/View Controller Transitions/TWTTransitionController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTTransitionController.h 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 4/12/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // A prior version of this code was written for Normal Ears, Inc. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | 31 | @protocol TWTTransitionController; 32 | 33 | 34 | @protocol TWTTransitionControllerDelegate 35 | 36 | - (void)transitionControllerInteractionDidStart:(id)transitionController; 37 | 38 | @end 39 | 40 | 41 | @protocol TWTTransitionController 42 | 43 | @property (nonatomic, weak) id delegate; 44 | 45 | @property (nonatomic, getter = isInteractive) BOOL interactive; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /UIKit/Prepare for Segue/UIViewController+TWTPrepareForSegue.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+TWTPrepareForSegue.h 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 5/22/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface UIViewController (TWTPrepareForSegue) 30 | 31 | /*! 32 | @abstract Invokes twt_prepareFor«Identifier»Segue:sender: on self, where «Identifier» is the capitalized 33 | form of the segue’s identifier. 34 | @discussion UIViewController subclasses typically invoke this method from -prepareForSegue:sender:. 35 | @param segue The segue to prepare for. If the segue is nil or has a nil identifier, this method returns 36 | immediately. 37 | @param sender The sender that started the segue. 38 | */ 39 | - (void)twt_prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /UIKit/View Controller Completion/UIViewController+TWTCompletion.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+TWTCompletion.h 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 5/22/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | 30 | @interface UIViewController (TWTCompletion) 31 | 32 | /*! 33 | Presented view controllers need a way to signal to their presenter when they are done. twt_completion 34 | facilitates this pattern. The presenter sets the twt_completion block and then when the presented view 35 | controller is done, it calls twt_finish or twt_cancel. This property is set to nil just before the block is 36 | invoked to break any strong reference cycles. 37 | */ 38 | @property (nonatomic, copy) void(^twt_completion)(BOOL finished); 39 | 40 | - (IBAction)twt_finish; 41 | 42 | - (IBAction)twt_cancel; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Foundation/Tree Node/TWTTreeNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTTreeNode.h 3 | // Toast 4 | // 5 | // Created by Kevin Conner on 7/29/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @interface TWTTreeNode : NSObject 33 | 34 | @property (nonatomic, strong, nullable) id item; 35 | @property (nonatomic, assign, getter = isExpanded) BOOL expanded; 36 | @property (nonatomic, copy, null_resettable) NSArray *children; 37 | 38 | @property (nonatomic, readonly, weak) TWTTreeNode *parent; 39 | @property (nonatomic, readonly, strong, nullable) NSIndexPath *indexPath; 40 | 41 | - (NSUInteger)depth; 42 | - (instancetype)nodeAtIndexPath:(NSIndexPath * _Nullable)indexPath; // Use from the root node. 43 | - (BOOL)hasAncestor:(TWTTreeNode * _Nullable)ancestor; 44 | 45 | @end 46 | 47 | NS_ASSUME_NONNULL_END 48 | -------------------------------------------------------------------------------- /UIKit/Snapshot Image/UIView+TWTSnapshotImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+TWTSnapshotImage.m 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 3/11/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "UIView+TWTSnapshotImage.h" 28 | 29 | @implementation UIView (TWTSnapshotImage) 30 | 31 | - (UIImage *)twt_snapshotImageWithBackgroundColor:(UIColor *)backgroundColor afterScreenUpdates:(BOOL)afterUpdates 32 | { 33 | BOOL isOpaque = CGColorGetAlpha(backgroundColor.CGColor) == 1.0 || CGColorGetAlpha(self.backgroundColor.CGColor) == 1.0 || self.isOpaque; 34 | UIGraphicsBeginImageContextWithOptions(self.bounds.size, isOpaque, 0.0); 35 | 36 | if (backgroundColor) { 37 | [backgroundColor setFill]; 38 | UIRectFill(self.bounds); 39 | } 40 | 41 | [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:afterUpdates]; 42 | 43 | UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext(); 44 | UIGraphicsEndImageContext(); 45 | return snapshotImage; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Mantle/Selective JSON Adapter/TWTSelectiveJSONAdapter.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTSelectiveJSONAdapter.m 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 3/11/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTSelectiveJSONAdapter.h" 28 | 29 | @implementation TWTSelectiveJSONAdapter 30 | 31 | - (instancetype)initWithModel:(MTLModel *)model propertyKeys:(NSSet *)propertyKeys 32 | { 33 | self = [super initWithModel:model]; 34 | if (self) { 35 | _propertyKeys = [propertyKeys copy]; 36 | } 37 | 38 | return self; 39 | } 40 | 41 | 42 | + (NSDictionary *)JSONDictionaryWithPropertyKeys:(NSSet *)propertyKeys fromModel:(MTLModel *)model 43 | { 44 | TWTSelectiveJSONAdapter *adapter = [[self alloc] initWithModel:model propertyKeys:propertyKeys]; 45 | return adapter.JSONDictionary; 46 | } 47 | 48 | 49 | - (NSString *)JSONKeyPathForPropertyKey:(NSString *)key 50 | { 51 | return [self.propertyKeys containsObject:key] ? [super JSONKeyPathForPropertyKey:key] : nil; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/MTLReflection.m: -------------------------------------------------------------------------------- 1 | // 2 | // MTLReflection.m 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2013-03-12. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import "MTLReflection.h" 10 | #import 11 | 12 | SEL MTLSelectorWithKeyPattern(NSString *key, const char *suffix) { 13 | NSUInteger keyLength = [key maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding]; 14 | NSUInteger suffixLength = strlen(suffix); 15 | 16 | char selector[keyLength + suffixLength + 1]; 17 | 18 | BOOL success = [key getBytes:selector maxLength:keyLength usedLength:&keyLength encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0, key.length) remainingRange:NULL]; 19 | if (!success) return NULL; 20 | 21 | memcpy(selector + keyLength, suffix, suffixLength); 22 | selector[keyLength + suffixLength] = '\0'; 23 | 24 | return sel_registerName(selector); 25 | } 26 | 27 | SEL MTLSelectorWithCapitalizedKeyPattern(const char *prefix, NSString *key, const char *suffix) { 28 | NSUInteger prefixLength = strlen(prefix); 29 | NSUInteger suffixLength = strlen(suffix); 30 | 31 | NSString *initial = [key substringToIndex:1].uppercaseString; 32 | NSUInteger initialLength = [initial maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding]; 33 | 34 | NSString *rest = [key substringFromIndex:1]; 35 | NSUInteger restLength = [rest maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding]; 36 | 37 | char selector[prefixLength + initialLength + restLength + suffixLength + 1]; 38 | memcpy(selector, prefix, prefixLength); 39 | 40 | BOOL success = [initial getBytes:selector + prefixLength maxLength:initialLength usedLength:&initialLength encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0, initial.length) remainingRange:NULL]; 41 | if (!success) return NULL; 42 | 43 | success = [rest getBytes:selector + prefixLength + initialLength maxLength:restLength usedLength:&restLength encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0, rest.length) remainingRange:NULL]; 44 | if (!success) return NULL; 45 | 46 | memcpy(selector + prefixLength + initialLength + restLength, suffix, suffixLength); 47 | selector[prefixLength + initialLength + restLength + suffixLength] = '\0'; 48 | 49 | return sel_registerName(selector); 50 | } 51 | -------------------------------------------------------------------------------- /Foundation/NSArray Index Path Additions/NSArray+TWTIndexPath.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+TWTIndexPath.h 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 3/9/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface NSArray (TWTIndexPath) 32 | 33 | /*! 34 | @abstract returns the object at the specified index path or nil if no such index path exists 35 | @param indexPath the index path used to look up the object. All intermediate objects must be also arrays. 36 | @return the object found at the index path or nil if the index path is nil or has 0 length 37 | */ 38 | - (nullable id)twt_objectAtIndexPath:(NSIndexPath * _Nullable)indexPath; 39 | 40 | /*! 41 | @abstract finds the first occurrence of object by performing a breadth-first search and returns the corresponding index path 42 | @param object the object to find 43 | @return the index path of the first occurrence of object or nil if the object can't be found 44 | */ 45 | - (nullable NSIndexPath *)twt_indexPathOfObject:(id _Nullable)object; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /UIKit/View Controller Completion/UIViewController+TWTCompletion.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+TWTCompletion.m 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 5/22/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "UIViewController+TWTCompletion.h" 28 | 29 | #import 30 | 31 | 32 | @implementation UIViewController (TWTCompletion) 33 | 34 | - (void (^)(BOOL))twt_completion 35 | { 36 | return objc_getAssociatedObject(self, _cmd); 37 | } 38 | 39 | 40 | - (void)setTwt_completion:(void (^)(BOOL))twt_completion 41 | { 42 | objc_setAssociatedObject(self, @selector(twt_completion), twt_completion, OBJC_ASSOCIATION_COPY_NONATOMIC); 43 | } 44 | 45 | 46 | - (IBAction)twt_finish 47 | { 48 | [self twt_complete:YES]; 49 | } 50 | 51 | 52 | - (IBAction)twt_cancel 53 | { 54 | [self twt_complete:NO]; 55 | } 56 | 57 | 58 | - (void)twt_complete:(BOOL)finished 59 | { 60 | void (^completion)(BOOL) = self.twt_completion; 61 | if (completion) { 62 | self.twt_completion = nil; 63 | completion(finished); 64 | } 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /UIKit/Text Style/TWTTextStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTTextStyle.h 3 | // Toast 4 | // 5 | // Created by Kevin Conner on 7/29/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface TWTTextStyle : NSObject 30 | 31 | @property (nonatomic, readonly, strong) UIFont *font; 32 | @property (nonatomic, readonly, strong) UIColor *color; 33 | @property (nonatomic, readonly, strong) UIColor *highlightColor; 34 | @property (nonatomic, readonly, strong) UIColor *disabledColor; 35 | 36 | - (instancetype)initWithFont:(UIFont *)font color:(UIColor *)color highlightColor:(UIColor *)highlightColor disabledColor:(UIColor *)disabledColor; 37 | - (instancetype)initWithFont:(UIFont *)font color:(UIColor *)color; 38 | 39 | - (NSDictionary *)textAttributes; 40 | - (NSDictionary *)highlightedTextAttributes; 41 | - (NSDictionary *)disabledTextAttributes; 42 | 43 | - (void)styleLabel:(UILabel *)label; 44 | - (void)styleTextField:(UITextField *)textField; 45 | - (void)styleTextView:(UITextView *)textView; 46 | - (void)styleButton:(UIButton *)button; 47 | - (void)styleBarButtonItem:(UIBarButtonItem *)item; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Foundation/Subclass Responsibility/NSException+TWTSubclassResponsibility.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSException+TWTSubclassResponsibility.h 3 | // TWTToast 4 | // 5 | // Created by Prachi Gauriar on 1/5/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | /*! 30 | The TWTSubclassResponsibility category of NSException provides a convenience factory method for creating 31 | exceptions when implementing a given method is a subclass's responsibility. 32 | */ 33 | @interface NSException (TWTSubclassResponsibility) 34 | 35 | /*! 36 | @abstract Creates and returns a new NSInternalInconsistencyException indicating that implementing 37 | the method specified by the given receiver-selector pair is a subclass's responsibility. 38 | @param receiver The object responding to the selector. This is typically self. 39 | @param selector The selector to which the receiver will be responding. This is typically _cmd. 40 | @result A new NSInternalInconsistencyException 41 | */ 42 | + (nullable instancetype)twt_subclassResponsibilityExceptionWithReceiver:(id _Nonnull)receiver selector:(SEL _Nonnull)selector; 43 | 44 | @end 45 | 46 | -------------------------------------------------------------------------------- /UIKit/Snapshot Image/UIView+TWTSnapshotImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+TWTSnapshotImage.h 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 3/11/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | /*! 30 | The TWTSnapshotImage category of UIView provides a convenient method for getting a snapshot image of a view’s hiearachy. 31 | */ 32 | @interface UIView (TWTSnapshotImage) 33 | 34 | /*! 35 | @abstract Renders and returns a snapshot image of the receiver’s view hiearachy with the specified background color. 36 | @param backgroundColor The background color to draw under the view’s non-opaque regions. If nil, no background 37 | color is drawn. 38 | @param afterUpdates Whether the snapshot should be rendered after recent changes have been incorporated. Specify 39 | the value NO if you want to render a snapshot in the view hierarchy’s current state, which might not include 40 | recent changes. 41 | @result A snapshot image of the receiver and its subviews. 42 | */ 43 | - (UIImage *)twt_snapshotImageWithBackgroundColor:(UIColor *)backgroundColor afterScreenUpdates:(BOOL)afterUpdates; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Foundation/Error Utilities/TWTErrorUtilities.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTErrorUtilities.m 3 | // TWTToast 4 | // 5 | // Created by Prachi Gauriar on 12/6/2012. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTErrorUtilities.h" 28 | 29 | NSString *TWTPrettySelector(id receiver, SEL selector) 30 | { 31 | char methodType = [receiver isMemberOfClass:[receiver class]] ? '-' : '+'; 32 | return [NSString stringWithFormat:@"%c%@", methodType, NSStringFromSelector(selector)]; 33 | } 34 | 35 | 36 | NSString *TWTPrettyMethodName(id receiver, SEL selector) 37 | { 38 | char methodType = [receiver isMemberOfClass:[receiver class]] ? '-' : '+'; 39 | return [NSString stringWithFormat:@"%c[%@ %@]", methodType, NSStringFromClass([receiver class]), NSStringFromSelector(selector)]; 40 | } 41 | 42 | 43 | NSString *TWTExceptionString(id receiver, SEL selector, NSString *format, ...) 44 | { 45 | va_list arguments; 46 | va_start(arguments, format); 47 | NSString *messageString = [[NSString alloc] initWithFormat:format arguments:arguments]; 48 | va_end(arguments); 49 | 50 | return [NSString stringWithFormat:@"*** %@: %@", TWTPrettyMethodName(receiver, selector), messageString]; 51 | } 52 | -------------------------------------------------------------------------------- /UIKit/Blocks/UIActionSheet+TWTBlocks.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIActionSheet+TWTBlocks.m 3 | // Toast 4 | // 5 | // Based on SXYActionSheet, created by Jeremy Ellison on 2/9/12. 6 | // Created by Andrew Hershberger on 6 February 2013 7 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import "UIActionSheet+TWTBlocks.h" 29 | #import 30 | 31 | static char kTapHandlerKey; 32 | 33 | @implementation UIActionSheet (TWTBlocks) 34 | 35 | - (void)twt_setTapHandler:(TWTActionSheetBlock)tapHandler 36 | { 37 | self.delegate = tapHandler ? self : nil; 38 | 39 | objc_setAssociatedObject(self, &kTapHandlerKey, tapHandler, OBJC_ASSOCIATION_COPY_NONATOMIC); 40 | } 41 | 42 | - (TWTActionSheetBlock)twt_tapHandler 43 | { 44 | return objc_getAssociatedObject(self, &kTapHandlerKey); 45 | } 46 | 47 | #pragma mark - UIActionSheetDelegate 48 | 49 | - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex 50 | { 51 | TWTActionSheetBlock tapHandler = self.twt_tapHandler; 52 | if (tapHandler) { 53 | tapHandler(self, buttonIndex); 54 | } 55 | self.twt_tapHandler = nil; 56 | } 57 | 58 | - (void)actionSheetCancel:(UIActionSheet *)actionSheet 59 | { 60 | self.twt_tapHandler = nil; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /UIKit/Color/UIColor+TWTColorHelpers.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+TWTColorHelpers.h 3 | // Toast 4 | // 5 | // Created by Kevin Conner on 1/13/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface UIColor (TWTColorHelpers) 30 | 31 | /** 32 | @abstract Create a UIColor with a Hex value. 33 | @param hex An integer hex value to used to create a value. 34 | @param alpha A CGFloat value to control the alpha of the color. 35 | @result A new instance of a UIColor 36 | */ 37 | + (UIColor *)twt_colorWithHex:(uint32_t)hex alpha:(CGFloat)alpha; 38 | 39 | /** 40 | @abstract Create a UIColor with a Hex String. 41 | @param hexString A hex string conforming to #FFFFFF or FFFFFF defining the color to build. 42 | @param alpha A CGFloat value to control the alpha of the color. 43 | @result A new instance of a UIColor 44 | */ 45 | + (UIColor *)twt_colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha; 46 | 47 | /*! 48 | @abstract Returns a hexidecimal string representation of the receiver, or nil if the color cannot be converted to RGB components. 49 | @discussion Format of the result begins with a # character and uses lower case letters (e.g., "#ff0000") 50 | */ 51 | - (NSString *)twt_hexadecimalString; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /UIKit/Prepare for Segue/UIViewController+TWTPrepareForSegue.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+TWTPrepareForSegue.m 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 5/22/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "UIViewController+TWTPrepareForSegue.h" 28 | 29 | @implementation UIViewController (TWTPrepareForSegue) 30 | 31 | - (void)twt_prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 32 | { 33 | NSString *identifier = segue.identifier; 34 | if (!identifier) { 35 | return; 36 | } 37 | 38 | NSString *capitalizedIdentifier = nil; 39 | if (identifier.length < 2) { 40 | capitalizedIdentifier = [identifier uppercaseString]; 41 | } else { 42 | capitalizedIdentifier = [[[identifier substringToIndex:1] uppercaseString] stringByAppendingString:[identifier substringFromIndex:1]]; 43 | } 44 | 45 | SEL selector = NSSelectorFromString([NSString stringWithFormat:@"twt_prepareFor%@Segue:sender:", capitalizedIdentifier]); 46 | if ([self respondsToSelector:selector]) { 47 | #pragma clang diagnostic push 48 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 49 | [self performSelector:selector withObject:segue withObject:sender]; 50 | } 51 | #pragma clang diagnostic pop 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Pods/Mantle/LICENSE.md: -------------------------------------------------------------------------------- 1 | **Copyright (c) 2012 - 2014, GitHub, Inc.** 2 | **All rights reserved.** 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | 10 | --- 11 | 12 | **This project uses portions of code from the Proton framework.** 13 | **Proton is copyright (c) 2012, Bitswift, Inc.** 14 | **All rights reserved.** 15 | 16 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 19 | * Neither the name of the Bitswift, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | -------------------------------------------------------------------------------- /ToastTests/TWTRandomizedTestCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTRandomizedTestCase.h 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 1/13/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | #import 29 | 30 | /*! 31 | TWTRandomizedTestCases simply override +setUp to call srandomdev() and -setUp to generate and log a 32 | random seed value before calling srandom(). Subclasses that override +setUp or -setUp should invoke 33 | the superclass implementation. 34 | */ 35 | @interface TWTRandomizedTestCase : XCTestCase 36 | @end 37 | 38 | 39 | /*! 40 | @abstract XCTAsserts that the given expression evaluates to YES before the given timeout interval elapses. 41 | @param timeoutInterval An NSTimeInterval containing the amount of time to wait for the expression to evaluate to YES. 42 | @param expression The boolean expression to evaluate. 43 | @param format An NSString object that contains a printf-style string containing an error message describing the failure 44 | condition and placeholders for the arguments. 45 | @param ... The arguments displayed in the format string. 46 | */ 47 | #define UMKAssertTrueBeforeTimeout(timeoutInterval, expression, format...) \ 48 | XCTAssertTrue(UMKWaitForCondition((timeoutInterval), ^BOOL{ return (expression); }), ## format) 49 | -------------------------------------------------------------------------------- /Mantle/Mantle Model/TWTMantleModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTMantleModel.m 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 3/8/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTMantleModel.h" 28 | 29 | @import ObjectiveC.runtime; 30 | 31 | @implementation TWTMantleModel 32 | 33 | - (instancetype)initWithDictionary:(NSDictionary *)dictionary error:(NSError **)error 34 | { 35 | self = [self init]; 36 | if (self) { 37 | for (NSString *key in dictionary) { 38 | id value = [dictionary objectForKey:key]; 39 | 40 | if ([value isEqual:[NSNull null]]) { 41 | value = nil; 42 | } 43 | 44 | [self setValue:value forKey:key]; 45 | } 46 | } 47 | 48 | return self; 49 | } 50 | 51 | 52 | + (NSSet *)excludedPropertyKeys 53 | { 54 | return [NSSet set]; 55 | } 56 | 57 | 58 | + (NSSet *)propertyKeys 59 | { 60 | NSSet *propertyKeys = objc_getAssociatedObject(self, _cmd); 61 | if (!propertyKeys) { 62 | NSMutableSet *keys = [[super propertyKeys] mutableCopy]; 63 | [keys minusSet:[self excludedPropertyKeys]]; 64 | propertyKeys = [keys copy]; 65 | objc_setAssociatedObject(self, _cmd, propertyKeys, OBJC_ASSOCIATION_RETAIN); 66 | } 67 | 68 | return propertyKeys; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /ExampleApplication/TWTAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTAppDelegate.m 3 | // Toast 4 | // 5 | // Created by Josh Johnson on 1/12/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTAppDelegate.h" 28 | 29 | #import "TWTNavigationControllerDelegate.h" 30 | #import "TWTSampleViewController.h" 31 | 32 | 33 | @interface TWTAppDelegate () 34 | 35 | @property (nonatomic, strong) TWTNavigationControllerDelegate *navigationControllerDelegate; 36 | 37 | @end 38 | 39 | 40 | @implementation TWTAppDelegate 41 | 42 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 43 | { 44 | TWTSampleViewController *viewController = [[TWTSampleViewController alloc] initWithStyle:UITableViewStylePlain]; 45 | UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; 46 | self.navigationControllerDelegate = [[TWTNavigationControllerDelegate alloc] init]; 47 | navigationController.delegate = self.navigationControllerDelegate; 48 | 49 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 50 | self.window.rootViewController = navigationController; 51 | self.window.backgroundColor = [UIColor whiteColor]; 52 | [self.window makeKeyAndVisible]; 53 | 54 | return YES; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/extobjc/EXTKeyPathCoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // EXTKeyPathCoding.h 3 | // extobjc 4 | // 5 | // Created by Justin Spahr-Summers on 19.06.12. 6 | // Copyright (C) 2012 Justin Spahr-Summers. 7 | // Released under the MIT license. 8 | // 9 | 10 | #import 11 | #import "metamacros.h" 12 | 13 | /** 14 | * \@keypath allows compile-time verification of key paths. Given a real object 15 | * receiver and key path: 16 | * 17 | * @code 18 | 19 | NSString *UTF8StringPath = @keypath(str.lowercaseString.UTF8String); 20 | // => @"lowercaseString.UTF8String" 21 | 22 | NSString *versionPath = @keypath(NSObject, version); 23 | // => @"version" 24 | 25 | NSString *lowercaseStringPath = @keypath(NSString.new, lowercaseString); 26 | // => @"lowercaseString" 27 | 28 | * @endcode 29 | * 30 | * ... the macro returns an \c NSString containing all but the first path 31 | * component or argument (e.g., @"lowercaseString.UTF8String", @"version"). 32 | * 33 | * In addition to simply creating a key path, this macro ensures that the key 34 | * path is valid at compile-time (causing a syntax error if not), and supports 35 | * refactoring, such that changing the name of the property will also update any 36 | * uses of \@keypath. 37 | */ 38 | #define keypath(...) \ 39 | metamacro_if_eq(1, metamacro_argcount(__VA_ARGS__))(keypath1(__VA_ARGS__))(keypath2(__VA_ARGS__)) 40 | 41 | #define keypath1(PATH) \ 42 | (((void)(NO && ((void)PATH, NO)), strchr(# PATH, '.') + 1)) 43 | 44 | #define keypath2(OBJ, PATH) \ 45 | (((void)(NO && ((void)OBJ.PATH, NO)), # PATH)) 46 | 47 | /** 48 | * \@collectionKeypath allows compile-time verification of key paths across collections NSArray/NSSet etc. Given a real object 49 | * receiver, collection object receiver and related keypaths: 50 | * 51 | * @code 52 | 53 | NSString *employessFirstNamePath = @collectionKeypath(department.employees, Employee.new, firstName) 54 | // => @"employees.firstName" 55 | 56 | NSString *employessFirstNamePath = @collectionKeypath(Department.new, employees, Employee.new, firstName) 57 | // => @"employees.firstName" 58 | 59 | * @endcode 60 | * 61 | */ 62 | #define collectionKeypath(...) \ 63 | metamacro_if_eq(3, metamacro_argcount(__VA_ARGS__))(collectionKeypath3(__VA_ARGS__))(collectionKeypath4(__VA_ARGS__)) 64 | 65 | #define collectionKeypath3(PATH, COLLECTION_OBJECT, COLLECTION_PATH) ([[NSString stringWithFormat:@"%s.%s",keypath(PATH), keypath(COLLECTION_OBJECT, COLLECTION_PATH)] UTF8String]) 66 | 67 | #define collectionKeypath4(OBJ, PATH, COLLECTION_OBJECT, COLLECTION_PATH) ([[NSString stringWithFormat:@"%s.%s",keypath(OBJ, PATH), keypath(COLLECTION_OBJECT, COLLECTION_PATH)] UTF8String]) 68 | 69 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/MTLValueTransformer.m: -------------------------------------------------------------------------------- 1 | // 2 | // MTLValueTransformer.m 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-11. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "MTLValueTransformer.h" 10 | 11 | // 12 | // Any MTLValueTransformer supporting reverse transformation. Necessary because 13 | // +allowsReverseTransformation is a class method. 14 | // 15 | @interface MTLReversibleValueTransformer : MTLValueTransformer 16 | @end 17 | 18 | @interface MTLValueTransformer () 19 | 20 | @property (nonatomic, copy, readonly) MTLValueTransformerBlock forwardBlock; 21 | @property (nonatomic, copy, readonly) MTLValueTransformerBlock reverseBlock; 22 | 23 | @end 24 | 25 | @implementation MTLValueTransformer 26 | 27 | #pragma mark Lifecycle 28 | 29 | + (instancetype)transformerWithBlock:(MTLValueTransformerBlock)transformationBlock { 30 | return [[self alloc] initWithForwardBlock:transformationBlock reverseBlock:nil]; 31 | } 32 | 33 | + (instancetype)reversibleTransformerWithBlock:(MTLValueTransformerBlock)transformationBlock { 34 | return [self reversibleTransformerWithForwardBlock:transformationBlock reverseBlock:transformationBlock]; 35 | } 36 | 37 | + (instancetype)reversibleTransformerWithForwardBlock:(MTLValueTransformerBlock)forwardBlock reverseBlock:(MTLValueTransformerBlock)reverseBlock { 38 | return [[MTLReversibleValueTransformer alloc] initWithForwardBlock:forwardBlock reverseBlock:reverseBlock]; 39 | } 40 | 41 | - (id)initWithForwardBlock:(MTLValueTransformerBlock)forwardBlock reverseBlock:(MTLValueTransformerBlock)reverseBlock { 42 | NSParameterAssert(forwardBlock != nil); 43 | 44 | self = [super init]; 45 | if (self == nil) return nil; 46 | 47 | _forwardBlock = [forwardBlock copy]; 48 | _reverseBlock = [reverseBlock copy]; 49 | 50 | return self; 51 | } 52 | 53 | #pragma mark NSValueTransformer 54 | 55 | + (BOOL)allowsReverseTransformation { 56 | return NO; 57 | } 58 | 59 | + (Class)transformedValueClass { 60 | return [NSObject class]; 61 | } 62 | 63 | - (id)transformedValue:(id)value { 64 | return self.forwardBlock(value); 65 | } 66 | 67 | @end 68 | 69 | @implementation MTLReversibleValueTransformer 70 | 71 | #pragma mark Lifecycle 72 | 73 | - (id)initWithForwardBlock:(MTLValueTransformerBlock)forwardBlock reverseBlock:(MTLValueTransformerBlock)reverseBlock { 74 | NSParameterAssert(reverseBlock != nil); 75 | return [super initWithForwardBlock:forwardBlock reverseBlock:reverseBlock]; 76 | } 77 | 78 | #pragma mark NSValueTransformer 79 | 80 | + (BOOL)allowsReverseTransformation { 81 | return YES; 82 | } 83 | 84 | - (id)reverseTransformedValue:(id)value { 85 | return self.reverseBlock(value); 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /Pods/URLMock/URLMock/Utilities/UMKParameterPair.h: -------------------------------------------------------------------------------- 1 | // 2 | // UMKParameterPair.h 3 | // URLMock 4 | // 5 | // Created by Prachi Gauriar on 1/7/2014. 6 | // Copyright (c) 2014 Two Toasters, LLC, (c) 2013 AFNetworking (http://afnetworking.com/) 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | /*! 30 | UMKParameterPair objects store a key-value pair for use with URL encoding/decoding APIs in URLMock. 31 | @note The basic design and some of the code here is adapted or borrowed from AFNetworking. 32 | */ 33 | @interface UMKParameterPair : NSObject 34 | 35 | /*! The instance's key. */ 36 | @property (nonatomic, strong) NSString *key; 37 | 38 | /*! The instance's value. */ 39 | @property (nonatomic, strong) id value; 40 | 41 | /*! 42 | @abstract Returns a newly initialized UMKParameterPair instance with the specfied key and value. 43 | @param key The key for the new pair object. 44 | @param value The value for the new pair object. 45 | @result A newly initialized UMKParameterPair with the specified key and value. 46 | */ 47 | - (instancetype)initWithKey:(NSString *)key value:(id)value; 48 | 49 | /*! 50 | @abstract Returns a URL encoded string representation of the receiver. 51 | @discussion Characters that can't be represented in a URL are percent-escaped the specified encoding. 52 | @param encoding The encoding to use when percent-escaping the receiver key and value. 53 | @result A URL encoded string representation of the receiver. 54 | */ 55 | - (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)encoding; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Mantle/Selective JSON Adapter/TWTSelectiveJSONAdapter.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTSelectiveJSONAdapter.h 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 3/11/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | /*! 30 | Selective JSON adapters enable serializing only a subset of a model object’s properties into JSON. 31 | */ 32 | @interface TWTSelectiveJSONAdapter : MTLJSONAdapter 33 | 34 | /*! The property keys the instance serializes. */ 35 | @property (nonatomic, copy, readonly) NSSet *propertyKeys; 36 | 37 | /*! 38 | @abstract Initializes a selective JSON adapter instance with the specified model and property keys. 39 | @param model The model object that will be serialized. 40 | @param propertyKeys The property keys the instance serializes. 41 | @result A selective JSON adapter initialized with the specified model and property keys. 42 | */ 43 | - (instancetype)initWithModel:(MTLModel *)model propertyKeys:(NSSet *)propertyKeys; 44 | 45 | /*! 46 | @abstract Returns a JSON dictionary representation of the specified property keys of the specified model object. 47 | @param propertyKeys The property keys whose values should be serialized into JSON. 48 | @param model The model object to serialize. 49 | @result A JSON dictionary representation of the specified property keys of the specified model object. 50 | */ 51 | + (NSDictionary *)JSONDictionaryWithPropertyKeys:(NSSet *)propertyKeys fromModel:(MTLModel *)model; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Mantle 5 | 6 | **Copyright (c) 2012 - 2014, GitHub, Inc.** 7 | **All rights reserved.** 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | 15 | --- 16 | 17 | **This project uses portions of code from the Proton framework.** 18 | **Proton is copyright (c) 2012, Bitswift, Inc.** 19 | **All rights reserved.** 20 | 21 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 22 | 23 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 24 | * Neither the name of the Bitswift, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | Generated by CocoaPods - http://cocoapods.org 29 | -------------------------------------------------------------------------------- /Pods/URLMock/URLMock/Utilities/UMKErrorUtilities.m: -------------------------------------------------------------------------------- 1 | // 2 | // UMKErrorUtilities.m 3 | // URLMock 4 | // 5 | // Created by Prachi Gauriar on 12/6/2012. 6 | // Copyright (c) 2013–2014 Two Toasters, LLC. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | NSString *UMKPrettySelector(id receiver, SEL selector) 30 | { 31 | char methodType = [receiver isMemberOfClass:[receiver class]] ? '-' : '+'; 32 | return [NSString stringWithFormat:@"%c%@", methodType, NSStringFromSelector(selector)]; 33 | } 34 | 35 | 36 | NSString *UMKPrettyMethodName(id receiver, SEL selector) 37 | { 38 | char methodType = [receiver isMemberOfClass:[receiver class]] ? '-' : '+'; 39 | return [NSString stringWithFormat:@"%c[%@ %@]", methodType, NSStringFromClass([receiver class]), NSStringFromSelector(selector)]; 40 | } 41 | 42 | 43 | NSString *UMKAssertionString(id receiver, SEL selector, NSString *format, ...) 44 | { 45 | va_list arguments; 46 | va_start(arguments, format); 47 | NSString *messageString = [[NSString alloc] initWithFormat:format arguments:arguments]; 48 | va_end(arguments); 49 | 50 | return [NSString stringWithFormat:@"*** %@: %@", UMKPrettyMethodName(receiver, selector), messageString]; 51 | } 52 | 53 | 54 | NSString *UMKExceptionString(id receiver, SEL selector, NSString *format, ...) 55 | { 56 | va_list arguments; 57 | va_start(arguments, format); 58 | NSString *messageString = [[NSString alloc] initWithFormat:format arguments:arguments]; 59 | va_end(arguments); 60 | 61 | return [NSString stringWithFormat:@"*** %@: %@", UMKPrettyMethodName(receiver, selector), messageString]; 62 | } 63 | -------------------------------------------------------------------------------- /Pods/URLMock/URLMock/Categories/NSURL+UMKQueryParameters.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+UMKQueryParameters.m 3 | // URLMock 4 | // 5 | // Created by Prachi Gauriar on 1/4/2014. 6 | // Copyright (c) 2014 Two Toasters, LLC. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | #import 30 | 31 | @implementation NSURL (UMKQueryParameters) 32 | 33 | - (instancetype)umk_initWithString:(NSString *)URLString parameters:(NSDictionary *)parameters 34 | { 35 | return [self umk_initWithString:URLString parameters:parameters relativeToURL:nil]; 36 | } 37 | 38 | 39 | - (instancetype)umk_initWithString:(NSString *)URLString parameters:(NSDictionary *)parameters relativeToURL:(NSURL *)baseURL 40 | { 41 | if (parameters) { 42 | NSString *encodedParameters = [parameters umk_URLEncodedParameterString]; 43 | NSRange questionMarkRange = [URLString rangeOfString:@"?" options:NSBackwardsSearch]; 44 | URLString = [URLString stringByAppendingFormat:@"%c%@", questionMarkRange.location == NSNotFound ? '?' : '&', encodedParameters]; 45 | } 46 | 47 | return [self initWithString:URLString relativeToURL:baseURL]; 48 | } 49 | 50 | 51 | + (instancetype)umk_URLWithString:(NSString *)URLString parameters:(NSDictionary *)parameters 52 | { 53 | return [[self alloc] umk_initWithString:URLString parameters:parameters]; 54 | } 55 | 56 | 57 | + (instancetype)umk_URLWithString:(NSString *)URLString parameters:(NSDictionary *)parameters relativeToURL:(NSURL *)baseURL 58 | { 59 | return [[self alloc] umk_initWithString:URLString parameters:parameters relativeToURL:baseURL]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /UIKit/View Controller Transitions/TWTSimpleAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTSimpleAnimationController.h 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 3/4/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // A prior version of this code was written for Normal Ears, Inc. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | /*! 31 | TWTSimpleAnimationController provides a basic implementation of the UIViewControllerAnimatedTransitioning 32 | protocol. It allows for customizing transitions between view controllers using UIViewAnimationOptions. This 33 | enables easily transitioning between view controllers using flips, page curls, and cross disolves. 34 | */ 35 | @interface TWTSimpleAnimationController : NSObject 36 | 37 | /*! 38 | @abstract Returns an initialized animation controller instance with the specified duration and animation options. 39 | @discussion This is the class’s designated initializer. 40 | @param duration The duration of the animated transition. 41 | @param options The animation options used during the transition. This can be used to customize what animation 42 | is used. 43 | @result An initialized simple animation controller with the specified duration and options. 44 | */ 45 | - (instancetype)initWithDuration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options; 46 | 47 | /*! The duration of the transition. 0.5 by default. */ 48 | @property (nonatomic) NSTimeInterval duration; 49 | 50 | /*! The options for the transition animation. Use this to change the type of animation. 0 by default. */ 51 | @property (nonatomic) UIViewAnimationOptions options; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /UIKit/Device/UIDevice+TWTSystemVersion.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIDevice+TWTSystemVersion.h 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 12/3/2013. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface UIDevice (TWTSystemVersion) 30 | 31 | - (NSInteger)twt_systemMajorVersion; 32 | - (NSInteger)twt_systemMinorVersion; 33 | - (NSInteger)twt_systemReleaseVersion; 34 | 35 | - (NSComparisonResult)twt_compareSystemVersionToMajor:(NSInteger)major minor:(NSInteger)minor release:(NSInteger)release; 36 | 37 | @end 38 | 39 | #define TWT_SYSTEM_VERSION_LESS_THAN(MAJOR, MINOR, RELEASE) ([[UIDevice currentDevice] twt_compareSystemVersionToMajor:(MAJOR) minor:(MINOR) release:(RELEASE)] < NSOrderedSame) 40 | #define TWT_SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(MAJOR, MINOR, RELEASE) ([[UIDevice currentDevice] twt_compareSystemVersionToMajor:(MAJOR) minor:(MINOR) release:(RELEASE)] <= NSOrderedSame) 41 | #define TWT_SYSTEM_VERSION_NOT_EQUAL_TO(MAJOR, MINOR, RELEASE) ([[UIDevice currentDevice] twt_compareSystemVersionToMajor:(MAJOR) minor:(MINOR) release:(RELEASE)] != NSOrderedSame) 42 | #define TWT_SYSTEM_VERSION_EQUAL_TO(MAJOR, MINOR, RELEASE) ([[UIDevice currentDevice] twt_compareSystemVersionToMajor:(MAJOR) minor:(MINOR) release:(RELEASE)] == NSOrderedSame) 43 | #define TWT_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(MAJOR, MINOR, RELEASE) ([[UIDevice currentDevice] twt_compareSystemVersionToMajor:(MAJOR) minor:(MINOR) release:(RELEASE)] >= NSOrderedSame) 44 | #define TWT_SYSTEM_VERSION_GREATER_THAN(MAJOR, MINOR, RELEASE) ([[UIDevice currentDevice] twt_compareSystemVersionToMajor:(MAJOR) minor:(MINOR) release:(RELEASE)] > NSOrderedSame) 45 | -------------------------------------------------------------------------------- /UIKit/Nib-Backed View/TWTNibBackedView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTNibBackedView.m 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 10/22/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTNibBackedView.h" 28 | 29 | 30 | @implementation TWTNibBackedView 31 | 32 | - (instancetype)initWithFrame:(CGRect)frame 33 | { 34 | self = [super initWithFrame:frame]; 35 | if (self) { 36 | [self instantiateObjectsInBackingNib]; 37 | } 38 | 39 | return self; 40 | } 41 | 42 | 43 | - (instancetype)initWithCoder:(NSCoder *)decoder 44 | { 45 | self = [super initWithCoder:decoder]; 46 | if (self) { 47 | [self instantiateObjectsInBackingNib]; 48 | } 49 | 50 | return self; 51 | } 52 | 53 | 54 | - (void)instantiateObjectsInBackingNib 55 | { 56 | [[[self class] nib] instantiateWithOwner:self options:nil]; 57 | 58 | NSAssert(self.contentView, @"contentView outlet was not set in nib"); 59 | self.contentView.frame = self.bounds; 60 | self.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 61 | [self addSubview:self.contentView]; 62 | [self didInstantiateObjectsInBackingNib]; 63 | } 64 | 65 | 66 | - (void)layoutSubviews 67 | { 68 | [super layoutSubviews]; 69 | [self.contentView layoutIfNeeded]; 70 | } 71 | 72 | 73 | - (void)didInstantiateObjectsInBackingNib 74 | { 75 | } 76 | 77 | 78 | + (UINib *)nib 79 | { 80 | return [UINib nibWithNibName:[self nibName] bundle:[self nibBundle]]; 81 | } 82 | 83 | 84 | + (NSString *)nibName 85 | { 86 | return NSStringFromClass(self); 87 | } 88 | 89 | 90 | + (NSBundle *)nibBundle 91 | { 92 | return [NSBundle bundleForClass:self]; 93 | } 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /UIKit/View Controller Transitions/TWTNavigationControllerDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTNavigationControllerDelegate.h 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 3/3/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // A prior version of this code was written for Normal Ears, Inc. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | 31 | /*! 32 | TWTNavigationControllerDelegate is a navigation controller delegate that implements 33 | -navigationController:animationControllerForOperation:fromViewController:toViewController:. 34 | Its implementation returns the to view-controller’s push animation controller on pushes and 35 | the from view-controller’s pop animation controller on pops. See UIViewController 36 | (TWTNavigationControllerDelegate) for more information. 37 | 38 | This class can be used as the base class for other navigation controller delegates, should 39 | you wish to implement additional methods in the UINavigationControllerDelegate protocol. 40 | */ 41 | @interface TWTNavigationControllerDelegate : NSObject 42 | @end 43 | 44 | 45 | /*! 46 | The TWTNavigationControllerDelegate category on UIViewController adds the ability to store a 47 | view controller’s push and pop animation controllers as properties of the view controller itself. 48 | */ 49 | @interface UIViewController (TWTNavigationControllerDelegate) 50 | 51 | /*! The animation controller to use when pushing to the receiver. */ 52 | @property (nonatomic, strong) id twt_pushAnimationController; 53 | 54 | /*! The animation controller to use when popping from the receiver. */ 55 | @property (nonatomic, strong) id twt_popAnimationController; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /UIKit/Block Actions/UIControl+TWTBlockActions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+TWTBlockActions.h 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 10/23/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | 30 | /*! 31 | The TWTBlockActions category of UIControl adds methods for adding and removing actions to a control 32 | that use blocks instead of typical target objects with action selectors. 33 | */ 34 | @interface UIControl (TWTBlockActions) 35 | 36 | /*! 37 | @abstract Adds the specified block as a block action that fires when the specified control events 38 | occur. 39 | @param controlEvents A bitmask specifying the control events associated with the block action. 40 | @param block The block to execute when the specified control events occur. May not be nil. 41 | @result An opaque object representing the block action. This may be used to remove a block action 42 | from the receiver using -twt_removeBlockAction. 43 | */ 44 | - (id)twt_addBlockActionForControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender, UIEvent *event))block; 45 | 46 | /*! 47 | @abstract Removes the specified block action from the receiver. 48 | @discussion Removing block actions by invoking -removeTarget:action:forControlEvents:, e.g., with a 49 | nil target and NULL action will also remove block actions. However, doing so will defer 50 | releasing the memory associated with the block action until the receiver is deallocated. Using 51 | this method will release the memory earlier, if possible. The memory footprint of a block action 52 | is small, so this should not be a huge concern. 53 | @param action The opaque block action object that was returned by -twt_addBlockActionForControlEvents:block: 54 | */ 55 | - (void)twt_removeBlockAction:(id)action; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Foundation/NSArray Index Path Additions/NSArray+TWTIndexPath.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+TWTIndexPath.m 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 3/9/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import "NSArray+TWTIndexPath.h" 29 | 30 | 31 | @implementation NSArray (TWTIndexPath) 32 | 33 | - (id)twt_objectAtIndexPath:(NSIndexPath *)indexPath 34 | { 35 | if (indexPath.length == 0) { 36 | return nil; 37 | } 38 | 39 | id object = self; 40 | NSUInteger length = indexPath.length; 41 | 42 | for (NSUInteger position=0; position 28 | 29 | @interface TWTMantleModel : MTLModel 30 | 31 | /*! 32 | @abstract Overrides superclass implementation to remove validation. 33 | @discussion Validation is still available, but must be invoked manually. This change prevents 34 | validation from causing mapping or copying to fail. This allows more flexibility about how to 35 | incorporate validation. 36 | */ 37 | - (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError *__autoreleasing *)error; 38 | 39 | /*! 40 | @abstract Returns a set of property keys that should be excluded from Mantle operations on the receiver’s 41 | instances. 42 | @discussion Subclasses should override this method to return any keys that should not be automatically 43 | encoded/decoded or included in calculations of -hash, -isEqual:, or -description. The default 44 | implementation returns the empty set. 45 | 46 | One important use of this method is to handle inverse relationships. Mantle can’t detect circular 47 | references, and thus its default implementations of -description, -hash, and -isEqual: will recurse 48 | infinitely unless inverse relationships are excluded. By implementing this method and returning keys 49 | for the inverse relationships, the aforementioned methods will just work. 50 | 51 | Subclasses should take care that their implementation of this method adds their excluded property keys 52 | to those of their superclass’s. A typical implementation looks like: 53 | 54 | return [[super excludedPropertyKeys] setByAddingObjectsFromArray:@[ o1, o2, …, oN ]]; 55 | @result A set of property keys that should be excluded from Mantle operations on the receiver’s instances. 56 | */ 57 | + (NSSet *)excludedPropertyKeys; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /UIKit/Blocks/UIAlertView+TWTBlocks.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+TWTBlocks.m 3 | // Toast 4 | // 5 | // Based on SXYAlertView, created by Jeremy Ellison on 2/9/12. 6 | // Created by Andrew Hershberger on 6 February 2013 7 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import "UIAlertView+TWTBlocks.h" 29 | #import 30 | 31 | static char kTapHandlerKey; 32 | static char kDismissHandlerKey; 33 | 34 | @implementation UIAlertView (TWTBlocks) 35 | 36 | - (void)twt_setTapHandler:(TWTAlertBlock)tapHandler 37 | { 38 | self.delegate = (tapHandler || self.twt_dismissHandler) ? self : nil; 39 | 40 | objc_setAssociatedObject(self, &kTapHandlerKey, tapHandler, OBJC_ASSOCIATION_COPY_NONATOMIC); 41 | } 42 | 43 | - (TWTAlertBlock)twt_tapHandler 44 | { 45 | return objc_getAssociatedObject(self, &kTapHandlerKey); 46 | } 47 | 48 | - (void)twt_setDismissHandler:(TWTAlertBlock)dismissHandler 49 | { 50 | self.delegate = (dismissHandler || self.twt_tapHandler) ? self : nil; 51 | 52 | objc_setAssociatedObject(self, &kDismissHandlerKey, dismissHandler, OBJC_ASSOCIATION_COPY_NONATOMIC); 53 | } 54 | 55 | - (TWTAlertBlock)twt_dismissHandler 56 | { 57 | return objc_getAssociatedObject(self, &kDismissHandlerKey); 58 | } 59 | 60 | #pragma mark - UIAlertViewDelegate 61 | 62 | - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 63 | { 64 | TWTAlertBlock tapHandler = self.twt_tapHandler; 65 | if (tapHandler) { 66 | tapHandler(self, buttonIndex); 67 | } 68 | 69 | self.twt_tapHandler = nil; 70 | } 71 | 72 | - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex 73 | { 74 | TWTAlertBlock dismissHandler = self.twt_dismissHandler; 75 | if (dismissHandler) { 76 | dismissHandler(self, buttonIndex); 77 | } 78 | 79 | self.twt_dismissHandler = nil; 80 | } 81 | 82 | - (void)alertViewCancel:(UIAlertView *)alertView 83 | { 84 | self.twt_tapHandler = nil; 85 | self.twt_dismissHandler = nil; 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /Mantle/Model Class Deserialization/TWTModelClassDeserialization.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTModelClassDeserialization.m 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 6/4/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | 9 | #import "TWTModelClassDeserialization.h" 10 | 11 | #import 12 | 13 | #import "TWTBlockEnumeration.h" 14 | 15 | 16 | NSString *const kTWTModelClassDeserializationErrorDomain = @"TWTModelClassDeserializationErrorDomain"; 17 | NSString *const kTWTModelClassDeserializationErrorUnexpectedObjectKey = @"TWTModelClassDeserializationErrorUnexpectedObjectKey"; 18 | NSString *const kTWTModelClassDeserializationErrorUnderlyingErrorsKey = @"TWTModelClassDeserializationErrorUnderlyingErrorsKey"; 19 | 20 | 21 | @implementation NSObject (TWTModelClassDeserialization) 22 | 23 | - (id)twt_modelOfClass:(Class)class error:(NSError *__autoreleasing *)error 24 | { 25 | if (error) { 26 | *error = [NSError errorWithDomain:kTWTModelClassDeserializationErrorDomain 27 | code:TWTModelClassDeserializationErrorUnexpectedObject 28 | userInfo:@{ kTWTModelClassDeserializationErrorUnexpectedObjectKey : self }]; 29 | } 30 | return nil; 31 | } 32 | 33 | @end 34 | 35 | 36 | @implementation NSArray (TWTModelClassDeserialization) 37 | 38 | - (id)twt_modelOfClass:(Class)class error:(NSError *__autoreleasing *)error 39 | { 40 | NSMutableArray *underlyingErrors = [[NSMutableArray alloc] init]; 41 | NSArray *result = [self twt_collectWithBlock:^(id item) { 42 | NSError *underlyingError = nil; 43 | id modelObject = [item twt_modelOfClass:class error:&underlyingError]; 44 | if (!modelObject && underlyingError) { 45 | [underlyingErrors addObject:underlyingError]; 46 | } 47 | return modelObject; 48 | }]; 49 | 50 | if (underlyingErrors.count) { 51 | result = nil; 52 | if (error) { 53 | *error = [NSError errorWithDomain:kTWTModelClassDeserializationErrorDomain 54 | code:TWTModelClassDeserializationErrorArrayElementsError 55 | userInfo:@{ kTWTModelClassDeserializationErrorUnderlyingErrorsKey : [underlyingErrors copy] }]; 56 | } 57 | } 58 | 59 | return result; 60 | } 61 | 62 | @end 63 | 64 | 65 | @implementation NSDictionary (TWTModelClassDeserialization) 66 | 67 | - (id)twt_modelOfClass:(Class)modelClass error:(NSError *__autoreleasing *)error 68 | { 69 | NSError *underlyingError = nil; 70 | id modelObject = [MTLJSONAdapter modelOfClass:modelClass fromJSONDictionary:self error:&underlyingError]; 71 | 72 | if (!modelObject && error) { 73 | 74 | NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init]; 75 | 76 | if (underlyingError) { 77 | userInfo[NSUnderlyingErrorKey] = underlyingError; 78 | } 79 | 80 | *error = [NSError errorWithDomain:kTWTModelClassDeserializationErrorDomain 81 | code:TWTModelClassDeserializationErrorModelObjectCreation 82 | userInfo:userInfo]; 83 | } 84 | 85 | return modelObject; 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /UIKit/Color/UIColor+TWTColorHelpers.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+TWTColorHelpers.m 3 | // Toast 4 | // 5 | // Created by Kevin Conner on 1/13/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "UIColor+TWTColorHelpers.h" 28 | 29 | @implementation UIColor (TWTColorHelpers) 30 | 31 | + (UIColor *)twt_colorWithHex:(uint32_t)hex alpha:(CGFloat)alpha 32 | { 33 | CGFloat red = (CGFloat) ((hex & 0xff0000) >> 16) / 255.0f; 34 | CGFloat green = (CGFloat) ((hex & 0x00ff00) >> 8) / 255.0f; 35 | CGFloat blue = (CGFloat) (hex & 0x0000ff) / 255.0f; 36 | return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; 37 | } 38 | 39 | + (UIColor *)twt_colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha 40 | { 41 | static NSRegularExpression *regex = nil; 42 | static dispatch_once_t onceToken; 43 | dispatch_once(&onceToken, ^{ 44 | regex = [NSRegularExpression regularExpressionWithPattern:@"^#?[0-9a-f]{6}$" options:NSRegularExpressionCaseInsensitive error:NULL]; 45 | }); 46 | 47 | NSArray *matches = [regex matchesInString:hexString options:NSMatchingAnchored range:NSMakeRange(0, hexString.length)]; 48 | BOOL hexStringValid = (0 < matches.count); 49 | 50 | NSAssert(hexStringValid, @"Tried to parse a hex color that was invalid: %@ (must be of the form #ffffff or ffffff)", hexString); 51 | 52 | UIColor *color = nil; 53 | if (hexStringValid) { 54 | NSScanner *scanner = [NSScanner scannerWithString:hexString]; 55 | scanner.charactersToBeSkipped = [NSCharacterSet characterSetWithCharactersInString:@"#"]; 56 | unsigned int hex; 57 | [scanner scanHexInt:&hex]; 58 | color = [UIColor twt_colorWithHex:hex alpha:alpha]; 59 | } 60 | 61 | return color; 62 | } 63 | 64 | 65 | - (NSString *)twt_hexadecimalString 66 | { 67 | CGFloat red = 0, blue = 0, green = 0; 68 | 69 | if (![self getRed:&red green:&green blue:&blue alpha:nil]) { 70 | return nil; 71 | } 72 | 73 | return [NSString stringWithFormat:@"#%02lx%02lx%02lx", lroundf(red * 255), lroundf(green * 255), lroundf(blue * 255)]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/NSValueTransformer+MTLPredefinedTransformerAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSValueTransformer+MTLPredefinedTransformerAdditions.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-27. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // The name for a value transformer that converts strings into URLs and back. 12 | extern NSString * const MTLURLValueTransformerName; 13 | 14 | // Ensure an NSNumber is backed by __NSCFBoolean/CFBooleanRef 15 | // 16 | // NSJSONSerialization, and likely other serialization libraries, ordinarily 17 | // serialize NSNumbers as numbers, and thus booleans would be serialized as 18 | // 0/1. The exception is when the NSNumber is backed by __NSCFBoolean, which, 19 | // though very much an implementation detail, is detected and serialized as a 20 | // proper boolean. 21 | extern NSString * const MTLBooleanValueTransformerName; 22 | 23 | @interface NSValueTransformer (MTLPredefinedTransformerAdditions) 24 | 25 | // Creates a reversible transformer to convert a JSON dictionary into a MTLModel 26 | // object, and vice-versa. 27 | // 28 | // modelClass - The MTLModel subclass to attempt to parse from the JSON. This 29 | // class must conform to . This argument must 30 | // not be nil. 31 | // 32 | // Returns a reversible transformer which uses MTLJSONAdapter for transforming 33 | // values back and forth. 34 | + (NSValueTransformer *)mtl_JSONDictionaryTransformerWithModelClass:(Class)modelClass; 35 | 36 | // Creates a reversible transformer to convert an array of JSON dictionaries 37 | // into an array of MTLModel objects, and vice-versa. 38 | // 39 | // modelClass - The MTLModel subclass to attempt to parse from each JSON 40 | // dictionary. This class must conform to . 41 | // This argument must not be nil. 42 | // 43 | // Returns a reversible transformer which uses MTLJSONAdapter for transforming 44 | // array elements back and forth. 45 | + (NSValueTransformer *)mtl_JSONArrayTransformerWithModelClass:(Class)modelClass; 46 | 47 | // A reversible value transformer to transform between the keys and objects of a 48 | // dictionary. 49 | // 50 | // dictionary - The dictionary whose keys and values we should transform between. 51 | // 52 | // Can for example be used for transforming between enum values and their string 53 | // representation. 54 | // 55 | // NSValueTransformer *valueTransformer = [NSValueTransformer mtl_valueMappingTransformerWithDictionary:@{ 56 | // @"foo": @(EnumDataTypeFoo), 57 | // @"bar": @(EnumDataTypeBar), 58 | // }]; 59 | // 60 | // Returns a transformer which will map from keys to objects for forward 61 | // transformations, and from objects to keys for reverse transformations. 62 | + (NSValueTransformer *)mtl_valueMappingTransformerWithDictionary:(NSDictionary *)dictionary; 63 | 64 | @end 65 | 66 | @interface NSValueTransformer (UnavailableMTLPredefinedTransformerAdditions) 67 | 68 | + (NSValueTransformer *)mtl_externalRepresentationTransformerWithModelClass:(Class)modelClass __attribute__((deprecated("Replaced by +mtl_JSONDictionaryTransformerWithModelClass:"))); 69 | + (NSValueTransformer *)mtl_externalRepresentationArrayTransformerWithModelClass:(Class)modelClass __attribute__((deprecated("Replaced by +mtl_JSONArrayTransformerWithModelClass:"))); 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /ExampleApplication/TWTSampleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTSampleViewController.m 3 | // Toast 4 | // 5 | // Created by Josh Johnson on 1/12/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTSampleViewController.h" 28 | 29 | NSString * const kToastSampleFileName = @"ToastExamples"; 30 | NSString * const kToastSampleKeyTitle = @"Title"; 31 | NSString * const kToastSampleKeyViewController = @"ViewController"; 32 | 33 | static NSString *twt_cellIdentifier = @"com.ticketmaster.toast.sampleCell"; 34 | 35 | @interface TWTSampleViewController () 36 | 37 | @property (nonatomic, strong) NSArray *examples; 38 | 39 | @end 40 | 41 | @implementation TWTSampleViewController 42 | 43 | #pragma mark - UIViewController 44 | 45 | - (void)viewDidLoad 46 | { 47 | [super viewDidLoad]; 48 | 49 | self.title = @"Toast Examples"; 50 | 51 | NSString *toastSamplesURLString = [[NSBundle mainBundle] pathForResource:kToastSampleFileName ofType:@"plist"]; 52 | self.examples = [NSArray arrayWithContentsOfFile:toastSamplesURLString]; 53 | 54 | [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:twt_cellIdentifier]; 55 | } 56 | 57 | #pragma mark - Table view data source 58 | 59 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 60 | { 61 | return self.examples.count; 62 | } 63 | 64 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 65 | { 66 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:twt_cellIdentifier forIndexPath:indexPath]; 67 | cell.textLabel.font = [UIFont systemFontOfSize:14.0]; 68 | cell.textLabel.text = self.examples[ indexPath.row ][ kToastSampleKeyTitle ]; 69 | return cell; 70 | } 71 | 72 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 73 | { 74 | NSString *className = self.examples[ indexPath.row ][ kToastSampleKeyViewController ]; 75 | Class class = NSClassFromString(className); 76 | 77 | if (class != Nil) { 78 | UIViewController *viewController = (UIViewController *)[[class alloc] init]; 79 | [self.navigationController pushViewController:viewController animated:YES]; 80 | } 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Foundation/Error Utilities/TWTErrorUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTErrorUtilities.h 3 | // TWTToast 4 | // 5 | // Created by Prachi Gauriar on 12/6/2012. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | /*! 28 | @header TWTErrorUtilities 29 | @abstract Defines utility functions and categories for use when creating assertions and exceptions. 30 | @discussion The utility functions allow for easily formatting selectors, method names, and exception reasons. 31 | */ 32 | 33 | #import 34 | 35 | 36 | /*! 37 | @abstract Returns an NSString representation of the selector. 38 | @discussion This simply returns the result of NSStringFromSelector(selector), prefixed with a '+' if receiver is 39 | a class and '-' otherwise. 40 | @param receiver The object responding to the selector. 41 | @param selector The selector to which the receiver will be responding. 42 | @result A pretty-printed NSString representation of the selector. 43 | */ 44 | extern NSString * _Nonnull TWTPrettySelector(id _Nonnull receiver, SEL _Nonnull selector); 45 | 46 | /*! 47 | @abstract Returns an NSString representation of the selector. 48 | @discussion The string is of the form \@"+[receiver selector]" for class methods and \@"-[receiverClassName selector]" 49 | for instance methods. 50 | @param receiver The object responding to the selector. 51 | @param selector The selector to which the receiver will be responding. 52 | @result A pretty-printed NSString representation of the method name, including the receiving class. 53 | */ 54 | extern NSString * _Nonnull TWTPrettyMethodName(id _Nonnull receiver, SEL _Nonnull selector); 55 | 56 | /*! 57 | @abstract Returns an NSString that is formatted suitably for use as an exception message. 58 | @discussion Formatting is consistent with Apple's own exception messages. 59 | @param receiver The object responding to the selector. This is typically self. 60 | @param selector The selector to which the receiver will be responding. This is typically _cmd. 61 | @param format A format string describing the reason for the exception. 62 | @result An NSString formatted suitable for use as an exception message. 63 | */ 64 | extern NSString * _Nonnull TWTExceptionString(id _Nonnull receiver, SEL _Nonnull selector, NSString * _Nonnull format, ...) NS_FORMAT_FUNCTION(3, 4); 65 | -------------------------------------------------------------------------------- /Pods/URLMock/URLMock/Utilities/UMKURLEncodedParameterStringParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // UMKURLEncodedParameterStringParser.h 3 | // URLMock 4 | // 5 | // Created by Prachi Gauriar on 1/5/2014. 6 | // Copyright (c) 2014 Two Toasters, LLC. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | /*! 30 | UMKURLEncodedParameterStringParser objects parse URL encoded parameter strings. 31 | 32 | Below is a brief summary of how strings are parsed. {…} denotes a dictionary, […] denotes an array, and 33 | <…> denotes a set. 34 | 35 | "A=a" yields { "A" : "a" } 36 | "A=a&B=b" yields { "A" : "a", "B" : "b" } 37 | "A=a&A=b" yields { "A" : < "a", "b"> } 38 | "A[]=a" yields { "A" : [ "a" ] } 39 | "A[]=a&A[]=b" yields { "A" : [ "a", "b" ] } 40 | "A[B]=a&A[C]=b" yields { "A" : { "B" : "a", "C" : "b" } } 41 | "A[B]=a&A[B]=b" yields { "A" : { "B" : < "a", "b" > } } 42 | 43 | Strings can only result in dictionaries that contain nested strings, arrays, sets, and dictionaries. 44 | All dictionary keys, array values, and set values are strings. Sets never contain fewer than two items. 45 | */ 46 | @interface UMKURLEncodedParameterStringParser : NSObject 47 | 48 | /*! The string the instance parses. */ 49 | @property (nonatomic, copy, readonly) NSString *string; 50 | 51 | /*! The encoding that the instance's percent-escape sequences were encoded in. */ 52 | @property (nonatomic, assign, readonly) NSStringEncoding encoding; 53 | 54 | 55 | /*! 56 | @abstract Initializes a new UMKURLEncodedParameterStringParser instance with the specified string and encoding. 57 | @param string The URL encoded parameter string to parse. 58 | @param encoding The encoding that the string used for percent-escape sequences. 59 | @result A newly initialized UMKURLEncodedParameterStringParser. 60 | */ 61 | - (instancetype)initWithString:(NSString *)string encoding:(NSStringEncoding)encoding; 62 | 63 | /*! 64 | @abstract Parses the receiver's string and returns a dictionary of the resulting object. 65 | @discussion The resulting dictionary may contain nested strings, arrays, sets, and dictionaries. All dictionary 66 | keys, array values, and set values are strings. Sets never contain fewer than two items. 67 | @result The dictionary that results from parsing the receiver's string or nil if a parse error occurred. 68 | */ 69 | - (NSDictionary *)parse; 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Foundation/Concurrent Accessor/TWTConcurrentAccessor.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTConcurrentAccessor.m 3 | // Toast 4 | // 5 | // Created by Duncan Lewis on 11/24/15. 6 | // Copyright © 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTConcurrentAccessor.h" 28 | 29 | 30 | @interface TWTConcurrentAccessor () 31 | 32 | @property (nonatomic, strong, readonly) id object; 33 | @property (nonatomic, strong, readonly) dispatch_queue_t queue; 34 | 35 | @end 36 | 37 | 38 | @implementation TWTConcurrentAccessor 39 | 40 | - (instancetype)initWithObject:(id)object 41 | { 42 | NSParameterAssert(object); 43 | self = [super init]; 44 | if (self) { 45 | _object = object; 46 | 47 | NSString *queueName = [NSString stringWithFormat:@"%@.%p", self.class, self]; 48 | _queue = dispatch_queue_create([queueName UTF8String], DISPATCH_QUEUE_CONCURRENT); 49 | } 50 | return self; 51 | } 52 | 53 | 54 | - (NSString *)description 55 | { 56 | NSString *objectDescription = [self performReadAndReturn:^id _Nullable(id _Nonnull object) { 57 | return [self.object description]; 58 | }]; 59 | 60 | return [NSString stringWithFormat:@"<%@: %p queue=%s object=%@>", self.class, self, dispatch_queue_get_label(self.queue), objectDescription]; 61 | } 62 | 63 | 64 | - (void)performRead:(void (^)(id))readBlock 65 | { 66 | NSParameterAssert(readBlock); 67 | 68 | dispatch_sync(self.queue, ^{ 69 | readBlock(self.object); 70 | }); 71 | } 72 | 73 | 74 | - (id)performReadAndReturn:(id (^)(id))readBlock 75 | { 76 | NSParameterAssert(readBlock); 77 | 78 | __block id returnValue; 79 | dispatch_sync(self.queue, ^{ 80 | returnValue = readBlock(self.object); 81 | }); 82 | 83 | return returnValue; 84 | } 85 | 86 | 87 | - (void)performWrite:(void (^)(id))writeBlock 88 | { 89 | NSParameterAssert(writeBlock); 90 | 91 | dispatch_barrier_async(self.queue, ^{ 92 | writeBlock(self.object); 93 | }); 94 | } 95 | 96 | 97 | - (void)performWriteAndWait:(void (^)(id))writeBlock 98 | { 99 | NSParameterAssert(writeBlock); 100 | 101 | dispatch_barrier_sync(self.queue, ^{ 102 | writeBlock(self.object); 103 | }); 104 | } 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /UIKit/View Controller Transitions/TWTSimpleAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTSimpleAnimationController.m 3 | // Toast 4 | // 5 | // Created by Andrew Hershberger on 3/4/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // A prior version of this code was written for Normal Ears, Inc. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import "TWTSimpleAnimationController.h" 29 | 30 | 31 | @implementation TWTSimpleAnimationController 32 | 33 | - (instancetype)init 34 | { 35 | return [self initWithDuration:0.5 options:0]; 36 | } 37 | 38 | 39 | - (instancetype)initWithDuration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options 40 | { 41 | self = [super init]; 42 | if (self) { 43 | _duration = duration; 44 | _options = options; 45 | } 46 | 47 | return self; 48 | } 49 | 50 | 51 | - (NSTimeInterval)transitionDuration:(id)transitionContext 52 | { 53 | return self.duration; 54 | } 55 | 56 | 57 | - (void)animateTransition:(id)transitionContext 58 | { 59 | UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 60 | UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 61 | toViewController.view.frame = [transitionContext finalFrameForViewController:toViewController]; 62 | [toViewController.view layoutIfNeeded]; 63 | 64 | BOOL optionsContainShowHideTransitionViews = (self.options & UIViewAnimationOptionShowHideTransitionViews) != 0; 65 | if (!optionsContainShowHideTransitionViews) { 66 | [[transitionContext containerView] addSubview:toViewController.view]; 67 | } 68 | 69 | [UIView transitionFromView:fromViewController.view 70 | toView:toViewController.view 71 | duration:self.duration 72 | options:self.options | UIViewAnimationOptionShowHideTransitionViews 73 | completion:^(BOOL finished) { 74 | if (!optionsContainShowHideTransitionViews) { 75 | [fromViewController.view removeFromSuperview]; 76 | } 77 | 78 | [transitionContext completeTransition:YES]; 79 | }]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | **Copyright (c) 2012 - 2014, GitHub, Inc.** 18 | **All rights reserved.** 19 | 20 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | 26 | --- 27 | 28 | **This project uses portions of code from the Proton framework.** 29 | **Proton is copyright (c) 2012, Bitswift, Inc.** 30 | **All rights reserved.** 31 | 32 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 33 | 34 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 35 | * Neither the name of the Bitswift, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 36 | 37 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | Title 40 | Mantle 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - http://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/URLMock/URLMock/Utilities/UMKParameterPair.m: -------------------------------------------------------------------------------- 1 | // 2 | // UMKParameterPair.m 3 | // URLMock 4 | // 5 | // Created by Prachi Gauriar on 1/7/2014. 6 | // Copyright (c) 2014 Two Toasters, LLC, (c) 2013 AFNetworking (http://afnetworking.com/) 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | static const NSString *const kUMKParameterPairEscapedCharacters = @":/?&=;+!@#$()',*"; 30 | 31 | 32 | @implementation UMKParameterPair 33 | 34 | - (instancetype)initWithKey:(NSString *)key value:(id)value 35 | { 36 | self = [super init]; 37 | if (self) { 38 | _key = key; 39 | _value = value; 40 | } 41 | 42 | return self; 43 | } 44 | 45 | 46 | - (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)encoding 47 | { 48 | NSString *stringValue = [self URLEncodedKeyStringWithEncoding:encoding]; 49 | if (self.value && self.value != [NSNull null]) { 50 | stringValue = [stringValue stringByAppendingFormat:@"=%@", [self URLEncodedValueStringWithEncoding:encoding]]; 51 | } 52 | 53 | return stringValue; 54 | } 55 | 56 | 57 | - (NSString *)URLEncodedKeyStringWithEncoding:(NSStringEncoding)encoding 58 | { 59 | static NSString *const kUMKUnescapedCharacters = @".[]"; 60 | return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, 61 | (__bridge CFStringRef)self.key, 62 | (__bridge CFStringRef)kUMKUnescapedCharacters, 63 | (__bridge CFStringRef)kUMKParameterPairEscapedCharacters, 64 | CFStringConvertNSStringEncodingToEncoding(encoding)); 65 | } 66 | 67 | 68 | - (NSString *)URLEncodedValueStringWithEncoding:(NSStringEncoding)encoding 69 | { 70 | return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, 71 | (__bridge CFStringRef)self.value, 72 | NULL, 73 | (__bridge CFStringRef)kUMKParameterPairEscapedCharacters, 74 | CFStringConvertNSStringEncodingToEncoding(encoding)); 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/extobjc/EXTRuntimeExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // EXTRuntimeExtensions.h 3 | // extobjc 4 | // 5 | // Created by Justin Spahr-Summers on 2011-03-05. 6 | // Copyright (C) 2012 Justin Spahr-Summers. 7 | // Released under the MIT license. 8 | // 9 | 10 | #import 11 | 12 | /** 13 | * Describes the memory management policy of a property. 14 | */ 15 | typedef enum { 16 | /** 17 | * The value is assigned. 18 | */ 19 | mtl_propertyMemoryManagementPolicyAssign = 0, 20 | 21 | /** 22 | * The value is retained. 23 | */ 24 | mtl_propertyMemoryManagementPolicyRetain, 25 | 26 | /** 27 | * The value is copied. 28 | */ 29 | mtl_propertyMemoryManagementPolicyCopy 30 | } mtl_propertyMemoryManagementPolicy; 31 | 32 | /** 33 | * Describes the attributes and type information of a property. 34 | */ 35 | typedef struct { 36 | /** 37 | * Whether this property was declared with the \c readonly attribute. 38 | */ 39 | BOOL readonly; 40 | 41 | /** 42 | * Whether this property was declared with the \c nonatomic attribute. 43 | */ 44 | BOOL nonatomic; 45 | 46 | /** 47 | * Whether the property is a weak reference. 48 | */ 49 | BOOL weak; 50 | 51 | /** 52 | * Whether the property is eligible for garbage collection. 53 | */ 54 | BOOL canBeCollected; 55 | 56 | /** 57 | * Whether this property is defined with \c \@dynamic. 58 | */ 59 | BOOL dynamic; 60 | 61 | /** 62 | * The memory management policy for this property. This will always be 63 | * #mtl_propertyMemoryManagementPolicyAssign if #readonly is \c YES. 64 | */ 65 | mtl_propertyMemoryManagementPolicy memoryManagementPolicy; 66 | 67 | /** 68 | * The selector for the getter of this property. This will reflect any 69 | * custom \c getter= attribute provided in the property declaration, or the 70 | * inferred getter name otherwise. 71 | */ 72 | SEL getter; 73 | 74 | /** 75 | * The selector for the setter of this property. This will reflect any 76 | * custom \c setter= attribute provided in the property declaration, or the 77 | * inferred setter name otherwise. 78 | * 79 | * @note If #readonly is \c YES, this value will represent what the setter 80 | * \e would be, if the property were writable. 81 | */ 82 | SEL setter; 83 | 84 | /** 85 | * The backing instance variable for this property, or \c NULL if \c 86 | * \c @synthesize was not used, and therefore no instance variable exists. This 87 | * would also be the case if the property is implemented dynamically. 88 | */ 89 | const char *ivar; 90 | 91 | /** 92 | * If this property is defined as being an instance of a specific class, 93 | * this will be the class object representing it. 94 | * 95 | * This will be \c nil if the property was defined as type \c id, if the 96 | * property is not of an object type, or if the class could not be found at 97 | * runtime. 98 | */ 99 | Class objectClass; 100 | 101 | /** 102 | * The type encoding for the value of this property. This is the type as it 103 | * would be returned by the \c \@encode() directive. 104 | */ 105 | char type[]; 106 | } mtl_propertyAttributes; 107 | 108 | /** 109 | * Returns a pointer to a structure containing information about \a property. 110 | * You must \c free() the returned pointer. Returns \c NULL if there is an error 111 | * obtaining information from \a property. 112 | */ 113 | mtl_propertyAttributes *mtl_copyPropertyAttributes (objc_property_t property); 114 | -------------------------------------------------------------------------------- /Foundation/Tree Node/TWTTreeNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTTreeNode.m 3 | // Toast 4 | // 5 | // Created by Kevin Conner on 7/29/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTTreeNode.h" 28 | 29 | @interface TWTTreeNode () 30 | 31 | @property (nonatomic, readwrite, weak) TWTTreeNode *parent; 32 | @property (nonatomic, readwrite, strong) NSIndexPath *indexPath; 33 | 34 | @end 35 | 36 | @implementation TWTTreeNode 37 | 38 | #pragma mark - Helpers 39 | 40 | - (id)init 41 | { 42 | self = [super init]; 43 | if (self) { 44 | _children = @[ ]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)invalidateIndexPath 50 | { 51 | self.indexPath = nil; 52 | } 53 | 54 | - (void)setParent:(TWTTreeNode *)parent 55 | { 56 | if (_parent != parent) { 57 | _parent = parent; 58 | [self invalidateIndexPath]; 59 | [self.children makeObjectsPerformSelector:@selector(invalidateIndexPath)]; 60 | } 61 | } 62 | 63 | #pragma mark - Public interface 64 | 65 | - (void)setChildren:(NSArray *)children 66 | { 67 | if (!children) { 68 | children = @[ ]; 69 | } 70 | 71 | for (TWTTreeNode *child in _children) { 72 | child.parent = nil; 73 | } 74 | 75 | _children = [children copy]; 76 | 77 | for (TWTTreeNode *child in _children) { 78 | child.parent = self; 79 | } 80 | } 81 | 82 | - (NSIndexPath *)indexPath 83 | { 84 | if (!_indexPath) { 85 | TWTTreeNode *parent = self.parent; 86 | if (parent) { 87 | NSUInteger index = [parent.children indexOfObject:self]; 88 | _indexPath = [parent.indexPath indexPathByAddingIndex:index]; 89 | } 90 | else { 91 | _indexPath = [NSIndexPath new]; 92 | } 93 | } 94 | return _indexPath; 95 | } 96 | 97 | - (NSUInteger)depth 98 | { 99 | return [self.indexPath length]; 100 | } 101 | 102 | - (instancetype)nodeAtIndexPath:(NSIndexPath *)indexPath 103 | { 104 | TWTTreeNode *node = self; 105 | for (NSUInteger position = 0; position < indexPath.length; position++) { 106 | node = node.children[ [indexPath indexAtPosition:position] ]; 107 | } 108 | return node; 109 | } 110 | 111 | - (BOOL)hasAncestor:(TWTTreeNode *)ancestor 112 | { 113 | TWTTreeNode *parent = self; 114 | while (parent != nil) { 115 | if (parent == ancestor) { 116 | return YES; 117 | } 118 | parent = parent.parent; 119 | } 120 | return NO; 121 | } 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /Foundation/Asynchronous Operation/TWTAsynchronousOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TWTAsynchronousOperation.h 3 | // Toast 4 | // 5 | // Created by Duncan Lewis on 6/12/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @class TWTAsynchronousOperation; 30 | 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | typedef void (^TWTAsynchronousOperationBlock)(TWTAsynchronousOperation *operation); 35 | 36 | 37 | @interface TWTAsynchronousOperation : NSOperation 38 | 39 | /** 40 | @abstract Initializes an operation given an operation block to execute. 41 | 42 | @param operationBlock The block the operation will execute. See `-[TWTAsynchronousOperation setOperationBlock]` below 43 | for more details. 44 | 45 | @discussion When run, the asynchronous operation executes the developer-provided block, which may perform 46 | asynchronous tasks. It is the responsibility of the block to invoke 47 | `-[TWTAsynchronousOperation finishOperationExecution]` to finish the execution of the operation, usually when the 48 | asynchronous task in the block has completed. 49 | 50 | It is also recommended (as an optimization) that the block periodically check the 51 | `-[TWTAsynchronousOperation isCancelled]` flag, and properly abort the execution of its asynchronous task, followed 52 | by an invocation of `-[TWTAsynchronousOperation finishOperationExecution]` to mark the operation is finished. 53 | */ 54 | - (id)initWithOperationBlock:(nullable TWTAsynchronousOperationBlock)operationBlock; 55 | 56 | /** 57 | @abstract Set the block to be executed by the operation. 58 | 59 | @param operationBlock The block the operation will execute. 60 | 61 | @discussion The block takes the operation as an argument, so that it may complete the operation's execution by 62 | invoking `-[TWTAsynchronousOperation finishOperationExecution]`. The block should make no assumptions about its 63 | execution environment. 64 | */ 65 | - (void)setOperationBlock:(nullable TWTAsynchronousOperationBlock)operationBlock; 66 | 67 | /** 68 | @abstract Tells the operation that it has ended execution and should enter the finished state. 69 | 70 | @discussion The developer submitted block should invoke this method to tell the operation that the block's 71 | asynchronous tasks have been completed, and it may leave the executing state and enter the finished state. The 72 | operation will never leave the executing state on its on, and failure by the developer submitted block to invoke this 73 | method will result in indefinite execution of this operation. 74 | */ 75 | - (void)finishOperationExecution; 76 | 77 | @end 78 | 79 | NS_ASSUME_NONNULL_END 80 | -------------------------------------------------------------------------------- /Foundation/Asynchronous Operation/TWTAsynchronousOperation.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTAsynchronousOperation.m 3 | // Toast 4 | // 5 | // Created by Duncan Lewis on 6/12/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTAsynchronousOperation.h" 28 | 29 | typedef NS_ENUM(NSUInteger, TWTOperationState) { 30 | TWTOperationStateReady, 31 | TWTOperationStateExecuting, 32 | TWTOperationStateFinished 33 | }; 34 | 35 | static NSString * TWTKeyFromOperationState(TWTOperationState state) { 36 | switch (state) { 37 | case TWTOperationStateReady: 38 | return @"isReady"; 39 | case TWTOperationStateExecuting: 40 | return @"isExecuting"; 41 | case TWTOperationStateFinished: 42 | return @"isFinished"; 43 | } 44 | } 45 | 46 | @interface TWTAsynchronousOperation () 47 | 48 | @property (nonatomic, assign) TWTOperationState state; 49 | @property (nonatomic, copy) TWTAsynchronousOperationBlock operationBlock; 50 | 51 | @end 52 | 53 | @implementation TWTAsynchronousOperation 54 | 55 | #pragma mark - NSOperation 56 | 57 | - (void)start 58 | { 59 | self.state = TWTOperationStateExecuting; 60 | 61 | if (self.operationBlock) { 62 | self.operationBlock(self); 63 | } else { 64 | [self finishOperationExecution]; 65 | } 66 | } 67 | 68 | - (void)finishOperationExecution 69 | { 70 | self.operationBlock = nil; 71 | self.state = TWTOperationStateFinished; 72 | } 73 | 74 | - (BOOL)isReady 75 | { 76 | return self.state == TWTOperationStateReady && [super isReady]; 77 | } 78 | 79 | - (BOOL)isExecuting 80 | { 81 | return self.state == TWTOperationStateExecuting; 82 | } 83 | 84 | - (BOOL)isFinished 85 | { 86 | return self.state == TWTOperationStateFinished; 87 | } 88 | 89 | - (BOOL)isConcurrent 90 | { 91 | return YES; 92 | } 93 | 94 | - (void)setState:(TWTOperationState)state 95 | { 96 | NSString *oldStateKey = TWTKeyFromOperationState(self.state); 97 | NSString *newStateKey = TWTKeyFromOperationState(state); 98 | 99 | [self willChangeValueForKey:oldStateKey]; 100 | [self willChangeValueForKey:newStateKey]; 101 | _state = state; 102 | [self didChangeValueForKey:oldStateKey]; 103 | [self didChangeValueForKey:newStateKey]; 104 | } 105 | 106 | #pragma mark - Init 107 | 108 | - (id)initWithOperationBlock:(TWTAsynchronousOperationBlock)operationBlock 109 | { 110 | self = [super init]; 111 | if (self) { 112 | _operationBlock = [operationBlock copy]; 113 | _state = TWTOperationStateReady; 114 | } 115 | return self; 116 | } 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ToastTests/Pods-ToastTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Mantle 5 | 6 | **Copyright (c) 2012 - 2014, GitHub, Inc.** 7 | **All rights reserved.** 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | 15 | --- 16 | 17 | **This project uses portions of code from the Proton framework.** 18 | **Proton is copyright (c) 2012, Bitswift, Inc.** 19 | **All rights reserved.** 20 | 21 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 22 | 23 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 24 | * Neither the name of the Bitswift, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | 29 | ## URLMock 30 | 31 | The MIT License (MIT) 32 | Copyright © 2013–2014 Two Toasters, LLC. 33 | 34 | Permission is hereby granted, free of charge, to any person obtaining a copy of 35 | this software and associated documentation files (the “Software”), to deal in 36 | the Software without restriction, including without limitation the rights to 37 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 38 | the Software, and to permit persons to whom the Software is furnished to do so, 39 | subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in all 42 | copies or substantial portions of the Software. 43 | 44 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 45 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 46 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 47 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 48 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 49 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 50 | 51 | Generated by CocoaPods - http://cocoapods.org 52 | -------------------------------------------------------------------------------- /UIKit/Text Style/TWTTextStyle.m: -------------------------------------------------------------------------------- 1 | // 2 | // TWTTextStyle.m 3 | // Toast 4 | // 5 | // Created by Kevin Conner on 7/29/14. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TWTTextStyle.h" 28 | 29 | @implementation TWTTextStyle 30 | 31 | #pragma mark - Helpers 32 | 33 | - (NSDictionary *)textAttributesWithColor:(UIColor *)color 34 | { 35 | return @{ NSFontAttributeName: self.font, 36 | NSForegroundColorAttributeName: color }; 37 | } 38 | 39 | #pragma mark - Init/dealloc 40 | 41 | - (instancetype)initWithFont:(UIFont *)font color:(UIColor *)color highlightColor:(UIColor *)highlightColor disabledColor:(UIColor *)disabledColor 42 | { 43 | NSParameterAssert(font); 44 | NSParameterAssert(color); 45 | 46 | self = [super init]; 47 | if (self) { 48 | _font = font; 49 | _color = color; 50 | _highlightColor = highlightColor ?: color; 51 | _disabledColor = disabledColor ?: color; 52 | } 53 | return self; 54 | } 55 | 56 | - (instancetype)initWithFont:(UIFont *)font color:(UIColor *)color 57 | { 58 | return [self initWithFont:font color:color highlightColor:nil disabledColor:nil]; 59 | } 60 | 61 | #pragma mark - Public interface 62 | 63 | - (NSDictionary *)textAttributes 64 | { 65 | return [self textAttributesWithColor:self.color]; 66 | } 67 | 68 | - (NSDictionary *)highlightedTextAttributes 69 | { 70 | return [self textAttributesWithColor:self.highlightColor]; 71 | } 72 | 73 | - (NSDictionary *)disabledTextAttributes 74 | { 75 | return [self textAttributesWithColor:self.disabledColor]; 76 | } 77 | 78 | #pragma mark - 79 | 80 | - (void)styleLabel:(UILabel *)label 81 | { 82 | label.font = self.font; 83 | label.textColor = self.color; 84 | } 85 | 86 | - (void)styleTextField:(UITextField *)textField 87 | { 88 | textField.font = self.font; 89 | textField.textColor = self.color; 90 | } 91 | 92 | - (void)styleTextView:(UITextView *)textView 93 | { 94 | textView.font = self.font; 95 | textView.textColor = self.color; 96 | } 97 | 98 | - (void)styleButton:(UIButton *)button 99 | { 100 | button.titleLabel.font = self.font; 101 | [button setTitleColor:self.color forState:UIControlStateNormal]; 102 | [button setTitleColor:self.highlightColor forState:UIControlStateHighlighted]; 103 | [button setTitleColor:self.disabledColor forState:UIControlStateDisabled]; 104 | } 105 | 106 | - (void)styleBarButtonItem:(UIBarButtonItem *)item 107 | { 108 | [item setTitleTextAttributes:self.textAttributes forState:UIControlStateNormal]; 109 | [item setTitleTextAttributes:self.disabledTextAttributes forState:UIControlStateDisabled]; 110 | // Don't set highlighted attributes; automatic fade effect looks better 111 | } 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /Pods/Mantle/Mantle/extobjc/EXTScope.h: -------------------------------------------------------------------------------- 1 | // 2 | // EXTScope.h 3 | // extobjc 4 | // 5 | // Created by Justin Spahr-Summers on 2011-05-04. 6 | // Copyright (C) 2012 Justin Spahr-Summers. 7 | // Released under the MIT license. 8 | // 9 | 10 | #import "metamacros.h" 11 | 12 | /** 13 | * \@onExit defines some code to be executed when the current scope exits. The 14 | * code must be enclosed in braces and terminated with a semicolon, and will be 15 | * executed regardless of how the scope is exited, including from exceptions, 16 | * \c goto, \c return, \c break, and \c continue. 17 | * 18 | * Provided code will go into a block to be executed later. Keep this in mind as 19 | * it pertains to memory management, restrictions on assignment, etc. Because 20 | * the code is used within a block, \c return is a legal (though perhaps 21 | * confusing) way to exit the cleanup block early. 22 | * 23 | * Multiple \@onExit statements in the same scope are executed in reverse 24 | * lexical order. This helps when pairing resource acquisition with \@onExit 25 | * statements, as it guarantees teardown in the opposite order of acquisition. 26 | * 27 | * @note This statement cannot be used within scopes defined without braces 28 | * (like a one line \c if). In practice, this is not an issue, since \@onExit is 29 | * a useless construct in such a case anyways. 30 | */ 31 | #define onExit \ 32 | try {} @finally {} \ 33 | __strong mtl_cleanupBlock_t metamacro_concat(mtl_exitBlock_, __LINE__) __attribute__((cleanup(mtl_executeCleanupBlock), unused)) = ^ 34 | 35 | /** 36 | * Creates \c __weak shadow variables for each of the variables provided as 37 | * arguments, which can later be made strong again with #strongify. 38 | * 39 | * This is typically used to weakly reference variables in a block, but then 40 | * ensure that the variables stay alive during the actual execution of the block 41 | * (if they were live upon entry). 42 | * 43 | * See #strongify for an example of usage. 44 | */ 45 | #define weakify(...) \ 46 | try {} @finally {} \ 47 | metamacro_foreach_cxt(mtl_weakify_,, __weak, __VA_ARGS__) 48 | 49 | /** 50 | * Like #weakify, but uses \c __unsafe_unretained instead, for targets or 51 | * classes that do not support weak references. 52 | */ 53 | #define unsafeify(...) \ 54 | try {} @finally {} \ 55 | metamacro_foreach_cxt(mtl_weakify_,, __unsafe_unretained, __VA_ARGS__) 56 | 57 | /** 58 | * Strongly references each of the variables provided as arguments, which must 59 | * have previously been passed to #weakify. 60 | * 61 | * The strong references created will shadow the original variable names, such 62 | * that the original names can be used without issue (and a significantly 63 | * reduced risk of retain cycles) in the current scope. 64 | * 65 | * @code 66 | 67 | id foo = [[NSObject alloc] init]; 68 | id bar = [[NSObject alloc] init]; 69 | 70 | @weakify(foo, bar); 71 | 72 | // this block will not keep 'foo' or 'bar' alive 73 | BOOL (^matchesFooOrBar)(id) = ^ BOOL (id obj){ 74 | // but now, upon entry, 'foo' and 'bar' will stay alive until the block has 75 | // finished executing 76 | @strongify(foo, bar); 77 | 78 | return [foo isEqual:obj] || [bar isEqual:obj]; 79 | }; 80 | 81 | * @endcode 82 | */ 83 | #define strongify(...) \ 84 | try {} @finally {} \ 85 | _Pragma("clang diagnostic push") \ 86 | _Pragma("clang diagnostic ignored \"-Wshadow\"") \ 87 | metamacro_foreach(mtl_strongify_,, __VA_ARGS__) \ 88 | _Pragma("clang diagnostic pop") 89 | 90 | /*** implementation details follow ***/ 91 | typedef void (^mtl_cleanupBlock_t)(); 92 | 93 | void mtl_executeCleanupBlock (__strong mtl_cleanupBlock_t *block); 94 | 95 | #define mtl_weakify_(INDEX, CONTEXT, VAR) \ 96 | CONTEXT __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR); 97 | 98 | #define mtl_strongify_(INDEX, VAR) \ 99 | __strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_); 100 | -------------------------------------------------------------------------------- /Pods/URLMock/URLMock/Utilities/UMKErrorUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // UMKErrorUtilities.h 3 | // URLMock 4 | // 5 | // Created by Prachi Gauriar on 12/6/2012. 6 | // Copyright (c) 2013–2014 Two Toasters, LLC. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | /*! 28 | @header UMKErrorUtilities 29 | @abstract Defines utility functions and categories for use when creating assertions and exceptions. 30 | @discussion The utility functions allow for easily formatting selectors, method names, and assertion/exception reasons, 31 | among other tasks. 32 | */ 33 | 34 | #import 35 | 36 | /*! 37 | @abstract Returns an NSString representation of the selector. 38 | @discussion This simply returns the result of NSStringFromSelector(selector), prefixed with a '+' if receiver is 39 | a class and '-' otherwise. 40 | @param receiver The object responding to the selector. 41 | @param selector The selector to which the receiver will be responding. 42 | @result A pretty-printed NSString representation of the selector. 43 | */ 44 | extern NSString *UMKPrettySelector(id receiver, SEL selector); 45 | 46 | /*! 47 | @abstract Returns an NSString representation of the selector. 48 | @discussion The string is of the form \@"+[receiver selector]" for class methods and \@"-[receiverClassName selector]" 49 | for instance methods. 50 | @param receiver The object responding to the selector. 51 | @param selector The selector to which the receiver will be responding. 52 | @result A pretty-printed NSString representation of the method name, including the receiving class. 53 | */ 54 | extern NSString *UMKPrettyMethodName(id receiver, SEL selector); 55 | 56 | /*! 57 | @abstract Returns an NSString that is formatted suitably for use as an assertion message. 58 | @discussion Formatting is consistent with Apple's own assertion messages. 59 | @param receiver The object responding to the selector. This is typically self. 60 | @param selector The selector to which the receiver will be responding. This is typically _cmd. 61 | @param format A format string describing the reason for the assertion. 62 | @result An NSString formatted suitable for use as an assertion message. 63 | */ 64 | extern NSString *UMKAssertionString(id receiver, SEL selector, NSString *format, ...) NS_FORMAT_FUNCTION(3, 4); 65 | 66 | /*! 67 | @abstract Returns an NSString that is formatted suitably for use as an exception message. 68 | @discussion Formatting is consistent with Apple's own exception messages. 69 | @param receiver The object responding to the selector. This is typically self. 70 | @param selector The selector to which the receiver will be responding. This is typically _cmd. 71 | @param format A format string describing the reason for the exception. 72 | @result An NSString formatted suitable for use as an exception message. 73 | */ 74 | extern NSString *UMKExceptionString(id receiver, SEL selector, NSString *format, ...) NS_FORMAT_FUNCTION(3, 4); 75 | -------------------------------------------------------------------------------- /UIKit/Block Actions/UIControl+TWTBlockActions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+TWTBlockActions.m 3 | // Toast 4 | // 5 | // Created by Prachi Gauriar on 10/23/2014. 6 | // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "UIControl+TWTBlockActions.h" 28 | 29 | #import 30 | 31 | 32 | @interface TWTBlockAction : NSObject 33 | 34 | @property (nonatomic, assign, readonly) UIControlEvents controlEvents; 35 | @property (nonatomic, copy, readonly) void (^block)(id sender, UIEvent *event); 36 | 37 | - (instancetype)initWithControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender, UIEvent *event))block NS_DESIGNATED_INITIALIZER; 38 | - (void)addActionToControl:(UIControl *)control; 39 | - (void)removeActionFromControl:(UIControl *)control; 40 | 41 | @end 42 | 43 | 44 | #pragma mark - 45 | 46 | @implementation TWTBlockAction 47 | 48 | - (instancetype)init 49 | { 50 | return [self initWithControlEvents:0 block:nil]; 51 | } 52 | 53 | 54 | - (instancetype)initWithControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender, UIEvent *event))block 55 | { 56 | NSParameterAssert(block); 57 | 58 | if (self = [super init]) { 59 | _controlEvents = controlEvents; 60 | _block = [block copy]; 61 | } 62 | 63 | return self; 64 | } 65 | 66 | 67 | - (void)addActionToControl:(UIControl *)control 68 | { 69 | [control addTarget:self action:@selector(performActionWithSender:event:) forControlEvents:self.controlEvents]; 70 | } 71 | 72 | 73 | - (void)removeActionFromControl:(UIControl *)control 74 | { 75 | [control removeTarget:self action:@selector(performActionWithSender:event:) forControlEvents:self.controlEvents]; 76 | } 77 | 78 | 79 | - (void)performActionWithSender:(id)sender event:(UIEvent *)event 80 | { 81 | self.block(sender, event); 82 | } 83 | 84 | @end 85 | 86 | 87 | #pragma mark - 88 | 89 | @implementation UIControl (TWTBlocks) 90 | 91 | - (NSMutableSet *)twt_blockActions 92 | { 93 | NSMutableSet *blockActions = objc_getAssociatedObject(self, _cmd); 94 | if (!blockActions) { 95 | blockActions = [[NSMutableSet alloc] init]; 96 | objc_setAssociatedObject(self, _cmd, blockActions, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 97 | } 98 | 99 | return blockActions; 100 | } 101 | 102 | 103 | - (id)twt_addBlockActionForControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender, UIEvent *event))block 104 | { 105 | TWTBlockAction *blockAction = [[TWTBlockAction alloc] initWithControlEvents:controlEvents block:block]; 106 | [blockAction addActionToControl:self]; 107 | [self.twt_blockActions addObject:blockAction]; 108 | return blockAction; 109 | } 110 | 111 | 112 | - (void)twt_removeBlockAction:(id)blockAction 113 | { 114 | [blockAction removeActionFromControl:self]; 115 | [self.twt_blockActions removeObject:blockAction]; 116 | } 117 | 118 | @end 119 | --------------------------------------------------------------------------------