├── .gitignore ├── .travis.yml ├── Demo ├── CoverageFix.h ├── CoverageFix.m ├── Default-568h@2x.png ├── Images │ └── title-status.png ├── LogicTests │ ├── LogicTests-Info.plist │ ├── LogicTests-Prefix.pch │ ├── MMHudTests.m │ ├── MMProgressHUDAsyncTests.m │ ├── MMProgressHUDTests.m │ └── en.lproj │ │ └── InfoPlist.strings ├── MMProgressHUDDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── MMProgressHUDDemo.xccheckout │ └── xcshareddata │ │ └── xcschemes │ │ ├── LogicTests.xcscheme │ │ └── MMProgressHUDDemo.xcscheme ├── MMProgressHUDDemo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── MMProgressHUDDemo.xccheckout ├── MMProgressHUDDemo │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ ├── Contents.json │ │ │ ├── Default-47@2x-1.png │ │ │ ├── Default-4@2x-1.png │ │ │ ├── Default-55@3x-1.png │ │ │ ├── Default-55@3x-Landscape-1.png │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default-iPad-1.png │ │ │ ├── Default-iPad-Landscape-1.png │ │ │ ├── Default-iPad@2x-1.png │ │ │ └── Default-iPad@2x-Landscape-1.png │ ├── MMAppDelegate.h │ ├── MMAppDelegate.m │ ├── MMProgressHUDDemo-Info.plist │ ├── MMProgressHUDDemo-Prefix.pch │ ├── MMProgressHUDDemo │ │ ├── MMAppDelegate.h │ │ ├── MMAppDelegate.m │ │ ├── MMProgressHUDDemo-Info.plist │ │ ├── MMProgressHUDDemo-Prefix.pch │ │ ├── MMViewController.h │ │ ├── MMViewController.m │ │ ├── en.lproj │ │ │ ├── InfoPlist.strings │ │ │ ├── MMViewController_iPad.xib │ │ │ └── MMViewController_iPhone.xib │ │ └── main.m │ ├── MMProgressHUDPrivate.h │ ├── MMViewController.h │ ├── MMViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile ├── Podfile.lock ├── Pods │ ├── Headers │ │ ├── Private │ │ │ ├── MMProgressHUD │ │ │ │ ├── MMHud.h │ │ │ │ ├── MMLinearProgressView.h │ │ │ │ ├── MMProgressHUD+Animations.h │ │ │ │ ├── MMProgressHUD.h │ │ │ │ ├── MMProgressHUDCommon.h │ │ │ │ ├── MMProgressHUDOverlayView.h │ │ │ │ ├── MMProgressHUDViewController.h │ │ │ │ ├── MMProgressHUDWindow.h │ │ │ │ ├── MMProgressView-Protocol.h │ │ │ │ ├── MMRadialProgressView.h │ │ │ │ └── MMVectorImage.h │ │ │ └── OCMock │ │ │ │ ├── NSInvocation+OCMAdditions.h │ │ │ │ ├── NSMethodSignature+OCMAdditions.h │ │ │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ │ │ ├── NSObject+OCMAdditions.h │ │ │ │ ├── NSValue+OCMAdditions.h │ │ │ │ ├── OCClassMockObject.h │ │ │ │ ├── OCMArg.h │ │ │ │ ├── OCMBlockCaller.h │ │ │ │ ├── OCMBoxedReturnValueProvider.h │ │ │ │ ├── OCMConstraint.h │ │ │ │ ├── OCMExceptionReturnValueProvider.h │ │ │ │ ├── OCMExpectationRecorder.h │ │ │ │ ├── OCMFunctions.h │ │ │ │ ├── OCMIndirectReturnValueProvider.h │ │ │ │ ├── OCMInvocationExpectation.h │ │ │ │ ├── OCMInvocationMatcher.h │ │ │ │ ├── OCMInvocationStub.h │ │ │ │ ├── OCMLocation.h │ │ │ │ ├── OCMMacroState.h │ │ │ │ ├── OCMNotificationPoster.h │ │ │ │ ├── OCMObserverRecorder.h │ │ │ │ ├── OCMPassByRefSetter.h │ │ │ │ ├── OCMRealObjectForwarder.h │ │ │ │ ├── OCMRecorder.h │ │ │ │ ├── OCMReturnValueProvider.h │ │ │ │ ├── OCMStubRecorder.h │ │ │ │ ├── OCMVerifier.h │ │ │ │ ├── OCMock.h │ │ │ │ ├── OCMockObject.h │ │ │ │ ├── OCObserverMockObject.h │ │ │ │ ├── OCPartialMockObject.h │ │ │ │ └── OCProtocolMockObject.h │ │ └── Public │ │ │ ├── MMProgressHUD │ │ │ ├── MMHud.h │ │ │ ├── MMLinearProgressView.h │ │ │ ├── MMProgressHUD.h │ │ │ ├── MMProgressHUDOverlayView.h │ │ │ ├── MMProgressView-Protocol.h │ │ │ ├── MMRadialProgressView.h │ │ │ └── MMVectorImage.h │ │ │ └── OCMock │ │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ │ ├── OCMArg.h │ │ │ ├── OCMConstraint.h │ │ │ ├── OCMLocation.h │ │ │ ├── OCMMacroState.h │ │ │ ├── OCMRecorder.h │ │ │ ├── OCMStubRecorder.h │ │ │ ├── OCMock.h │ │ │ └── OCMockObject.h │ ├── Local Podspecs │ │ └── MMProgressHUD.podspec.json │ ├── Manifest.lock │ ├── OCMock │ │ ├── README.md │ │ └── Source │ │ │ ├── License.txt │ │ │ └── OCMock │ │ │ ├── NSInvocation+OCMAdditions.h │ │ │ ├── NSInvocation+OCMAdditions.m │ │ │ ├── NSMethodSignature+OCMAdditions.h │ │ │ ├── NSMethodSignature+OCMAdditions.m │ │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ │ ├── NSNotificationCenter+OCMAdditions.m │ │ │ ├── NSObject+OCMAdditions.h │ │ │ ├── NSObject+OCMAdditions.m │ │ │ ├── NSValue+OCMAdditions.h │ │ │ ├── NSValue+OCMAdditions.m │ │ │ ├── OCClassMockObject.h │ │ │ ├── OCClassMockObject.m │ │ │ ├── OCMArg.h │ │ │ ├── OCMArg.m │ │ │ ├── OCMBlockCaller.h │ │ │ ├── OCMBlockCaller.m │ │ │ ├── OCMBoxedReturnValueProvider.h │ │ │ ├── OCMBoxedReturnValueProvider.m │ │ │ ├── OCMConstraint.h │ │ │ ├── OCMConstraint.m │ │ │ ├── OCMExceptionReturnValueProvider.h │ │ │ ├── OCMExceptionReturnValueProvider.m │ │ │ ├── OCMExpectationRecorder.h │ │ │ ├── OCMExpectationRecorder.m │ │ │ ├── OCMFunctions.h │ │ │ ├── OCMFunctions.m │ │ │ ├── OCMIndirectReturnValueProvider.h │ │ │ ├── OCMIndirectReturnValueProvider.m │ │ │ ├── OCMInvocationExpectation.h │ │ │ ├── OCMInvocationExpectation.m │ │ │ ├── OCMInvocationMatcher.h │ │ │ ├── OCMInvocationMatcher.m │ │ │ ├── OCMInvocationStub.h │ │ │ ├── OCMInvocationStub.m │ │ │ ├── OCMLocation.h │ │ │ ├── OCMLocation.m │ │ │ ├── OCMMacroState.h │ │ │ ├── OCMMacroState.m │ │ │ ├── OCMNotificationPoster.h │ │ │ ├── OCMNotificationPoster.m │ │ │ ├── OCMObserverRecorder.h │ │ │ ├── OCMObserverRecorder.m │ │ │ ├── OCMPassByRefSetter.h │ │ │ ├── OCMPassByRefSetter.m │ │ │ ├── OCMRealObjectForwarder.h │ │ │ ├── OCMRealObjectForwarder.m │ │ │ ├── OCMRecorder.h │ │ │ ├── OCMRecorder.m │ │ │ ├── OCMReturnValueProvider.h │ │ │ ├── OCMReturnValueProvider.m │ │ │ ├── OCMStubRecorder.h │ │ │ ├── OCMStubRecorder.m │ │ │ ├── OCMVerifier.h │ │ │ ├── OCMVerifier.m │ │ │ ├── OCMock.h │ │ │ ├── OCMockObject.h │ │ │ ├── OCMockObject.m │ │ │ ├── OCObserverMockObject.h │ │ │ ├── OCObserverMockObject.m │ │ │ ├── OCPartialMockObject.h │ │ │ ├── OCPartialMockObject.m │ │ │ ├── OCProtocolMockObject.h │ │ │ └── OCProtocolMockObject.m │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ ├── Pods-LogicTests-MMProgressHUD │ │ ├── Pods-LogicTests-MMProgressHUD-Private.xcconfig │ │ ├── Pods-LogicTests-MMProgressHUD-dummy.m │ │ ├── Pods-LogicTests-MMProgressHUD-prefix.pch │ │ └── Pods-LogicTests-MMProgressHUD.xcconfig │ │ ├── Pods-LogicTests-OCMock │ │ ├── Pods-LogicTests-OCMock-Private.xcconfig │ │ ├── Pods-LogicTests-OCMock-dummy.m │ │ ├── Pods-LogicTests-OCMock-prefix.pch │ │ └── Pods-LogicTests-OCMock.xcconfig │ │ ├── Pods-LogicTests │ │ ├── Pods-LogicTests-acknowledgements.markdown │ │ ├── Pods-LogicTests-acknowledgements.plist │ │ ├── Pods-LogicTests-dummy.m │ │ ├── Pods-LogicTests-environment.h │ │ ├── Pods-LogicTests-resources.sh │ │ ├── Pods-LogicTests.debug.xcconfig │ │ └── Pods-LogicTests.release.xcconfig │ │ ├── Pods-MMProgressHUD │ │ ├── Pods-MMProgressHUD-Private.xcconfig │ │ ├── Pods-MMProgressHUD-dummy.m │ │ ├── Pods-MMProgressHUD-prefix.pch │ │ └── Pods-MMProgressHUD.xcconfig │ │ └── Pods │ │ ├── Pods-acknowledgements.markdown │ │ ├── Pods-acknowledgements.plist │ │ ├── Pods-dummy.m │ │ ├── Pods-environment.h │ │ ├── Pods-resources.sh │ │ ├── Pods.debug.xcconfig │ │ └── Pods.release.xcconfig ├── Run Cycle 1 │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ └── 6.png └── VisualDemos │ ├── MMP3.gif │ ├── mmprogresshud_200_animations.gif │ ├── mmprogresshud_200_overlays.gif │ ├── mmprogresshud_200_visuals.gif │ ├── mmprogresshud_320_animations.gif │ ├── mmprogresshud_320_overlays.gif │ └── mmprogresshud_320_visuals.gif ├── LICENSE ├── MMProgressHUD.podspec ├── README.md └── Source ├── MMHud.h ├── MMHud.m ├── MMLinearProgressView.h ├── MMLinearProgressView.m ├── MMProgressHUD+Animations.h ├── MMProgressHUD+Animations.m ├── MMProgressHUD+Class.m ├── MMProgressHUD.h ├── MMProgressHUD.m ├── MMProgressHUDCommon.h ├── MMProgressHUDOverlayView.h ├── MMProgressHUDOverlayView.m ├── MMProgressHUDViewController.h ├── MMProgressHUDViewController.m ├── MMProgressHUDWindow.h ├── MMProgressHUDWindow.m ├── MMProgressView-Protocol.h ├── MMRadialProgressView.h ├── MMRadialProgressView.m ├── MMVectorImage.h └── MMVectorImage.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | .xccheckout 19 | *.gcda 20 | 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | 3 | xcode_workspace: Demo/MMProgressHUDDemo.xcworkspace 4 | 5 | xcode_scheme: MMProgressHUDDemo 6 | 7 | podfile: Demo/Podfile 8 | 9 | 10 | xcode_sdk: iphonesimulator9.0 11 | # - iphonesimulator9.0 12 | # - iphonesimulator8.4 13 | # - iphonesimulator8.3 14 | # - iphonesimulator8.2 15 | # - iphonesimulator8.1 16 | 17 | osx_image: xcode7 -------------------------------------------------------------------------------- /Demo/CoverageFix.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoverageFix.h 3 | // CategoriesExample 4 | // 5 | // Created by Jasdeep Saini on 5/31/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * This fixes a problem related to an Apple implementation of a core unix api. 13 | */ 14 | @interface CoverageFix : NSObject 15 | 16 | 17 | FILE* fopen$UNIX2003(const char* filename, const char* mode); 18 | 19 | size_t fwrite$UNIX2003(const void* ptr, size_t size, size_t nitems, FILE* stream); 20 | 21 | @end -------------------------------------------------------------------------------- /Demo/CoverageFix.m: -------------------------------------------------------------------------------- 1 | // 2 | // CoverageFix.m 3 | // CategoriesExample 4 | // 5 | // Created by Jasdeep Saini on 5/31/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import "CoverageFix.h" 10 | 11 | 12 | @implementation CoverageFix 13 | 14 | FILE* fopen$UNIX2003(const char* filename, const char* mode) { 15 | return fopen(filename, mode); 16 | } 17 | 18 | size_t fwrite$UNIX2003(const void* ptr, size_t size, size_t nitems, FILE* stream) { 19 | return fwrite(ptr, size, nitems, stream); 20 | } 21 | 22 | @end -------------------------------------------------------------------------------- /Demo/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/Default-568h@2x.png -------------------------------------------------------------------------------- /Demo/Images/title-status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/Images/title-status.png -------------------------------------------------------------------------------- /Demo/LogicTests/LogicTests-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 | -------------------------------------------------------------------------------- /Demo/LogicTests/LogicTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'LogicTests' target in the 'LogicTests' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Demo/LogicTests/MMProgressHUDAsyncTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressHUDAsyncTests.m 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 4/21/15. 6 | // Copyright (c) 2015 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MMProgressHUDAsyncTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MMProgressHUDAsyncTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | XCTAssert(YES, @"Pass"); 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Demo/LogicTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo.xcodeproj/project.xcworkspace/xcshareddata/MMProgressHUDDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 26DF34F2-EB5D-4713-837F-32A016859DC6 9 | IDESourceControlProjectName 10 | MMProgressHUDDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 9F8E231B674F38D7C6DC6DD0146D1D3DDCFFE5F1 14 | github.com:mutualmobile/MMProgressHUD.git 15 | 16 | IDESourceControlProjectPath 17 | Demo/MMProgressHUDDemo.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 9F8E231B674F38D7C6DC6DD0146D1D3DDCFFE5F1 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:mutualmobile/MMProgressHUD.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 9F8E231B674F38D7C6DC6DD0146D1D3DDCFFE5F1 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 9F8E231B674F38D7C6DC6DD0146D1D3DDCFFE5F1 36 | IDESourceControlWCCName 37 | MMProgressHUD 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo.xcodeproj/xcshareddata/xcschemes/LogicTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 49 | 51 | 52 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo.xcodeproj/xcshareddata/xcschemes/MMProgressHUDDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 67 | 73 | 74 | 75 | 76 | 77 | 78 | 84 | 86 | 92 | 93 | 94 | 95 | 97 | 98 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo.xcworkspace/xcshareddata/MMProgressHUDDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 96D6D7D0-0693-4D10-B6A3-6F62A4D983EC 9 | IDESourceControlProjectName 10 | MMProgressHUDDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 9F8E231B674F38D7C6DC6DD0146D1D3DDCFFE5F1 14 | github.com:mutualmobile/MMProgressHUD.git 15 | 16 | IDESourceControlProjectPath 17 | Demo/MMProgressHUDDemo.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 9F8E231B674F38D7C6DC6DD0146D1D3DDCFFE5F1 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:mutualmobile/MMProgressHUD.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 9F8E231B674F38D7C6DC6DD0146D1D3DDCFFE5F1 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 9F8E231B674F38D7C6DC6DD0146D1D3DDCFFE5F1 36 | IDESourceControlWCCName 37 | MMProgressHUD 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "57x57", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "57x57", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "3x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "29x29", 46 | "scale" : "2x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "1x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "40x40", 56 | "scale" : "2x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "50x50", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "50x50", 66 | "scale" : "2x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "72x72", 71 | "scale" : "1x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "72x72", 76 | "scale" : "2x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "1x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "76x76", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "Default-55@3x-1.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "736h", 16 | "filename" : "Default-55@3x-Landscape-1.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "landscape", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "extent" : "full-screen", 23 | "idiom" : "iphone", 24 | "subtype" : "667h", 25 | "filename" : "Default-47@2x-1.png", 26 | "minimum-system-version" : "8.0", 27 | "orientation" : "portrait", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "extent" : "full-screen", 34 | "minimum-system-version" : "7.0", 35 | "filename" : "Default-4@2x-1.png", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "extent" : "full-screen", 40 | "idiom" : "iphone", 41 | "subtype" : "retina4", 42 | "filename" : "Default-568h@2x.png", 43 | "minimum-system-version" : "7.0", 44 | "orientation" : "portrait", 45 | "scale" : "2x" 46 | }, 47 | { 48 | "orientation" : "portrait", 49 | "idiom" : "ipad", 50 | "extent" : "full-screen", 51 | "minimum-system-version" : "7.0", 52 | "filename" : "Default-iPad-1.png", 53 | "scale" : "1x" 54 | }, 55 | { 56 | "orientation" : "landscape", 57 | "idiom" : "ipad", 58 | "extent" : "full-screen", 59 | "minimum-system-version" : "7.0", 60 | "filename" : "Default-iPad-Landscape-1.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "orientation" : "portrait", 65 | "idiom" : "ipad", 66 | "extent" : "full-screen", 67 | "minimum-system-version" : "7.0", 68 | "filename" : "Default-iPad@2x-1.png", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "orientation" : "landscape", 73 | "idiom" : "ipad", 74 | "extent" : "full-screen", 75 | "minimum-system-version" : "7.0", 76 | "filename" : "Default-iPad@2x-Landscape-1.png", 77 | "scale" : "2x" 78 | }, 79 | { 80 | "orientation" : "portrait", 81 | "idiom" : "iphone", 82 | "extent" : "full-screen", 83 | "scale" : "1x" 84 | }, 85 | { 86 | "orientation" : "portrait", 87 | "idiom" : "iphone", 88 | "extent" : "full-screen", 89 | "scale" : "2x" 90 | }, 91 | { 92 | "orientation" : "portrait", 93 | "idiom" : "iphone", 94 | "extent" : "full-screen", 95 | "filename" : "Default-568h@2x.png", 96 | "subtype" : "retina4", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "orientation" : "portrait", 101 | "idiom" : "ipad", 102 | "extent" : "to-status-bar", 103 | "scale" : "1x" 104 | }, 105 | { 106 | "orientation" : "portrait", 107 | "idiom" : "ipad", 108 | "extent" : "full-screen", 109 | "scale" : "1x" 110 | }, 111 | { 112 | "orientation" : "landscape", 113 | "idiom" : "ipad", 114 | "extent" : "to-status-bar", 115 | "scale" : "1x" 116 | }, 117 | { 118 | "orientation" : "landscape", 119 | "idiom" : "ipad", 120 | "extent" : "full-screen", 121 | "scale" : "1x" 122 | }, 123 | { 124 | "orientation" : "portrait", 125 | "idiom" : "ipad", 126 | "extent" : "to-status-bar", 127 | "scale" : "2x" 128 | }, 129 | { 130 | "orientation" : "portrait", 131 | "idiom" : "ipad", 132 | "extent" : "full-screen", 133 | "scale" : "2x" 134 | }, 135 | { 136 | "orientation" : "landscape", 137 | "idiom" : "ipad", 138 | "extent" : "to-status-bar", 139 | "scale" : "2x" 140 | }, 141 | { 142 | "orientation" : "landscape", 143 | "idiom" : "ipad", 144 | "extent" : "full-screen", 145 | "scale" : "2x" 146 | } 147 | ], 148 | "info" : { 149 | "version" : 1, 150 | "author" : "xcode" 151 | } 152 | } -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-47@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-47@2x-1.png -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-4@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-4@2x-1.png -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-55@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-55@3x-1.png -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-55@3x-Landscape-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-55@3x-Landscape-1.png -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-iPad-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-iPad-1.png -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-iPad-Landscape-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-iPad-Landscape-1.png -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-iPad@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-iPad@2x-1.png -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-iPad@2x-Landscape-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/MMProgressHUDDemo/Images.xcassets/LaunchImage.launchimage/Default-iPad@2x-Landscape-1.png -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMAppDelegate.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/4/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MMViewController; 12 | 13 | @interface MMAppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) MMViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMAppDelegate.m 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/4/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import "MMAppDelegate.h" 10 | 11 | #import "MMViewController.h" 12 | 13 | @implementation MMAppDelegate 14 | 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | 20 | MMViewController *vc = [[MMViewController alloc] init]; 21 | 22 | self.viewController = vc; 23 | self.window.rootViewController = self.viewController; 24 | 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application 30 | { 31 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 32 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 33 | } 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application 36 | { 37 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | - (void)applicationWillEnterForeground:(UIApplication *)application 42 | { 43 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 44 | } 45 | 46 | - (void)applicationDidBecomeActive:(UIApplication *)application 47 | { 48 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 49 | } 50 | 51 | - (void)applicationWillTerminate:(UIApplication *)application 52 | { 53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | MMHud Demo 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIcons 12 | 13 | CFBundleIcons~ipad 14 | 15 | CFBundleIdentifier 16 | $(PRODUCT_BUNDLE_IDENTIFIER) 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | ${PRODUCT_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 1.0 29 | LSRequiresIPhoneOS 30 | 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeRight 39 | UIInterfaceOrientationLandscapeLeft 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MMProgressHUDDemo' target in the 'MMProgressHUDDemo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | 16 | #define MM_HUD_DEBUG 1 17 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo/MMAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMAppDelegate.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/4/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MMViewController; 12 | 13 | @interface MMAppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) MMViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo/MMAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMAppDelegate.m 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/4/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "MMAppDelegate.h" 10 | 11 | #import "MMViewController.h" 12 | 13 | @implementation MMAppDelegate 14 | 15 | @synthesize window = _window; 16 | @synthesize viewController = _viewController; 17 | 18 | - (void)dealloc 19 | { 20 | [_window release]; 21 | [_viewController release]; 22 | [super dealloc]; 23 | } 24 | 25 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 26 | { 27 | self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 28 | // Override point for customization after application launch. 29 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 30 | self.viewController = [[[MMViewController alloc] initWithNibName:@"MMViewController_iPhone" bundle:nil] autorelease]; 31 | } else { 32 | self.viewController = [[[MMViewController alloc] initWithNibName:@"MMViewController_iPad" bundle:nil] autorelease]; 33 | } 34 | self.window.rootViewController = self.viewController; 35 | [self.window makeKeyAndVisible]; 36 | return YES; 37 | } 38 | 39 | - (void)applicationWillResignActive:(UIApplication *)application 40 | { 41 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 42 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 43 | } 44 | 45 | - (void)applicationDidEnterBackground:(UIApplication *)application 46 | { 47 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 48 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 49 | } 50 | 51 | - (void)applicationWillEnterForeground:(UIApplication *)application 52 | { 53 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 54 | } 55 | 56 | - (void)applicationDidBecomeActive:(UIApplication *)application 57 | { 58 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 59 | } 60 | 61 | - (void)applicationWillTerminate:(UIApplication *)application 62 | { 63 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo/MMProgressHUDDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.mutualmobile.${PRODUCT_NAME:rfc1034identifier} 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 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo/MMProgressHUDDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MMProgressHUDDemo' target in the 'MMProgressHUDDemo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo/MMViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMViewController.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/4/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MMViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo/MMViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMViewController.m 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/4/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "MMViewController.h" 10 | 11 | @interface MMViewController () 12 | 13 | @end 14 | 15 | @implementation MMViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)viewDidUnload 24 | { 25 | [super viewDidUnload]; 26 | // Release any retained subviews of the main view. 27 | } 28 | 29 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 30 | { 31 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 32 | return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 33 | } else { 34 | return YES; 35 | } 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/4/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "MMAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([MMAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMProgressHUDPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressHUDPrivate.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 6/28/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "MMProgressHUD.h" 12 | #import "MMProgressHUDOverlayView.h" 13 | 14 | @class MMRadialProgressView; 15 | 16 | @interface MMProgressHUD() 17 | 18 | @property (nonatomic, strong) UIView *gradientView; 19 | @property (nonatomic, strong) MMProgressHUDWindow *window; 20 | @property (nonatomic, strong) UILabel *titleLabel; 21 | @property (nonatomic, strong) UILabel *statusLabel; 22 | @property (nonatomic, strong) UIImageView *imageView; 23 | @property (nonatomic, readwrite, getter = isVisible) BOOL visible; 24 | @property (nonatomic, copy) NSString *title; 25 | @property (nonatomic, copy) NSString *status; 26 | @property (nonatomic, strong) UIImage *image; 27 | @property (nonatomic, copy) NSArray *animationImages; 28 | @property (nonatomic, strong) CAAnimation *queuedShowAnimation; 29 | @property (nonatomic, strong) CAAnimation *queuedDismissAnimation; 30 | @property (nonatomic, assign) MMProgressHUDCompletionState completionState; 31 | @property (nonatomic, strong) UIView *progressViewContainer; 32 | @property (nonatomic, strong) MMRadialProgressView *radialProgressView; 33 | @property (nonatomic, strong) MMProgressHUDOverlayView *overlayView; 34 | 35 | - (void)_buildTextLabel; 36 | - (void)_buildStatusLabel; 37 | - (void)_buildHUDWindow; 38 | - (void)_buildHUD; 39 | - (void)_buildOverlayViewForMode:(MMProgressHUDWindowOverlayMode)overlayMode inView:(UIView *)view; 40 | - (void)_updateMessageLabelsWithAnimationDuration:(CGFloat)animationDuration; 41 | - (void)_updateHUDAnimated:(BOOL)animated withCompletion:(void(^)(BOOL completed))completionBlock; 42 | - (void)_updateHUD; 43 | - (void)_layoutContentArea; 44 | - (UIImage *)_imageForCompletionState:(MMProgressHUDCompletionState)completionState; 45 | - (CGPoint)_windowCenterForHUDAnchor:(CGPoint)anchor; 46 | - (void)forceCleanup; 47 | 48 | #pragma mark - Animations 49 | - (CAAnimationGroup *)_glowAnimation; 50 | - (void)_beginGlowAnimation; 51 | - (void)_endGlowAnimation; 52 | - (void)_showWithDropAnimation; 53 | - (void)_dismissWithDropAnimation; 54 | - (void)_showWithExpandAnimation; 55 | - (void)_dismissWithExpandAnimation; 56 | - (void)_showWithShrinkAnimation; 57 | - (void)_dismissWithShrinkAnimation; 58 | - (void)_showWithSwingInAnimationFromLeft:(BOOL)fromLeft; 59 | - (void)_dismissWithSwingRightAnimation; 60 | - (void)_dismissWithSwingLeftAnimation; 61 | - (void)_showWithBalloonAnimation; 62 | - (void)_dismissWithBalloonAnimation; 63 | - (void)_showWithFadeAnimation; 64 | - (void)_dismissWithFadeAnimation; 65 | //show 66 | //dismiss 67 | - (void)_executeShowAnimation:(CAAnimation *)animation; 68 | - (void)_executeDismissAnimation:(CAAnimation *)animation; 69 | - (CGPoint)_antialiasedPositionPointForPoint:(CGPoint)oldCenter forLayer:(CALayer *)layer; 70 | 71 | #pragma mark - Animation Foundries 72 | - (CAAnimation *)_dropAnimationIn; 73 | - (CAAnimation *)_dropAnimationOut; 74 | - (CAAnimation *)_shrinkAnimation:(BOOL)shrink animateOut:(BOOL)fadeOut; 75 | - (CAAnimation *)_swingInAnimationFromLeft:(BOOL)fromLeft; 76 | - (CAAnimation *)_moveInAnimation; 77 | - (CAAnimation *)_fadeInAnimation; 78 | - (CAAnimation *)_balloonAnimationIn; 79 | - (CAAnimation *)_balloonAnimationOut; 80 | - (CAAnimation *)_confettiAnimationOut; 81 | 82 | #pragma mark - Animation Delegate 83 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag; 84 | 85 | #pragma mark - Gestures 86 | - (void)_handleTap:(UITapGestureRecognizer *)recognizer; 87 | - (void)_resetConfirmationTimer:(NSTimer *)timer; 88 | 89 | - (void)showWithTitle:(NSString *)title 90 | status:(NSString *)status 91 | confirmationMessage:(NSString *)confirmationMessage 92 | cancelBlock:(void(^)(void))cancelBlock 93 | images:(NSArray *)images; 94 | 95 | - (void)showWithTitle:(NSString *)title 96 | status:(NSString *)status 97 | confirmationMessage:(NSString *)confirmationMessage 98 | cancelBlock:(void(^)(void))cancelBlock 99 | indeterminate:(BOOL)indeterminate; 100 | 101 | - (void)dismissWithCompletionState:(MMProgressHUDCompletionState)completionState 102 | title:(NSString *)title 103 | status:(NSString *)status 104 | afterDelay:(CGFloat)delay; 105 | 106 | @end 107 | 108 | @interface MMHud() 109 | 110 | @property (nonatomic, strong, readwrite) UIView *progressViewContainer; 111 | @property (nonatomic, readwrite) BOOL visible; 112 | 113 | - (void)_buildTitleLabel; 114 | - (void)_buildStatusLabel; 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/MMViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMViewController.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/4/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MMViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Demo/MMProgressHUDDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/4/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "MMAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([MMAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Demo/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | pod 'MMProgressHUD', :path => '../MMProgressHUD.podspec' 4 | 5 | target :LogicTests do 6 | pod 'OCMock' 7 | end 8 | -------------------------------------------------------------------------------- /Demo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MMProgressHUD (0.3.0) 3 | - OCMock (3.1.2) 4 | 5 | DEPENDENCIES: 6 | - MMProgressHUD (from `../MMProgressHUD.podspec`) 7 | - OCMock 8 | 9 | EXTERNAL SOURCES: 10 | MMProgressHUD: 11 | :path: ../MMProgressHUD.podspec 12 | 13 | SPEC CHECKSUMS: 14 | MMProgressHUD: 8e37d243f7c4b5036ac5b949472a0d9fa51f1128 15 | OCMock: a10ea9f0a6e921651f96f78b6faee95ebc813b92 16 | 17 | COCOAPODS: 0.36.4 18 | -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMHud.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMHud.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMLinearProgressView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMLinearProgressView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMProgressHUD+Animations.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressHUD+Animations.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressHUD.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMProgressHUDCommon.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressHUDCommon.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMProgressHUDOverlayView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressHUDOverlayView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMProgressHUDViewController.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressHUDViewController.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMProgressHUDWindow.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressHUDWindow.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMProgressView-Protocol.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressView-Protocol.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMRadialProgressView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMRadialProgressView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/MMProgressHUD/MMVectorImage.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMVectorImage.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/NSInvocation+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/NSInvocation+OCMAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/NSMethodSignature+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/NSMethodSignature+OCMAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/NSObject+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/NSObject+OCMAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/NSValue+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/NSValue+OCMAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCClassMockObject.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCClassMockObject.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMArg.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMArg.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMBlockCaller.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMBlockCaller.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMBoxedReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMBoxedReturnValueProvider.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMConstraint.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMExceptionReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMExceptionReturnValueProvider.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMExpectationRecorder.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMExpectationRecorder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMFunctions.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMFunctions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMIndirectReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMIndirectReturnValueProvider.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMInvocationExpectation.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMInvocationExpectation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMInvocationMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMInvocationMatcher.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMInvocationStub.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMInvocationStub.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMLocation.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMLocation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMMacroState.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMMacroState.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMNotificationPoster.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMNotificationPoster.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMObserverRecorder.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMObserverRecorder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMPassByRefSetter.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMPassByRefSetter.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMRealObjectForwarder.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMRealObjectForwarder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMRecorder.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMRecorder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMReturnValueProvider.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMStubRecorder.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMStubRecorder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMVerifier.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMVerifier.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMock.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMock.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCMockObject.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMockObject.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCObserverMockObject.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCObserverMockObject.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCPartialMockObject.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCPartialMockObject.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/OCMock/OCProtocolMockObject.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCProtocolMockObject.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/MMProgressHUD/MMHud.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMHud.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/MMProgressHUD/MMLinearProgressView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMLinearProgressView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/MMProgressHUD/MMProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressHUD.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/MMProgressHUD/MMProgressHUDOverlayView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressHUDOverlayView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/MMProgressHUD/MMProgressView-Protocol.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMProgressView-Protocol.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/MMProgressHUD/MMRadialProgressView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMRadialProgressView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/MMProgressHUD/MMVectorImage.h: -------------------------------------------------------------------------------- 1 | ../../../../../Source/MMVectorImage.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/OCMock/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/OCMock/OCMArg.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMArg.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/OCMock/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMConstraint.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/OCMock/OCMLocation.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMLocation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/OCMock/OCMMacroState.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMMacroState.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/OCMock/OCMRecorder.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMRecorder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/OCMock/OCMStubRecorder.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMStubRecorder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/OCMock/OCMock.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMock.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/OCMock/OCMockObject.h: -------------------------------------------------------------------------------- 1 | ../../../OCMock/Source/OCMock/OCMockObject.h -------------------------------------------------------------------------------- /Demo/Pods/Local Podspecs/MMProgressHUD.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MMProgressHUD", 3 | "version": "0.3.0", 4 | "summary": "An easy to use HUD interface with personality.", 5 | "homepage": "https://github.com/mutualmobile/MMProgressHUD", 6 | "license": "MIT", 7 | "authors": { 8 | "Lars Anderson": "lars.anderson@mutualmobile.com" 9 | }, 10 | "source": { 11 | "git": "https://github.com/mutualmobile/MMProgressHUD.git", 12 | "tag": "0.3.0" 13 | }, 14 | "platforms": { 15 | "ios": "5.0" 16 | }, 17 | "source_files": "Source/*.{h,m}", 18 | "public_header_files": "Source/{MMProgressHUDOverlayView,MMProgressHUD,MMHud,MMProgressView-Protocol,MMRadialProgressView,MMLinearProgressView,MMVectorImage}.h", 19 | "frameworks": [ 20 | "QuartzCore", 21 | "CoreGraphics" 22 | ], 23 | "requires_arc": true 24 | } 25 | -------------------------------------------------------------------------------- /Demo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MMProgressHUD (0.3.0) 3 | - OCMock (3.1.2) 4 | 5 | DEPENDENCIES: 6 | - MMProgressHUD (from `../MMProgressHUD.podspec`) 7 | - OCMock 8 | 9 | EXTERNAL SOURCES: 10 | MMProgressHUD: 11 | :path: ../MMProgressHUD.podspec 12 | 13 | SPEC CHECKSUMS: 14 | MMProgressHUD: 8e37d243f7c4b5036ac5b949472a0d9fa51f1128 15 | OCMock: a10ea9f0a6e921651f96f78b6faee95ebc813b92 16 | 17 | COCOAPODS: 0.36.4 18 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/README.md: -------------------------------------------------------------------------------- 1 | OCMock 2 | ====== 3 | 4 | OCMock is an Objective-C implementation of mock objects. 5 | 6 | Github is used to store and manage the source code. 7 | 8 | For downloads, documentation, and support please visit [ocmock.org][]. 9 | 10 | [![Build Status](https://travis-ci.org/erikdoe/ocmock.svg?branch=master)](https://travis-ci.org/erikdoe/ocmock) 11 | 12 | [ocmock.org]: http://ocmock.org/ 13 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/NSInvocation+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface NSInvocation(OCMAdditions) 20 | 21 | - (BOOL)hasCharPointerArgument; 22 | 23 | - (id)getArgumentAtIndexAsObject:(NSInteger)argIndex; 24 | 25 | - (NSString *)invocationDescription; 26 | 27 | - (NSString *)argumentDescriptionAtIndex:(NSInteger)argIndex; 28 | 29 | - (NSString *)objectDescriptionAtIndex:(NSInteger)anInt; 30 | - (NSString *)charDescriptionAtIndex:(NSInteger)anInt; 31 | - (NSString *)unsignedCharDescriptionAtIndex:(NSInteger)anInt; 32 | - (NSString *)intDescriptionAtIndex:(NSInteger)anInt; 33 | - (NSString *)unsignedIntDescriptionAtIndex:(NSInteger)anInt; 34 | - (NSString *)shortDescriptionAtIndex:(NSInteger)anInt; 35 | - (NSString *)unsignedShortDescriptionAtIndex:(NSInteger)anInt; 36 | - (NSString *)longDescriptionAtIndex:(NSInteger)anInt; 37 | - (NSString *)unsignedLongDescriptionAtIndex:(NSInteger)anInt; 38 | - (NSString *)longLongDescriptionAtIndex:(NSInteger)anInt; 39 | - (NSString *)unsignedLongLongDescriptionAtIndex:(NSInteger)anInt; 40 | - (NSString *)doubleDescriptionAtIndex:(NSInteger)anInt; 41 | - (NSString *)floatDescriptionAtIndex:(NSInteger)anInt; 42 | - (NSString *)structDescriptionAtIndex:(NSInteger)anInt; 43 | - (NSString *)pointerDescriptionAtIndex:(NSInteger)anInt; 44 | - (NSString *)cStringDescriptionAtIndex:(NSInteger)anInt; 45 | - (NSString *)selectorDescriptionAtIndex:(NSInteger)anInt; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/NSMethodSignature+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface NSMethodSignature(PrivateAPI) 20 | 21 | + (id)signatureWithObjCTypes:(const char *)types; 22 | 23 | @end 24 | 25 | @interface NSMethodSignature(OCMAdditions) 26 | 27 | - (BOOL)usesSpecialStructureReturn; 28 | - (NSString *)fullTypeString; 29 | - (const char *)fullObjCTypes; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/NSMethodSignature+OCMAdditions.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "NSMethodSignature+OCMAdditions.h" 18 | #import "OCMFunctions.h" 19 | #import 20 | 21 | 22 | @implementation NSMethodSignature(OCMAdditions) 23 | 24 | - (BOOL)usesSpecialStructureReturn 25 | { 26 | const char *types = OCMTypeWithoutQualifiers([self methodReturnType]); 27 | 28 | if((types == NULL) || (types[0] != '{')) 29 | return NO; 30 | 31 | /* In some cases structures are returned by ref. The rules are complex and depend on the 32 | architecture, see: 33 | 34 | http://sealiesoftware.com/blog/archive/2008/10/30/objc_explain_objc_msgSend_stret.html 35 | http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/LowLevelABI/000-Introduction/introduction.html 36 | https://github.com/atgreen/libffi/blob/master/src/x86/ffi64.c 37 | http://www.uclibc.org/docs/psABI-x86_64.pdf 38 | http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf 39 | 40 | NSMethodSignature knows the details but has no API to return it, though it is in 41 | the debugDescription. Horribly kludgy. 42 | */ 43 | NSRange range = [[self debugDescription] rangeOfString:@"is special struct return? YES"]; 44 | return range.length > 0; 45 | } 46 | 47 | - (NSString *)fullTypeString 48 | { 49 | NSMutableString *typeString = [NSMutableString string]; 50 | [typeString appendFormat:@"%s", [self methodReturnType]]; 51 | for (NSUInteger i=0; i<[self numberOfArguments]; i++) 52 | [typeString appendFormat:@"%s", [self getArgumentTypeAtIndex:i]]; 53 | return typeString; 54 | } 55 | 56 | - (const char *)fullObjCTypes 57 | { 58 | return [[self fullTypeString] UTF8String]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCObserverMockObject; 20 | 21 | 22 | @interface NSNotificationCenter(OCMAdditions) 23 | 24 | - (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "NSNotificationCenter+OCMAdditions.h" 18 | #import "OCObserverMockObject.h" 19 | 20 | 21 | @implementation NSNotificationCenter(OCMAdditions) 22 | 23 | - (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender 24 | { 25 | [notificationObserver autoRemoveFromCenter:self]; 26 | [self addObserver:notificationObserver selector:@selector(handleNotification:) name:notificationName object:notificationSender]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/NSObject+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface NSObject(OCMAdditions) 20 | 21 | + (IMP)instanceMethodForwarderForSelector:(SEL)aSelector; 22 | + (void)enumerateMethodsInClass:(Class)aClass usingBlock:(void (^)(Class cls, SEL sel))aBlock; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/NSObject+OCMAdditions.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "NSObject+OCMAdditions.h" 18 | #import "NSMethodSignature+OCMAdditions.h" 19 | #import 20 | 21 | @implementation NSObject(OCMAdditions) 22 | 23 | + (IMP)instanceMethodForwarderForSelector:(SEL)aSelector 24 | { 25 | // use sel_registerName() and not @selector to avoid warning 26 | SEL selectorWithNoImplementation = sel_registerName("methodWhichMustNotExist::::"); 27 | 28 | #ifndef __arm64__ 29 | static NSMutableDictionary *_OCMReturnTypeCache; 30 | 31 | if(_OCMReturnTypeCache == nil) 32 | _OCMReturnTypeCache = [[NSMutableDictionary alloc] init]; 33 | 34 | BOOL needsStructureReturn; 35 | void *rawCacheKey[2] = { (void *)self, aSelector }; 36 | NSData *cacheKey = [NSData dataWithBytes:rawCacheKey length:sizeof(rawCacheKey)]; 37 | NSNumber *cachedValue = [_OCMReturnTypeCache objectForKey:cacheKey]; 38 | 39 | if(cachedValue == nil) 40 | { 41 | NSMethodSignature *sig = [self instanceMethodSignatureForSelector:aSelector]; 42 | needsStructureReturn = [sig usesSpecialStructureReturn]; 43 | [_OCMReturnTypeCache setObject:@(needsStructureReturn) forKey:cacheKey]; 44 | } 45 | else 46 | { 47 | needsStructureReturn = [cachedValue boolValue]; 48 | } 49 | 50 | if(needsStructureReturn) 51 | return class_getMethodImplementation_stret([NSObject class], selectorWithNoImplementation); 52 | #endif 53 | 54 | return class_getMethodImplementation([NSObject class], selectorWithNoImplementation); 55 | } 56 | 57 | 58 | + (void)enumerateMethodsInClass:(Class)aClass usingBlock:(void (^)(Class cls, SEL sel))aBlock 59 | { 60 | for(Class cls = aClass; cls != nil; cls = class_getSuperclass(cls)) 61 | { 62 | Method *methodList = class_copyMethodList(cls, NULL); 63 | if(methodList == NULL) 64 | continue; 65 | 66 | for(Method *mPtr = methodList; *mPtr != NULL; mPtr++) 67 | { 68 | SEL sel = method_getName(*mPtr); 69 | aBlock(cls, sel); 70 | } 71 | free(methodList); 72 | } 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/NSValue+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface NSValue(OCMAdditions) 20 | 21 | - (BOOL)getBytes:(void *)outputBuf objCType:(const char *)targetType; 22 | 23 | @end -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/NSValue+OCMAdditions.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "NSValue+OCMAdditions.h" 18 | 19 | 20 | @implementation NSValue(OCMAdditions) 21 | 22 | static CFNumberType OCMNumberTypeForObjCType(const char *objcType) 23 | { 24 | switch (objcType[0]) 25 | { 26 | case 'c': return kCFNumberCharType; 27 | case 'C': return kCFNumberCharType; 28 | case 'B': return kCFNumberCharType; 29 | case 's': return kCFNumberShortType; 30 | case 'S': return kCFNumberShortType; 31 | case 'i': return kCFNumberIntType; 32 | case 'I': return kCFNumberIntType; 33 | case 'l': return kCFNumberLongType; 34 | case 'L': return kCFNumberLongType; 35 | case 'q': return kCFNumberLongLongType; 36 | case 'Q': return kCFNumberLongLongType; 37 | case 'f': return kCFNumberFloatType; 38 | case 'd': return kCFNumberDoubleType; 39 | default: return 0; 40 | } 41 | } 42 | 43 | 44 | static NSNumber *OCMNumberForValue(NSValue *value) 45 | { 46 | #define CREATE_NUM(_type) ({ _type _v; [value getValue:&_v]; @(_v); }) 47 | switch([value objCType][0]) 48 | { 49 | case 'c': return CREATE_NUM(char); 50 | case 'C': return CREATE_NUM(unsigned char); 51 | case 'B': return CREATE_NUM(bool); 52 | case 's': return CREATE_NUM(short); 53 | case 'S': return CREATE_NUM(unsigned short); 54 | case 'i': return CREATE_NUM(int); 55 | case 'I': return CREATE_NUM(unsigned int); 56 | case 'l': return CREATE_NUM(long); 57 | case 'L': return CREATE_NUM(unsigned long); 58 | case 'q': return CREATE_NUM(long long); 59 | case 'Q': return CREATE_NUM(unsigned long long); 60 | case 'f': return CREATE_NUM(float); 61 | case 'd': return CREATE_NUM(double); 62 | default: return nil; 63 | } 64 | } 65 | 66 | 67 | - (BOOL)getBytes:(void *)outputBuf objCType:(const char *)targetType 68 | { 69 | /* 70 | * See if they are similar number types, and if we can convert losslessly between them. 71 | * For the most part, we set things up to use CFNumberGetValue, which returns false if 72 | * conversion will be lossy. 73 | */ 74 | CFNumberType inputType = OCMNumberTypeForObjCType([self objCType]); 75 | CFNumberType outputType = OCMNumberTypeForObjCType(targetType); 76 | 77 | if(inputType == 0 || outputType == 0) // one or both are non-number types 78 | return NO; 79 | 80 | NSNumber *inputNumber = [self isKindOfClass:[NSNumber class]] ? (NSNumber *)self : OCMNumberForValue(self); 81 | 82 | /* 83 | * Due to some legacy, back-compatible requirements in CFNumber.c, CFNumberGetValue can return true for 84 | * some conversions which should not be allowed (by reading source, conversions from integer types to 85 | * 8-bit or 16-bit integer types). So, check ourselves. 86 | */ 87 | long long min; 88 | long long max; 89 | long long val = [inputNumber longLongValue]; 90 | switch(targetType[0]) 91 | { 92 | case 'B': 93 | case 'c': min = CHAR_MIN; max = CHAR_MAX; break; 94 | case 'C': min = 0; max = UCHAR_MAX; break; 95 | case 's': min = SHRT_MIN; max = SHRT_MAX; break; 96 | case 'S': min = 0; max = USHRT_MAX; break; 97 | default: min = LLONG_MIN; max = LLONG_MAX; break; 98 | } 99 | if(val < min || val > max) 100 | return NO; 101 | 102 | /* Get the number, and return NO if the value was out of range or conversion was lossy */ 103 | return CFNumberGetValue((CFNumberRef)inputNumber, outputType, outputBuf); 104 | } 105 | 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCClassMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCClassMockObject : OCMockObject 20 | { 21 | Class mockedClass; 22 | Class originalMetaClass; 23 | } 24 | 25 | - (id)initWithClass:(Class)aClass; 26 | 27 | - (Class)mockedClass; 28 | - (Class)mockObjectClass; // since -class returns the mockedClass 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMArg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMArg : NSObject 20 | 21 | // constraining arguments 22 | 23 | + (id)any; 24 | + (SEL)anySelector; 25 | + (void *)anyPointer; 26 | + (id __autoreleasing *)anyObjectRef; 27 | + (id)isNil; 28 | + (id)isNotNil; 29 | + (id)isEqual:(id)value; 30 | + (id)isNotEqual:(id)value; 31 | + (id)isKindOfClass:(Class)cls; 32 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 33 | + (id)checkWithBlock:(BOOL (^)(id obj))block; 34 | 35 | // manipulating arguments 36 | 37 | + (id *)setTo:(id)value; 38 | + (void *)setToValue:(NSValue *)value; 39 | 40 | // internal use only 41 | 42 | + (id)resolveSpecialValues:(NSValue *)value; 43 | 44 | @end 45 | 46 | #define OCMOCK_ANY [OCMArg any] 47 | 48 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 49 | #define OCMOCK_VALUE(variable) \ 50 | ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) 51 | #else 52 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 53 | #endif 54 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMArg.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import 19 | #import 20 | #import "OCMPassByRefSetter.h" 21 | 22 | @implementation OCMArg 23 | 24 | + (id)any 25 | { 26 | return [OCMAnyConstraint constraint]; 27 | } 28 | 29 | + (void *)anyPointer 30 | { 31 | return (void *)0x01234567; 32 | } 33 | 34 | + (id __autoreleasing *)anyObjectRef 35 | { 36 | return (id *)0x01234567; 37 | } 38 | 39 | + (SEL)anySelector 40 | { 41 | return NSSelectorFromString(@"aSelectorThatMatchesAnySelector"); 42 | } 43 | 44 | + (id)isNil 45 | { 46 | return [OCMIsNilConstraint constraint]; 47 | } 48 | 49 | + (id)isNotNil 50 | { 51 | return [OCMIsNotNilConstraint constraint]; 52 | } 53 | 54 | + (id)isEqual:(id)value 55 | { 56 | return value; 57 | } 58 | 59 | + (id)isNotEqual:(id)value 60 | { 61 | OCMIsNotEqualConstraint *constraint = [OCMIsNotEqualConstraint constraint]; 62 | constraint->testValue = value; 63 | return constraint; 64 | } 65 | 66 | + (id)isKindOfClass:(Class)cls 67 | { 68 | return [[[OCMBlockConstraint alloc] initWithConstraintBlock:^BOOL(id obj) { 69 | return [obj isKindOfClass:cls]; 70 | }] autorelease]; 71 | } 72 | 73 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject 74 | { 75 | return [OCMConstraint constraintWithSelector:selector onObject:anObject]; 76 | } 77 | 78 | + (id)checkWithBlock:(BOOL (^)(id))block 79 | { 80 | return [[[OCMBlockConstraint alloc] initWithConstraintBlock:block] autorelease]; 81 | } 82 | 83 | + (id *)setTo:(id)value 84 | { 85 | return (id *)[[[OCMPassByRefSetter alloc] initWithValue:value] autorelease]; 86 | } 87 | 88 | + (void *)setToValue:(NSValue *)value 89 | { 90 | return (id *)[[[OCMPassByRefSetter alloc] initWithValue:value] autorelease]; 91 | } 92 | 93 | + (id)resolveSpecialValues:(NSValue *)value 94 | { 95 | const char *type = [value objCType]; 96 | if(type[0] == '^') 97 | { 98 | void *pointer = [value pointerValue]; 99 | if(pointer == (void *)0x01234567) 100 | return [OCMArg any]; 101 | if((pointer != NULL) && (object_getClass((id)pointer) == [OCMPassByRefSetter class])) 102 | return (id)pointer; 103 | } 104 | else if(type[0] == ':') 105 | { 106 | SEL selector; 107 | [value getValue:&selector]; 108 | if(selector == NSSelectorFromString(@"aSelectorThatMatchesAnySelector")) 109 | return [OCMArg any]; 110 | } 111 | return value; 112 | } 113 | 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMBlockCaller.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | @interface OCMBlockCaller : NSObject 21 | { 22 | void (^block)(NSInvocation *); 23 | } 24 | 25 | - (id)initWithCallBlock:(void (^)(NSInvocation *))theBlock; 26 | 27 | - (void)handleInvocation:(NSInvocation *)anInvocation; 28 | 29 | @end 30 | 31 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMBlockCaller.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMBlockCaller.h" 18 | 19 | 20 | @implementation OCMBlockCaller 21 | 22 | -(id)initWithCallBlock:(void (^)(NSInvocation *))theBlock 23 | { 24 | self = [super init]; 25 | block = [theBlock copy]; 26 | return self; 27 | } 28 | 29 | -(void)dealloc 30 | { 31 | [block release]; 32 | [super dealloc]; 33 | } 34 | 35 | - (void)handleInvocation:(NSInvocation *)anInvocation 36 | { 37 | if (block != nil) 38 | { 39 | block(anInvocation); 40 | } 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMBoxedReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMReturnValueProvider.h" 18 | 19 | @interface OCMBoxedReturnValueProvider : OCMReturnValueProvider 20 | { 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMBoxedReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMBoxedReturnValueProvider.h" 18 | #import "OCMFunctions.h" 19 | #import "NSValue+OCMAdditions.h" 20 | 21 | @implementation OCMBoxedReturnValueProvider 22 | 23 | - (void)handleInvocation:(NSInvocation *)anInvocation 24 | { 25 | const char *returnType = [[anInvocation methodSignature] methodReturnType]; 26 | NSUInteger returnTypeSize = [[anInvocation methodSignature] methodReturnLength]; 27 | char valueBuffer[returnTypeSize]; 28 | NSValue *returnValueAsNSValue = (NSValue *)returnValue; 29 | 30 | if([self isMethodReturnType:returnType compatibleWithValueType:[returnValueAsNSValue objCType]]) 31 | { 32 | [returnValueAsNSValue getValue:valueBuffer]; 33 | [anInvocation setReturnValue:valueBuffer]; 34 | } 35 | else if([returnValueAsNSValue getBytes:valueBuffer objCType:returnType]) 36 | { 37 | [anInvocation setReturnValue:valueBuffer]; 38 | } 39 | else 40 | { 41 | [NSException raise:NSInvalidArgumentException 42 | format:@"Return value cannot be used for method; method signature declares '%s' but value is '%s'.", returnType, [returnValueAsNSValue objCType]]; 43 | } 44 | } 45 | 46 | 47 | - (BOOL)isMethodReturnType:(const char *)returnType compatibleWithValueType:(const char *)valueType 48 | { 49 | /* Same types are obviously compatible */ 50 | if(strcmp(returnType, valueType) == 0) 51 | return YES; 52 | 53 | /* Allow void* for methods that return id, mainly to be able to handle nil */ 54 | if(strcmp(returnType, @encode(id)) == 0 && strcmp(valueType, @encode(void *)) == 0) 55 | return YES; 56 | 57 | return OCMEqualTypesAllowingOpaqueStructs(returnType, valueType); 58 | } 59 | 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | @interface OCMConstraint : NSObject 21 | 22 | + (instancetype)constraint; 23 | - (BOOL)evaluate:(id)value; 24 | 25 | // if you are looking for any, isNil, etc, they have moved to OCMArg 26 | 27 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 28 | 29 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 30 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 31 | 32 | 33 | @end 34 | 35 | @interface OCMAnyConstraint : OCMConstraint 36 | @end 37 | 38 | @interface OCMIsNilConstraint : OCMConstraint 39 | @end 40 | 41 | @interface OCMIsNotNilConstraint : OCMConstraint 42 | @end 43 | 44 | @interface OCMIsNotEqualConstraint : OCMConstraint 45 | { 46 | @public 47 | id testValue; 48 | } 49 | 50 | @end 51 | 52 | @interface OCMInvocationConstraint : OCMConstraint 53 | { 54 | @public 55 | NSInvocation *invocation; 56 | } 57 | 58 | @end 59 | 60 | @interface OCMBlockConstraint : OCMConstraint 61 | { 62 | BOOL (^block)(id); 63 | } 64 | 65 | - (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; 66 | 67 | @end 68 | 69 | 70 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 71 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 72 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMConstraint.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | @implementation OCMConstraint 21 | 22 | + (instancetype)constraint 23 | { 24 | return [[[self alloc] init] autorelease]; 25 | } 26 | 27 | - (BOOL)evaluate:(id)value 28 | { 29 | return NO; 30 | } 31 | 32 | - (id)copyWithZone:(struct _NSZone *)zone 33 | { 34 | return [self retain]; 35 | } 36 | 37 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject 38 | { 39 | OCMInvocationConstraint *constraint = [OCMInvocationConstraint constraint]; 40 | NSMethodSignature *signature = [anObject methodSignatureForSelector:aSelector]; 41 | if(signature == nil) 42 | [NSException raise:NSInvalidArgumentException format:@"Unkown selector %@ used in constraint.", NSStringFromSelector(aSelector)]; 43 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; 44 | [invocation setTarget:anObject]; 45 | [invocation setSelector:aSelector]; 46 | constraint->invocation = invocation; 47 | return constraint; 48 | } 49 | 50 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue 51 | { 52 | OCMInvocationConstraint *constraint = [self constraintWithSelector:aSelector onObject:anObject]; 53 | if([[constraint->invocation methodSignature] numberOfArguments] < 4) 54 | [NSException raise:NSInvalidArgumentException format:@"Constraint with value requires selector with two arguments."]; 55 | [constraint->invocation setArgument:&aValue atIndex:3]; 56 | return constraint; 57 | } 58 | 59 | 60 | @end 61 | 62 | 63 | 64 | #pragma mark - 65 | 66 | @implementation OCMAnyConstraint 67 | 68 | - (BOOL)evaluate:(id)value 69 | { 70 | return YES; 71 | } 72 | 73 | @end 74 | 75 | 76 | 77 | #pragma mark - 78 | 79 | @implementation OCMIsNilConstraint 80 | 81 | - (BOOL)evaluate:(id)value 82 | { 83 | return value == nil; 84 | } 85 | 86 | @end 87 | 88 | 89 | 90 | #pragma mark - 91 | 92 | @implementation OCMIsNotNilConstraint 93 | 94 | - (BOOL)evaluate:(id)value 95 | { 96 | return value != nil; 97 | } 98 | 99 | @end 100 | 101 | 102 | 103 | #pragma mark - 104 | 105 | @implementation OCMIsNotEqualConstraint 106 | 107 | - (BOOL)evaluate:(id)value 108 | { 109 | return ![value isEqual:testValue]; 110 | } 111 | 112 | @end 113 | 114 | 115 | 116 | #pragma mark - 117 | 118 | @implementation OCMInvocationConstraint 119 | 120 | - (BOOL)evaluate:(id)value 121 | { 122 | [invocation setArgument:&value atIndex:2]; // should test if constraint takes arg 123 | [invocation invoke]; 124 | BOOL returnValue; 125 | [invocation getReturnValue:&returnValue]; 126 | return returnValue; 127 | } 128 | 129 | @end 130 | 131 | #pragma mark - 132 | 133 | @implementation OCMBlockConstraint 134 | 135 | - (instancetype)initWithConstraintBlock:(BOOL (^)(id))aBlock 136 | { 137 | self = [super init]; 138 | block = [aBlock copy]; 139 | return self; 140 | } 141 | 142 | - (void)dealloc { 143 | [block release]; 144 | [super dealloc]; 145 | } 146 | 147 | - (BOOL)evaluate:(id)value 148 | { 149 | return block(value); 150 | } 151 | 152 | 153 | @end 154 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMExceptionReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMReturnValueProvider.h" 18 | 19 | @interface OCMExceptionReturnValueProvider : OCMReturnValueProvider 20 | { 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMExceptionReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMExceptionReturnValueProvider.h" 18 | 19 | 20 | @implementation OCMExceptionReturnValueProvider 21 | 22 | - (void)handleInvocation:(NSInvocation *)anInvocation 23 | { 24 | @throw returnValue; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMExpectationRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMExpectationRecorder : OCMStubRecorder 20 | 21 | - (id)never; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMExpectationRecorder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMExpectationRecorder.h" 18 | #import "OCMInvocationExpectation.h" 19 | 20 | @implementation OCMExpectationRecorder 21 | 22 | #pragma mark Initialisers, description, accessors, etc. 23 | 24 | - (id)init 25 | { 26 | self = [super init]; 27 | [invocationMatcher release]; 28 | invocationMatcher = [[OCMInvocationExpectation alloc] init]; 29 | return self; 30 | } 31 | 32 | - (OCMInvocationExpectation *)expectation 33 | { 34 | return (OCMInvocationExpectation *)invocationMatcher; 35 | } 36 | 37 | 38 | #pragma mark Modifying the expectation 39 | 40 | - (id)never 41 | { 42 | [[self expectation] setMatchAndReject:YES]; 43 | return self; 44 | } 45 | 46 | 47 | #pragma mark Finishing recording 48 | 49 | - (void)forwardInvocation:(NSInvocation *)anInvocation 50 | { 51 | [super forwardInvocation:anInvocation]; 52 | [mockObject addExpectation:[self expectation]]; 53 | } 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMFunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCClassMockObject; 21 | @class OCPartialMockObject; 22 | 23 | 24 | BOOL OCMIsObjectType(const char *objCType); 25 | const char *OCMTypeWithoutQualifiers(const char *objCType); 26 | BOOL OCMEqualTypesAllowingOpaqueStructs(const char *type1, const char *type2); 27 | 28 | Class OCMCreateSubclass(Class class, void *ref); 29 | 30 | void OCMSetIsa(id object, Class class); 31 | Class OCMGetIsa(id object); 32 | 33 | BOOL OCMIsAliasSelector(SEL selector); 34 | SEL OCMAliasForOriginalSelector(SEL selector); 35 | SEL OCMOriginalSelectorForAlias(SEL selector); 36 | 37 | void OCMSetAssociatedMockForClass(OCClassMockObject *mock, Class aClass); 38 | OCClassMockObject *OCMGetAssociatedMockForClass(Class aClass, BOOL includeSuperclasses); 39 | 40 | void OCMSetAssociatedMockForObject(OCClassMockObject *mock, id anObject); 41 | OCPartialMockObject *OCMGetAssociatedMockForObject(id anObject); 42 | 43 | void OCMReportFailure(OCMLocation *loc, NSString *description); 44 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMIndirectReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMIndirectReturnValueProvider : NSObject 20 | { 21 | id provider; 22 | SEL selector; 23 | } 24 | 25 | - (id)initWithProvider:(id)aProvider andSelector:(SEL)aSelector; 26 | 27 | - (void)handleInvocation:(NSInvocation *)anInvocation; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMIndirectReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "NSMethodSignature+OCMAdditions.h" 18 | #import "OCMIndirectReturnValueProvider.h" 19 | 20 | 21 | @implementation OCMIndirectReturnValueProvider 22 | 23 | - (id)initWithProvider:(id)aProvider andSelector:(SEL)aSelector 24 | { 25 | self = [super init]; 26 | provider = [aProvider retain]; 27 | selector = aSelector; 28 | return self; 29 | } 30 | 31 | - (void)dealloc 32 | { 33 | [provider release]; 34 | [super dealloc]; 35 | } 36 | 37 | - (void)handleInvocation:(NSInvocation *)anInvocation 38 | { 39 | [anInvocation setTarget:provider]; 40 | [anInvocation setSelector:selector]; 41 | [anInvocation invoke]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMInvocationExpectation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMInvocationStub.h" 18 | 19 | @interface OCMInvocationExpectation : OCMInvocationStub 20 | { 21 | BOOL matchAndReject; 22 | BOOL isSatisfied; 23 | } 24 | 25 | - (void)setMatchAndReject:(BOOL)flag; 26 | - (BOOL)isMatchAndReject; 27 | 28 | - (BOOL)isSatisfied; 29 | 30 | @end -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMInvocationExpectation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMInvocationExpectation.h" 18 | #import "NSInvocation+OCMAdditions.h" 19 | 20 | 21 | @implementation OCMInvocationExpectation 22 | 23 | - (void)setMatchAndReject:(BOOL)flag 24 | { 25 | matchAndReject = flag; 26 | if(matchAndReject) 27 | isSatisfied = YES; 28 | } 29 | 30 | - (BOOL)isMatchAndReject 31 | { 32 | return matchAndReject; 33 | } 34 | 35 | - (BOOL)isSatisfied 36 | { 37 | return isSatisfied; 38 | } 39 | 40 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation 41 | { 42 | BOOL result = [super handleInvocation:anInvocation]; 43 | if(result) 44 | { 45 | isSatisfied = !matchAndReject; 46 | if(matchAndReject) 47 | { 48 | [NSException raise:NSInternalInconsistencyException format:@"%@: explicitly disallowed method invoked: %@", 49 | [self description], [anInvocation invocationDescription]]; 50 | } 51 | } 52 | return result; 53 | } 54 | 55 | @end -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMInvocationMatcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMInvocationMatcher : NSObject 20 | { 21 | NSInvocation *recordedInvocation; 22 | BOOL recordedAsClassMethod; 23 | BOOL ignoreNonObjectArgs; 24 | } 25 | 26 | - (void)setInvocation:(NSInvocation *)anInvocation; 27 | - (NSInvocation *)recordedInvocation; 28 | 29 | - (void)setRecordedAsClassMethod:(BOOL)flag; 30 | - (BOOL)recordedAsClassMethod; 31 | 32 | - (void)setIgnoreNonObjectArgs:(BOOL)flag; 33 | 34 | - (BOOL)matchesSelector:(SEL)aSelector; 35 | - (BOOL)matchesInvocation:(NSInvocation *)anInvocation; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMInvocationMatcher.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import 19 | #import 20 | #import "OCMPassByRefSetter.h" 21 | #import "NSInvocation+OCMAdditions.h" 22 | #import "OCMInvocationMatcher.h" 23 | #import "OCClassMockObject.h" 24 | #import "OCMFunctions.h" 25 | 26 | 27 | @interface NSObject(HCMatcherDummy) 28 | - (BOOL)matches:(id)item; 29 | @end 30 | 31 | 32 | @implementation OCMInvocationMatcher 33 | 34 | - (void)setInvocation:(NSInvocation *)anInvocation 35 | { 36 | [recordedInvocation release]; 37 | // When the method has a char* argument we do not retain the arguments. This makes it possible 38 | // to match char* args literally and with anyPointer. Not retaining the argument means that 39 | // in these cases tests that use their own autorelease pools may fail unexpectedly. 40 | if(![anInvocation hasCharPointerArgument]) 41 | [anInvocation retainArguments]; 42 | recordedInvocation = [anInvocation retain]; 43 | } 44 | 45 | - (void)setRecordedAsClassMethod:(BOOL)flag 46 | { 47 | recordedAsClassMethod = flag; 48 | } 49 | 50 | - (BOOL)recordedAsClassMethod 51 | { 52 | return recordedAsClassMethod; 53 | } 54 | 55 | - (void)setIgnoreNonObjectArgs:(BOOL)flag 56 | { 57 | ignoreNonObjectArgs = flag; 58 | } 59 | 60 | - (NSString *)description 61 | { 62 | return [recordedInvocation invocationDescription]; 63 | } 64 | 65 | - (NSInvocation *)recordedInvocation 66 | { 67 | return recordedInvocation; 68 | } 69 | 70 | - (BOOL)matchesSelector:(SEL)sel 71 | { 72 | if(sel == [recordedInvocation selector]) 73 | return YES; 74 | if(OCMIsAliasSelector(sel) && 75 | OCMOriginalSelectorForAlias(sel) == [recordedInvocation selector]) 76 | return YES; 77 | 78 | return NO; 79 | } 80 | 81 | - (BOOL)matchesInvocation:(NSInvocation *)anInvocation 82 | { 83 | id target = [anInvocation target]; 84 | BOOL isClassMethodInvocation = (target != nil) && (target == [target class]); 85 | if(isClassMethodInvocation != recordedAsClassMethod) 86 | return NO; 87 | 88 | if(![self matchesSelector:[anInvocation selector]]) 89 | return NO; 90 | 91 | NSMethodSignature *signature = [recordedInvocation methodSignature]; 92 | int n = (int)[signature numberOfArguments]; 93 | for(int i = 2; i < n; i++) 94 | { 95 | if(ignoreNonObjectArgs && strcmp([signature getArgumentTypeAtIndex:i], @encode(id))) 96 | { 97 | continue; 98 | } 99 | 100 | id recordedArg = [recordedInvocation getArgumentAtIndexAsObject:i]; 101 | id passedArg = [anInvocation getArgumentAtIndexAsObject:i]; 102 | 103 | if([recordedArg isProxy]) 104 | { 105 | if(![recordedArg isEqual:passedArg]) 106 | return NO; 107 | continue; 108 | } 109 | 110 | if([recordedArg isKindOfClass:[NSValue class]]) 111 | recordedArg = [OCMArg resolveSpecialValues:recordedArg]; 112 | 113 | if([recordedArg isKindOfClass:[OCMConstraint class]]) 114 | { 115 | if([recordedArg evaluate:passedArg] == NO) 116 | return NO; 117 | } 118 | else if([recordedArg isKindOfClass:[OCMPassByRefSetter class]]) 119 | { 120 | id valueToSet = [(OCMPassByRefSetter *)recordedArg value]; 121 | // side effect but easier to do here than in handleInvocation 122 | if(![valueToSet isKindOfClass:[NSValue class]]) 123 | *(id *)[passedArg pointerValue] = valueToSet; 124 | else 125 | [(NSValue *)valueToSet getValue:[passedArg pointerValue]]; 126 | } 127 | else if([recordedArg conformsToProtocol:objc_getProtocol("HCMatcher")]) 128 | { 129 | if([recordedArg matches:passedArg] == NO) 130 | return NO; 131 | } 132 | else 133 | { 134 | if(([recordedArg class] == [NSNumber class]) && 135 | ([(NSNumber*)recordedArg compare:(NSNumber*)passedArg] != NSOrderedSame)) 136 | return NO; 137 | if(([recordedArg isEqual:passedArg] == NO) && 138 | !((recordedArg == nil) && (passedArg == nil))) 139 | return NO; 140 | } 141 | } 142 | return YES; 143 | } 144 | @end 145 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMInvocationStub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMInvocationMatcher.h" 18 | 19 | @interface OCMInvocationStub : OCMInvocationMatcher 20 | { 21 | NSMutableArray *invocationActions; 22 | } 23 | 24 | - (void)addInvocationAction:(id)anAction; 25 | - (NSArray *)invocationActions; 26 | 27 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMInvocationStub.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMInvocationStub.h" 18 | 19 | @implementation OCMInvocationStub 20 | 21 | - (id)init 22 | { 23 | self = [super init]; 24 | invocationActions = [[NSMutableArray alloc] init]; 25 | return self; 26 | } 27 | 28 | - (void)dealloc 29 | { 30 | [invocationActions release]; 31 | [super dealloc]; 32 | } 33 | 34 | 35 | - (void)addInvocationAction:(id)anAction 36 | { 37 | [invocationActions addObject:anAction]; 38 | } 39 | 40 | - (NSArray *)invocationActions 41 | { 42 | return invocationActions; 43 | } 44 | 45 | 46 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation 47 | { 48 | if(![self matchesInvocation:anInvocation]) 49 | return NO; 50 | [invocationActions makeObjectsPerformSelector:@selector(handleInvocation:) withObject:anInvocation]; 51 | return YES; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMLocation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMLocation : NSObject 20 | { 21 | id testCase; 22 | NSString *file; 23 | NSUInteger line; 24 | } 25 | 26 | + (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 27 | 28 | - (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 29 | 30 | - (id)testCase; 31 | - (NSString *)file; 32 | - (NSUInteger)line; 33 | 34 | @end 35 | 36 | extern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); 37 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMLocation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMLocation.h" 18 | 19 | @implementation OCMLocation 20 | 21 | + (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine 22 | { 23 | return [[[OCMLocation alloc] initWithTestCase:aTestCase file:aFile line:aLine] autorelease]; 24 | } 25 | 26 | - (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine 27 | { 28 | self = [super init]; 29 | testCase = aTestCase; 30 | file = [aFile retain]; 31 | line = aLine; 32 | return self; 33 | } 34 | 35 | - (void)dealloc 36 | { 37 | [file release]; 38 | [super dealloc]; 39 | } 40 | 41 | - (id)testCase 42 | { 43 | return testCase; 44 | } 45 | 46 | - (NSString *)file 47 | { 48 | return file; 49 | } 50 | 51 | - (NSUInteger)line 52 | { 53 | return line; 54 | } 55 | 56 | @end 57 | 58 | 59 | OCMLocation *OCMMakeLocation(id testCase, const char *fileCString, int line) 60 | { 61 | return [OCMLocation locationWithTestCase:testCase file:[NSString stringWithUTF8String:fileCString] line:line]; 62 | } 63 | 64 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMMacroState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMRecorder; 21 | @class OCMStubRecorder; 22 | @class OCMockObject; 23 | 24 | 25 | @interface OCMMacroState : NSObject 26 | { 27 | OCMRecorder *recorder; 28 | } 29 | 30 | + (void)beginStubMacro; 31 | + (OCMStubRecorder *)endStubMacro; 32 | 33 | + (void)beginExpectMacro; 34 | + (OCMStubRecorder *)endExpectMacro; 35 | 36 | + (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; 37 | + (void)endVerifyMacro; 38 | 39 | + (OCMMacroState *)globalState; 40 | 41 | - (OCMRecorder *)recorder; 42 | 43 | - (void)switchToClassMethod; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMMacroState.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMMacroState.h" 18 | #import "OCMStubRecorder.h" 19 | #import "OCMockObject.h" 20 | #import "OCMExpectationRecorder.h" 21 | #import "OCMVerifier.h" 22 | #import "OCMInvocationMatcher.h" 23 | 24 | 25 | @implementation OCMMacroState 26 | 27 | OCMMacroState *globalState; 28 | 29 | #pragma mark Methods to begin/end macros 30 | 31 | + (void)beginStubMacro 32 | { 33 | OCMStubRecorder *recorder = [[[OCMStubRecorder alloc] init] autorelease]; 34 | globalState = [[[OCMMacroState alloc] initWithRecorder:recorder] autorelease]; 35 | } 36 | 37 | + (OCMStubRecorder *)endStubMacro 38 | { 39 | OCMStubRecorder *recorder = (OCMStubRecorder *)[globalState recorder]; 40 | globalState = nil; 41 | return recorder; 42 | } 43 | 44 | 45 | + (void)beginExpectMacro 46 | { 47 | OCMExpectationRecorder *recorder = [[[OCMExpectationRecorder alloc] init] autorelease]; 48 | globalState = [[[OCMMacroState alloc] initWithRecorder:recorder] autorelease]; 49 | } 50 | 51 | + (OCMStubRecorder *)endExpectMacro 52 | { 53 | return [self endStubMacro]; 54 | } 55 | 56 | 57 | + (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation 58 | { 59 | OCMVerifier *recorder = [[[OCMVerifier alloc] init] autorelease]; 60 | [recorder setLocation:aLocation]; 61 | globalState = [[[OCMMacroState alloc] initWithRecorder:recorder] autorelease]; 62 | } 63 | 64 | + (void)endVerifyMacro 65 | { 66 | globalState = nil; 67 | } 68 | 69 | 70 | #pragma mark Accessing global state 71 | 72 | + (OCMMacroState *)globalState 73 | { 74 | return globalState; 75 | } 76 | 77 | 78 | #pragma mark Init, dealloc, accessors 79 | 80 | - (id)initWithRecorder:(OCMRecorder *)aRecorder 81 | { 82 | self = [super init]; 83 | recorder = [aRecorder retain]; 84 | return self; 85 | } 86 | 87 | - (void)dealloc 88 | { 89 | [recorder release]; 90 | if(globalState == self) 91 | globalState = nil; 92 | [super dealloc]; 93 | } 94 | 95 | - (OCMRecorder *)recorder 96 | { 97 | return recorder; 98 | } 99 | 100 | 101 | #pragma mark Changing the recorder 102 | 103 | - (void)switchToClassMethod 104 | { 105 | [recorder classMethod]; 106 | } 107 | 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMNotificationPoster.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMNotificationPoster : NSObject 20 | { 21 | NSNotification *notification; 22 | } 23 | 24 | - (id)initWithNotification:(id)aNotification; 25 | 26 | - (void)handleInvocation:(NSInvocation *)anInvocation; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMNotificationPoster.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMNotificationPoster.h" 18 | 19 | 20 | @implementation OCMNotificationPoster 21 | 22 | - (id)initWithNotification:(id)aNotification 23 | { 24 | self = [super init]; 25 | notification = [aNotification retain]; 26 | return self; 27 | } 28 | 29 | - (void)dealloc 30 | { 31 | [notification release]; 32 | [super dealloc]; 33 | } 34 | 35 | - (void)handleInvocation:(NSInvocation *)anInvocation 36 | { 37 | [[NSNotificationCenter defaultCenter] postNotification:notification]; 38 | } 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMObserverRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMObserverRecorder : NSObject 20 | { 21 | NSNotification *recordedNotification; 22 | } 23 | 24 | - (void)notificationWithName:(NSString *)name object:(id)sender; 25 | 26 | - (BOOL)matchesNotification:(NSNotification *)aNotification; 27 | 28 | - (BOOL)argument:(id)expectedArg matchesArgument:(id)observedArg; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMObserverRecorder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import 19 | #import "NSInvocation+OCMAdditions.h" 20 | #import "OCMObserverRecorder.h" 21 | 22 | @interface NSObject(HCMatcherDummy) 23 | - (BOOL)matches:(id)item; 24 | @end 25 | 26 | #pragma mark - 27 | 28 | 29 | @implementation OCMObserverRecorder 30 | 31 | #pragma mark Initialisers, description, accessors, etc. 32 | 33 | - (void)dealloc 34 | { 35 | [recordedNotification release]; 36 | [super dealloc]; 37 | } 38 | 39 | 40 | #pragma mark Recording 41 | 42 | - (void)notificationWithName:(NSString *)name object:(id)sender 43 | { 44 | recordedNotification = [[NSNotification notificationWithName:name object:sender] retain]; 45 | } 46 | 47 | - (void)notificationWithName:(NSString *)name object:(id)sender userInfo:(NSDictionary *)userInfo 48 | { 49 | recordedNotification = [[NSNotification notificationWithName:name object:sender userInfo:userInfo] retain]; 50 | } 51 | 52 | 53 | #pragma mark Verification 54 | 55 | - (BOOL)matchesNotification:(NSNotification *)aNotification 56 | { 57 | return [self argument:[recordedNotification name] matchesArgument:[aNotification name]] && 58 | [self argument:[recordedNotification object] matchesArgument:[aNotification object]] && 59 | [self argument:[recordedNotification userInfo] matchesArgument:[aNotification userInfo]]; 60 | } 61 | 62 | - (BOOL)argument:(id)expectedArg matchesArgument:(id)observedArg 63 | { 64 | if([expectedArg isKindOfClass:[OCMConstraint class]]) 65 | { 66 | return [expectedArg evaluate:observedArg]; 67 | } 68 | else if([expectedArg conformsToProtocol:objc_getProtocol("HCMatcher")]) 69 | { 70 | return [expectedArg matches:observedArg]; 71 | } 72 | else if (expectedArg == observedArg) 73 | { 74 | return YES; 75 | } 76 | else if (expectedArg == nil || observedArg == nil) 77 | { 78 | return NO; 79 | } 80 | else 81 | { 82 | return [expectedArg isEqual:observedArg]; 83 | } 84 | } 85 | 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMPassByRefSetter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMPassByRefSetter : NSObject 20 | { 21 | id value; 22 | } 23 | 24 | - (id)initWithValue:(id)value; 25 | 26 | - (id)value; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMPassByRefSetter.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMPassByRefSetter.h" 18 | 19 | 20 | @implementation OCMPassByRefSetter 21 | 22 | - (id)initWithValue:(id)aValue 23 | { 24 | self = [super init]; 25 | value = [aValue retain]; 26 | return self; 27 | } 28 | 29 | - (void)dealloc 30 | { 31 | [value release]; 32 | [super dealloc]; 33 | } 34 | 35 | - (id)value 36 | { 37 | return value; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMRealObjectForwarder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMRealObjectForwarder : NSObject 20 | { 21 | } 22 | 23 | - (void)handleInvocation:(NSInvocation *)anInvocation; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMRealObjectForwarder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCPartialMockObject.h" 19 | #import "OCMRealObjectForwarder.h" 20 | #import "OCMFunctions.h" 21 | 22 | 23 | @implementation OCMRealObjectForwarder 24 | 25 | - (void)handleInvocation:(NSInvocation *)anInvocation 26 | { 27 | id invocationTarget = [anInvocation target]; 28 | 29 | [anInvocation setSelector:OCMAliasForOriginalSelector([anInvocation selector])]; 30 | if ([invocationTarget isProxy]) 31 | { 32 | if (class_getInstanceMethod([invocationTarget mockObjectClass], @selector(realObject))) 33 | { 34 | // the method has been invoked on the mock, we need to change the target to the real object 35 | [anInvocation setTarget:[(OCPartialMockObject *)invocationTarget realObject]]; 36 | } 37 | else 38 | { 39 | [NSException raise:NSInternalInconsistencyException 40 | format:@"Method andForwardToRealObject can only be used with partial mocks and class methods."]; 41 | } 42 | } 43 | 44 | [anInvocation invoke]; 45 | } 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMockObject; 20 | @class OCMInvocationMatcher; 21 | 22 | 23 | @interface OCMRecorder : NSProxy 24 | { 25 | OCMockObject *mockObject; 26 | OCMInvocationMatcher *invocationMatcher; 27 | } 28 | 29 | - (instancetype)init; 30 | - (instancetype)initWithMockObject:(OCMockObject *)aMockObject; 31 | 32 | - (void)setMockObject:(OCMockObject *)aMockObject; 33 | 34 | - (OCMInvocationMatcher *)invocationMatcher; 35 | 36 | - (id)classMethod; 37 | - (id)ignoringNonObjectArgs; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMRecorder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCMRecorder.h" 19 | #import "OCMockObject.h" 20 | #import "OCMInvocationMatcher.h" 21 | #import "OCClassMockObject.h" 22 | 23 | @implementation OCMRecorder 24 | 25 | - (instancetype)init 26 | { 27 | // no super, we're inheriting from NSProxy 28 | return self; 29 | } 30 | 31 | - (instancetype)initWithMockObject:(OCMockObject *)aMockObject 32 | { 33 | [self init]; 34 | [self setMockObject:aMockObject]; 35 | return self; 36 | } 37 | 38 | - (void)setMockObject:(OCMockObject *)aMockObject 39 | { 40 | mockObject = aMockObject; 41 | } 42 | 43 | - (void)dealloc 44 | { 45 | [invocationMatcher release]; 46 | [super dealloc]; 47 | } 48 | 49 | - (NSString *)description 50 | { 51 | return [invocationMatcher description]; 52 | } 53 | 54 | - (OCMInvocationMatcher *)invocationMatcher 55 | { 56 | return invocationMatcher; 57 | } 58 | 59 | 60 | #pragma mark Modifying the matcher 61 | 62 | - (id)classMethod 63 | { 64 | // should we handle the case where this is called with a mock that isn't a class mock? 65 | [invocationMatcher setRecordedAsClassMethod:YES]; 66 | return self; 67 | } 68 | 69 | - (id)ignoringNonObjectArgs 70 | { 71 | [invocationMatcher setIgnoreNonObjectArgs:YES]; 72 | return self; 73 | } 74 | 75 | 76 | #pragma mark Recording the actual invocation 77 | 78 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector 79 | { 80 | if([invocationMatcher recordedAsClassMethod]) 81 | return [[(OCClassMockObject *)mockObject mockedClass] methodSignatureForSelector:aSelector]; 82 | 83 | NSMethodSignature *signature = [mockObject methodSignatureForSelector:aSelector]; 84 | if(signature == nil) 85 | { 86 | // if we're a working with a class mock and there is a class method, auto-switch 87 | if(([object_getClass(mockObject) isSubclassOfClass:[OCClassMockObject class]]) && 88 | ([[(OCClassMockObject *)mockObject mockedClass] respondsToSelector:aSelector])) 89 | { 90 | [self classMethod]; 91 | signature = [self methodSignatureForSelector:aSelector]; 92 | } 93 | } 94 | return signature; 95 | } 96 | 97 | - (void)forwardInvocation:(NSInvocation *)anInvocation 98 | { 99 | [anInvocation setTarget:nil]; 100 | [invocationMatcher setInvocation:anInvocation]; 101 | } 102 | 103 | - (void)doesNotRecognizeSelector:(SEL)aSelector 104 | { 105 | [NSException raise:NSInvalidArgumentException format:@"%@: cannot stub/expect/verify method '%@' because no such method exists in the mocked class.", mockObject, NSStringFromSelector(aSelector)]; 106 | } 107 | 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMReturnValueProvider : NSObject 20 | { 21 | id returnValue; 22 | } 23 | 24 | - (instancetype)initWithValue:(id)aValue; 25 | 26 | - (void)handleInvocation:(NSInvocation *)anInvocation; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "NSMethodSignature+OCMAdditions.h" 18 | #import "OCMReturnValueProvider.h" 19 | #import "OCMFunctions.h" 20 | 21 | 22 | @implementation OCMReturnValueProvider 23 | 24 | - (instancetype)initWithValue:(id)aValue 25 | { 26 | self = [super init]; 27 | returnValue = [aValue retain]; 28 | return self; 29 | } 30 | 31 | - (void)dealloc 32 | { 33 | [returnValue release]; 34 | [super dealloc]; 35 | } 36 | 37 | - (void)handleInvocation:(NSInvocation *)anInvocation 38 | { 39 | if(!OCMIsObjectType([[anInvocation methodSignature] methodReturnType])) 40 | { 41 | @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Expected invocation with object return type. Did you mean to use andReturnValue: instead?" userInfo:nil]; 42 | } 43 | NSString *sel = NSStringFromSelector([anInvocation selector]); 44 | if([sel hasPrefix:@"alloc"] || [sel hasPrefix:@"new"] || [sel hasPrefix:@"copy"] || [sel hasPrefix:@"mutableCopy"]) 45 | { 46 | // methods that "create" an object return it with an extra retain count 47 | [returnValue retain]; 48 | } 49 | [anInvocation setReturnValue:&returnValue]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMStubRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMRecorder.h" 18 | 19 | 20 | @interface OCMStubRecorder : OCMRecorder 21 | 22 | - (id)andReturn:(id)anObject; 23 | - (id)andReturnValue:(NSValue *)aValue; 24 | - (id)andThrow:(NSException *)anException; 25 | - (id)andPost:(NSNotification *)aNotification; 26 | - (id)andCall:(SEL)selector onObject:(id)anObject; 27 | - (id)andDo:(void (^)(NSInvocation *invocation))block; 28 | - (id)andForwardToRealObject; 29 | 30 | @end 31 | 32 | 33 | @interface OCMStubRecorder (Properties) 34 | 35 | #define andReturn(aValue) _andReturn(({ __typeof__(aValue) _v = (aValue); [NSValue value:&_v withObjCType:@encode(__typeof__(_v))]; })) 36 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); 37 | 38 | #define andThrow(anException) _andThrow(anException) 39 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); 40 | 41 | #define andPost(aNotification) _andPost(aNotification) 42 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); 43 | 44 | #define andCall(anObject, aSelector) _andCall(anObject, aSelector) 45 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); 46 | 47 | #define andDo(aBlock) _andDo(aBlock) 48 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); 49 | 50 | #define andForwardToRealObject() _andForwardToRealObject() 51 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); 52 | 53 | @end 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMStubRecorder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMStubRecorder.h" 18 | #import "OCClassMockObject.h" 19 | #import "OCMReturnValueProvider.h" 20 | #import "OCMBoxedReturnValueProvider.h" 21 | #import "OCMExceptionReturnValueProvider.h" 22 | #import "OCMIndirectReturnValueProvider.h" 23 | #import "OCMNotificationPoster.h" 24 | #import "OCMBlockCaller.h" 25 | #import "OCMRealObjectForwarder.h" 26 | #import "OCMFunctions.h" 27 | #import "OCMInvocationStub.h" 28 | 29 | 30 | @implementation OCMStubRecorder 31 | 32 | #pragma mark Initialisers, description, accessors, etc. 33 | 34 | - (id)init 35 | { 36 | self = [super init]; 37 | invocationMatcher = [[OCMInvocationStub alloc] init]; 38 | return self; 39 | } 40 | 41 | - (OCMInvocationStub *)stub 42 | { 43 | return (OCMInvocationStub *)invocationMatcher; 44 | } 45 | 46 | 47 | #pragma mark Recording invocation actions 48 | 49 | - (id)andReturn:(id)anObject 50 | { 51 | [[self stub] addInvocationAction:[[[OCMReturnValueProvider alloc] initWithValue:anObject] autorelease]]; 52 | return self; 53 | } 54 | 55 | - (id)andReturnValue:(NSValue *)aValue 56 | { 57 | [[self stub] addInvocationAction:[[[OCMBoxedReturnValueProvider alloc] initWithValue:aValue] autorelease]]; 58 | return self; 59 | } 60 | 61 | - (id)andThrow:(NSException *)anException 62 | { 63 | [[self stub] addInvocationAction:[[[OCMExceptionReturnValueProvider alloc] initWithValue:anException] autorelease]]; 64 | return self; 65 | } 66 | 67 | - (id)andPost:(NSNotification *)aNotification 68 | { 69 | [[self stub] addInvocationAction:[[[OCMNotificationPoster alloc] initWithNotification:aNotification] autorelease]]; 70 | return self; 71 | } 72 | 73 | - (id)andCall:(SEL)selector onObject:(id)anObject 74 | { 75 | [[self stub] addInvocationAction:[[[OCMIndirectReturnValueProvider alloc] initWithProvider:anObject andSelector:selector] autorelease]]; 76 | return self; 77 | } 78 | 79 | - (id)andDo:(void (^)(NSInvocation *))aBlock 80 | { 81 | [[self stub] addInvocationAction:[[[OCMBlockCaller alloc] initWithCallBlock:aBlock] autorelease]]; 82 | return self; 83 | } 84 | 85 | - (id)andForwardToRealObject 86 | { 87 | [[self stub] addInvocationAction:[[[OCMRealObjectForwarder alloc] init] autorelease]]; 88 | return self; 89 | } 90 | 91 | 92 | #pragma mark Finishing recording 93 | 94 | - (void)forwardInvocation:(NSInvocation *)anInvocation 95 | { 96 | [super forwardInvocation:anInvocation]; 97 | [mockObject addStub:[self stub]]; 98 | } 99 | 100 | 101 | @end 102 | 103 | 104 | @implementation OCMStubRecorder (Properties) 105 | 106 | @dynamic _andReturn; 107 | 108 | - (OCMStubRecorder *(^)(NSValue *))_andReturn 109 | { 110 | id (^theBlock)(id) = ^ (NSValue *aValue) 111 | { 112 | if(OCMIsObjectType([aValue objCType])) 113 | { 114 | NSValue *objValue = nil; 115 | [aValue getValue:&objValue]; 116 | return [self andReturn:objValue]; 117 | } 118 | else 119 | { 120 | return [self andReturnValue:aValue]; 121 | } 122 | }; 123 | return [[theBlock copy] autorelease]; 124 | } 125 | 126 | 127 | @dynamic _andThrow; 128 | 129 | - (OCMStubRecorder *(^)(NSException *))_andThrow 130 | { 131 | id (^theBlock)(id) = ^ (NSException * anException) 132 | { 133 | return [self andThrow:anException]; 134 | }; 135 | return [[theBlock copy] autorelease]; 136 | } 137 | 138 | 139 | @dynamic _andPost; 140 | 141 | - (OCMStubRecorder *(^)(NSNotification *))_andPost 142 | { 143 | id (^theBlock)(id) = ^ (NSNotification * aNotification) 144 | { 145 | return [self andPost:aNotification]; 146 | }; 147 | return [[theBlock copy] autorelease]; 148 | } 149 | 150 | 151 | @dynamic _andCall; 152 | 153 | - (OCMStubRecorder *(^)(id, SEL))_andCall 154 | { 155 | id (^theBlock)(id, SEL) = ^ (id anObject, SEL aSelector) 156 | { 157 | return [self andCall:aSelector onObject:anObject]; 158 | }; 159 | return [[theBlock copy] autorelease]; 160 | } 161 | 162 | 163 | @dynamic _andDo; 164 | 165 | - (OCMStubRecorder *(^)(void (^)(NSInvocation *)))_andDo 166 | { 167 | id (^theBlock)(void (^)(NSInvocation *)) = ^ (void (^ blockToCall)(NSInvocation *)) 168 | { 169 | return [self andDo:blockToCall]; 170 | }; 171 | return [[theBlock copy] autorelease]; 172 | } 173 | 174 | 175 | @dynamic _andForwardToRealObject; 176 | 177 | - (OCMStubRecorder *(^)(void))_andForwardToRealObject 178 | { 179 | id (^theBlock)(void) = ^ (void) 180 | { 181 | return [self andForwardToRealObject]; 182 | }; 183 | return [[theBlock copy] autorelease]; 184 | } 185 | 186 | 187 | @end 188 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMVerifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMRecorder.h" 18 | #import "OCMLocation.h" 19 | 20 | 21 | @interface OCMVerifier : OCMRecorder 22 | 23 | @property(retain) OCMLocation *location; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMVerifier.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCMVerifier.h" 19 | #import "OCMockObject.h" 20 | #import "OCMLocation.h" 21 | #import "OCMInvocationMatcher.h" 22 | 23 | 24 | @implementation OCMVerifier 25 | 26 | - (id)init 27 | { 28 | self = [super init]; 29 | invocationMatcher = [[OCMInvocationMatcher alloc] init]; 30 | return self; 31 | } 32 | 33 | - (void)forwardInvocation:(NSInvocation *)anInvocation 34 | { 35 | [super forwardInvocation:anInvocation]; 36 | [mockObject verifyInvocation:invocationMatcher atLocation:self.location]; 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | 26 | 27 | #define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] 28 | 29 | #define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] 30 | 31 | #define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] 32 | 33 | #define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] 34 | 35 | #define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] 36 | 37 | #define OCMObserverMock() [OCMockObject observerMock] 38 | 39 | 40 | #define OCMStub(invocation) \ 41 | ({ \ 42 | _OCMSilenceWarnings( \ 43 | [OCMMacroState beginStubMacro]; \ 44 | invocation; \ 45 | [OCMMacroState endStubMacro]; \ 46 | ); \ 47 | }) 48 | 49 | #define OCMExpect(invocation) \ 50 | ({ \ 51 | _OCMSilenceWarnings( \ 52 | [OCMMacroState beginExpectMacro]; \ 53 | invocation; \ 54 | [OCMMacroState endExpectMacro]; \ 55 | ); \ 56 | }) 57 | 58 | #define ClassMethod(invocation) \ 59 | _OCMSilenceWarnings( \ 60 | [[OCMMacroState globalState] switchToClassMethod]; \ 61 | invocation; \ 62 | ); 63 | 64 | 65 | #define OCMVerifyAll(mock) [mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] 66 | 67 | #define OCMVerifyAllWithDelay(mock, delay) [mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] 68 | 69 | #define OCMVerify(invocation) \ 70 | ({ \ 71 | _OCMSilenceWarnings( \ 72 | [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ 73 | invocation; \ 74 | [OCMMacroState endVerifyMacro]; \ 75 | ); \ 76 | }) 77 | 78 | #define _OCMSilenceWarnings(macro) \ 79 | ({ \ 80 | _Pragma("clang diagnostic push") \ 81 | _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ 82 | macro \ 83 | _Pragma("clang diagnostic pop") \ 84 | }) 85 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMInvocationStub; 21 | @class OCMStubRecorder; 22 | @class OCMInvocationMatcher; 23 | @class OCMInvocationExpectation; 24 | 25 | 26 | @interface OCMockObject : NSProxy 27 | { 28 | BOOL isNice; 29 | BOOL expectationOrderMatters; 30 | NSMutableArray *stubs; 31 | NSMutableArray *expectations; 32 | NSMutableArray *exceptions; 33 | NSMutableArray *invocations; 34 | } 35 | 36 | + (id)mockForClass:(Class)aClass; 37 | + (id)mockForProtocol:(Protocol *)aProtocol; 38 | + (id)partialMockForObject:(NSObject *)anObject; 39 | 40 | + (id)niceMockForClass:(Class)aClass; 41 | + (id)niceMockForProtocol:(Protocol *)aProtocol; 42 | 43 | + (id)observerMock; 44 | 45 | - (instancetype)init; 46 | 47 | - (void)setExpectationOrderMatters:(BOOL)flag; 48 | 49 | - (id)stub; 50 | - (id)expect; 51 | - (id)reject; 52 | 53 | - (id)verify; 54 | - (id)verifyAtLocation:(OCMLocation *)location; 55 | 56 | - (void)verifyWithDelay:(NSTimeInterval)delay; 57 | - (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; 58 | 59 | - (void)stopMocking; 60 | 61 | // internal use only 62 | 63 | - (void)addStub:(OCMInvocationStub *)aStub; 64 | - (void)addExpectation:(OCMInvocationExpectation *)anExpectation; 65 | 66 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation; 67 | - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; 68 | - (BOOL)handleSelector:(SEL)sel; 69 | 70 | - (void)verifyInvocation:(OCMInvocationMatcher *)matcher; 71 | - (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; 72 | 73 | @end 74 | 75 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCObserverMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | 21 | 22 | @interface OCObserverMockObject : NSObject 23 | { 24 | BOOL expectationOrderMatters; 25 | NSMutableArray *recorders; 26 | NSMutableArray *centers; 27 | } 28 | 29 | - (void)setExpectationOrderMatters:(BOOL)flag; 30 | 31 | - (id)expect; 32 | 33 | - (void)verify; 34 | - (void)verifyAtLocation:(OCMLocation *)location; 35 | 36 | - (void)handleNotification:(NSNotification *)aNotification; 37 | 38 | // internal use 39 | 40 | - (void)autoRemoveFromCenter:(NSNotificationCenter *)aCenter; 41 | - (void)notificationWithName:(NSString *)name object:(id)sender; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCObserverMockObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCObserverMockObject.h" 18 | #import "OCMObserverRecorder.h" 19 | #import "OCMLocation.h" 20 | #import "OCMFunctions.h" 21 | 22 | 23 | @implementation OCObserverMockObject 24 | 25 | #pragma mark Initialisers, description, accessors, etc. 26 | 27 | - (id)init 28 | { 29 | self = [super init]; 30 | recorders = [[NSMutableArray alloc] init]; 31 | centers = [[NSMutableArray alloc] init]; 32 | return self; 33 | } 34 | 35 | - (id)retain 36 | { 37 | return [super retain]; 38 | } 39 | 40 | - (void)dealloc 41 | { 42 | for(NSNotificationCenter *c in centers) 43 | [c removeObserver:self]; 44 | [centers release]; 45 | [recorders release]; 46 | [super dealloc]; 47 | } 48 | 49 | - (NSString *)description 50 | { 51 | return @"OCMockObserver"; 52 | } 53 | 54 | - (void)setExpectationOrderMatters:(BOOL)flag 55 | { 56 | expectationOrderMatters = flag; 57 | } 58 | 59 | - (void)autoRemoveFromCenter:(NSNotificationCenter *)aCenter 60 | { 61 | [centers addObject:aCenter]; 62 | } 63 | 64 | 65 | #pragma mark Public API 66 | 67 | - (id)expect 68 | { 69 | OCMObserverRecorder *recorder = [[[OCMObserverRecorder alloc] init] autorelease]; 70 | [recorders addObject:recorder]; 71 | return recorder; 72 | } 73 | 74 | - (void)verify 75 | { 76 | [self verifyAtLocation:nil]; 77 | } 78 | 79 | - (void)verifyAtLocation:(OCMLocation *)location 80 | { 81 | if([recorders count] == 1) 82 | { 83 | NSString *description = [NSString stringWithFormat:@"%@: expected notification was not observed: %@", 84 | [self description], [[recorders lastObject] description]]; 85 | OCMReportFailure(location, description); 86 | } 87 | else if([recorders count] > 0) 88 | { 89 | NSString *description = [NSString stringWithFormat:@"%@ : %@ expected notifications were not observed.", 90 | [self description], @([recorders count])]; 91 | OCMReportFailure(location, description); 92 | } 93 | } 94 | 95 | 96 | #pragma mark Receiving recording requests via macro 97 | 98 | - (void)notificationWithName:(NSString *)name object:(id)sender 99 | { 100 | [[self expect] notificationWithName:name object:sender]; 101 | } 102 | 103 | 104 | #pragma mark Receiving notifications 105 | 106 | - (void)handleNotification:(NSNotification *)aNotification 107 | { 108 | NSUInteger i, limit; 109 | 110 | limit = expectationOrderMatters ? 1 : [recorders count]; 111 | for(i = 0; i < limit; i++) 112 | { 113 | if([[recorders objectAtIndex:i] matchesNotification:aNotification]) 114 | { 115 | [recorders removeObjectAtIndex:i]; 116 | return; 117 | } 118 | } 119 | [NSException raise:NSInternalInconsistencyException format:@"%@: unexpected notification observed: %@", [self description], 120 | [aNotification description]]; 121 | } 122 | 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCPartialMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCClassMockObject.h" 18 | 19 | @interface OCPartialMockObject : OCClassMockObject 20 | { 21 | NSObject *realObject; 22 | } 23 | 24 | - (id)initWithObject:(NSObject *)anObject; 25 | 26 | - (NSObject *)realObject; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCProtocolMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCProtocolMockObject : OCMockObject 20 | { 21 | Protocol *mockedProtocol; 22 | } 23 | 24 | - (id)initWithProtocol:(Protocol *)aProtocol; 25 | 26 | @end 27 | 28 | -------------------------------------------------------------------------------- /Demo/Pods/OCMock/Source/OCMock/OCProtocolMockObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2014 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "NSMethodSignature+OCMAdditions.h" 19 | #import "OCProtocolMockObject.h" 20 | 21 | @implementation OCProtocolMockObject 22 | 23 | #pragma mark Initialisers, description, accessors, etc. 24 | 25 | - (id)initWithProtocol:(Protocol *)aProtocol 26 | { 27 | [super init]; 28 | mockedProtocol = aProtocol; 29 | return self; 30 | } 31 | 32 | - (NSString *)description 33 | { 34 | const char* name = protocol_getName(mockedProtocol); 35 | return [NSString stringWithFormat:@"OCMockObject(%s)", name]; 36 | } 37 | 38 | #pragma mark Proxy API 39 | 40 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector 41 | { 42 | struct { BOOL isRequired; BOOL isInstance; } opts[4] = { {YES, YES}, {NO, YES}, {YES, NO}, {NO, NO} }; 43 | for(int i = 0; i < 4; i++) 44 | { 45 | struct objc_method_description methodDescription = protocol_getMethodDescription(mockedProtocol, aSelector, opts[i].isRequired, opts[i].isInstance); 46 | if(methodDescription.name != NULL) 47 | return [NSMethodSignature signatureWithObjCTypes:methodDescription.types]; 48 | } 49 | return nil; 50 | } 51 | 52 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol 53 | { 54 | return protocol_conformsToProtocol(mockedProtocol, aProtocol); 55 | } 56 | 57 | - (BOOL)respondsToSelector:(SEL)selector 58 | { 59 | return ([self methodSignatureForSelector:selector] != nil); 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests-MMProgressHUD/Pods-LogicTests-MMProgressHUD-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-LogicTests-MMProgressHUD.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MMProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MMProgressHUD" "${PODS_ROOT}/Headers/Public/OCMock" 4 | OTHER_LDFLAGS = ${PODS_LOGICTESTS_MMPROGRESSHUD_OTHER_LDFLAGS} -ObjC 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests-MMProgressHUD/Pods-LogicTests-MMProgressHUD-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LogicTests_MMProgressHUD : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LogicTests_MMProgressHUD 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests-MMProgressHUD/Pods-LogicTests-MMProgressHUD-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-LogicTests-environment.h" 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests-MMProgressHUD/Pods-LogicTests-MMProgressHUD.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_LOGICTESTS_MMPROGRESSHUD_OTHER_LDFLAGS = -framework "CoreGraphics" -framework "QuartzCore" -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests-OCMock/Pods-LogicTests-OCMock-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-LogicTests-OCMock.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OCMock" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MMProgressHUD" "${PODS_ROOT}/Headers/Public/OCMock" 4 | OTHER_LDFLAGS = -ObjC 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests-OCMock/Pods-LogicTests-OCMock-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LogicTests_OCMock : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LogicTests_OCMock 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests-OCMock/Pods-LogicTests-OCMock-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-LogicTests-environment.h" 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests-OCMock/Pods-LogicTests-OCMock.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/Pods/Target Support Files/Pods-LogicTests-OCMock/Pods-LogicTests-OCMock.xcconfig -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests/Pods-LogicTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LogicTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LogicTests 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests/Pods-LogicTests-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // MMProgressHUD 10 | #define COCOAPODS_POD_AVAILABLE_MMProgressHUD 11 | #define COCOAPODS_VERSION_MAJOR_MMProgressHUD 0 12 | #define COCOAPODS_VERSION_MINOR_MMProgressHUD 3 13 | #define COCOAPODS_VERSION_PATCH_MMProgressHUD 0 14 | 15 | // OCMock 16 | #define COCOAPODS_POD_AVAILABLE_OCMock 17 | #define COCOAPODS_VERSION_MAJOR_OCMock 3 18 | #define COCOAPODS_VERSION_MINOR_OCMock 1 19 | #define COCOAPODS_VERSION_PATCH_OCMock 2 20 | 21 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests/Pods-LogicTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY=$(cd "${1%/*}" && pwd) 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | if [[ "${ACTION}" == "install" ]]; then 63 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 64 | fi 65 | rm -f "$RESOURCES_TO_COPY" 66 | 67 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 68 | then 69 | case "${TARGETED_DEVICE_FAMILY}" in 70 | 1,2) 71 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 72 | ;; 73 | 1) 74 | TARGET_DEVICE_ARGS="--target-device iphone" 75 | ;; 76 | 2) 77 | TARGET_DEVICE_ARGS="--target-device ipad" 78 | ;; 79 | *) 80 | TARGET_DEVICE_ARGS="--target-device mac" 81 | ;; 82 | esac 83 | 84 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 85 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 86 | while read line; do 87 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 88 | XCASSET_FILES+=("$line") 89 | fi 90 | done <<<"$OTHER_XCASSETS" 91 | 92 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 93 | fi 94 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests/Pods-LogicTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MMProgressHUD" "${PODS_ROOT}/Headers/Public/OCMock" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MMProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/OCMock" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-LogicTests-MMProgressHUD" -l"Pods-LogicTests-OCMock" -framework "CoreGraphics" -framework "QuartzCore" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-LogicTests/Pods-LogicTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MMProgressHUD" "${PODS_ROOT}/Headers/Public/OCMock" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MMProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/OCMock" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-LogicTests-MMProgressHUD" -l"Pods-LogicTests-OCMock" -framework "CoreGraphics" -framework "QuartzCore" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-MMProgressHUD/Pods-MMProgressHUD-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-MMProgressHUD.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MMProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MMProgressHUD" "${PODS_ROOT}/Headers/Public/OCMock" 4 | OTHER_LDFLAGS = ${PODS_MMPROGRESSHUD_OTHER_LDFLAGS} -ObjC 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-MMProgressHUD/Pods-MMProgressHUD-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MMProgressHUD : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MMProgressHUD 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-MMProgressHUD/Pods-MMProgressHUD-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-MMProgressHUD/Pods-MMProgressHUD.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_MMPROGRESSHUD_OTHER_LDFLAGS = -framework "CoreGraphics" -framework "QuartzCore" -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MMProgressHUD 5 | 6 | Copyright (c) 2012-2013 Mutual Mobile 7 | 8 | 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: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 11 | 12 | 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. 13 | Generated by CocoaPods - http://cocoapods.org 14 | -------------------------------------------------------------------------------- /Demo/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-2013 Mutual Mobile 18 | 19 | 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: 20 | 21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 22 | 23 | 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. 24 | Title 25 | MMProgressHUD 26 | Type 27 | PSGroupSpecifier 28 | 29 | 30 | FooterText 31 | Generated by CocoaPods - http://cocoapods.org 32 | Title 33 | 34 | Type 35 | PSGroupSpecifier 36 | 37 | 38 | StringsTable 39 | Acknowledgements 40 | Title 41 | Acknowledgements 42 | 43 | 44 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // MMProgressHUD 10 | #define COCOAPODS_POD_AVAILABLE_MMProgressHUD 11 | #define COCOAPODS_VERSION_MAJOR_MMProgressHUD 0 12 | #define COCOAPODS_VERSION_MINOR_MMProgressHUD 3 13 | #define COCOAPODS_VERSION_PATCH_MMProgressHUD 0 14 | 15 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY=$(cd "${1%/*}" && pwd) 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | if [[ "${ACTION}" == "install" ]]; then 63 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 64 | fi 65 | rm -f "$RESOURCES_TO_COPY" 66 | 67 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 68 | then 69 | case "${TARGETED_DEVICE_FAMILY}" in 70 | 1,2) 71 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 72 | ;; 73 | 1) 74 | TARGET_DEVICE_ARGS="--target-device iphone" 75 | ;; 76 | 2) 77 | TARGET_DEVICE_ARGS="--target-device ipad" 78 | ;; 79 | *) 80 | TARGET_DEVICE_ARGS="--target-device mac" 81 | ;; 82 | esac 83 | 84 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 85 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 86 | while read line; do 87 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 88 | XCASSET_FILES+=("$line") 89 | fi 90 | done <<<"$OTHER_XCASSETS" 91 | 92 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 93 | fi 94 | -------------------------------------------------------------------------------- /Demo/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/MMProgressHUD" "${PODS_ROOT}/Headers/Public/OCMock" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MMProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/OCMock" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-MMProgressHUD" -framework "CoreGraphics" -framework "QuartzCore" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Demo/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/MMProgressHUD" "${PODS_ROOT}/Headers/Public/OCMock" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MMProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/OCMock" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-MMProgressHUD" -framework "CoreGraphics" -framework "QuartzCore" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Demo/Run Cycle 1/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/Run Cycle 1/1.png -------------------------------------------------------------------------------- /Demo/Run Cycle 1/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/Run Cycle 1/2.png -------------------------------------------------------------------------------- /Demo/Run Cycle 1/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/Run Cycle 1/3.png -------------------------------------------------------------------------------- /Demo/Run Cycle 1/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/Run Cycle 1/4.png -------------------------------------------------------------------------------- /Demo/Run Cycle 1/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/Run Cycle 1/5.png -------------------------------------------------------------------------------- /Demo/Run Cycle 1/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/Run Cycle 1/6.png -------------------------------------------------------------------------------- /Demo/VisualDemos/MMP3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/VisualDemos/MMP3.gif -------------------------------------------------------------------------------- /Demo/VisualDemos/mmprogresshud_200_animations.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/VisualDemos/mmprogresshud_200_animations.gif -------------------------------------------------------------------------------- /Demo/VisualDemos/mmprogresshud_200_overlays.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/VisualDemos/mmprogresshud_200_overlays.gif -------------------------------------------------------------------------------- /Demo/VisualDemos/mmprogresshud_200_visuals.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/VisualDemos/mmprogresshud_200_visuals.gif -------------------------------------------------------------------------------- /Demo/VisualDemos/mmprogresshud_320_animations.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/VisualDemos/mmprogresshud_320_animations.gif -------------------------------------------------------------------------------- /Demo/VisualDemos/mmprogresshud_320_overlays.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/VisualDemos/mmprogresshud_320_overlays.gif -------------------------------------------------------------------------------- /Demo/VisualDemos/mmprogresshud_320_visuals.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mutualmobile/MMProgressHUD/c2eb2e03c298ea3801af717b038971032f7a3d31/Demo/VisualDemos/mmprogresshud_320_visuals.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013 Mutual Mobile 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. -------------------------------------------------------------------------------- /MMProgressHUD.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "MMProgressHUD" 3 | s.version = "0.3.2" 4 | s.summary = "An easy to use HUD interface with personality." 5 | s.homepage = "https://github.com/mutualmobile/MMProgressHUD" 6 | s.license = 'MIT' 7 | s.author = { "Lars Anderson" => "lars.anderson@mutualmobile.com" } 8 | s.source = { 9 | :git => "https://github.com/mutualmobile/MMProgressHUD.git", 10 | :tag => s.version.to_s 11 | } 12 | s.platform = :ios, '5.0' 13 | s.source_files = 'Source/*.{h,m}' 14 | s.public_header_files = 'Source/{MMProgressHUDOverlayView,MMProgressHUD,MMHud,MMProgressView-Protocol,MMRadialProgressView,MMLinearProgressView,MMVectorImage}.h' 15 | s.frameworks = 'QuartzCore', 'CoreGraphics' 16 | s.requires_arc = true 17 | end 18 | -------------------------------------------------------------------------------- /Source/MMLinearProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMLinearProgressView.h 3 | // MMProgressHUD 4 | // 5 | // Created by Jonas Gessner on 04.08.13. 6 | // Copyright (c) 2012 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MMProgressView-Protocol.h" 11 | 12 | @interface MMLinearProgressView : UIView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/MMLinearProgressView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMLinearProgressView.m 3 | // MMProgressHUD 4 | // 5 | // Created by Jonas Gessner on 04.08.13. 6 | // Copyright (c) 2012 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "MMLinearProgressView.h" 10 | #import 11 | 12 | @interface MMLinearProgressLayer : CALayer 13 | @property (nonatomic) CGFloat progress; 14 | @end 15 | 16 | @implementation MMLinearProgressLayer 17 | 18 | @dynamic progress; 19 | 20 | - (id)initWithLayer:(id)layer{ 21 | self = [super initWithLayer:layer]; 22 | if (self) { 23 | if ([layer isKindOfClass:[MMLinearProgressLayer class]]) { 24 | MMLinearProgressLayer *layerToCopy = (MMLinearProgressLayer *)layer; 25 | self.progress = layerToCopy.progress; 26 | } 27 | } 28 | return self; 29 | } 30 | 31 | +(BOOL)needsDisplayForKey:(NSString *)key { 32 | return [key isEqualToString:@"progress"] || [super needsDisplayForKey:key]; 33 | } 34 | 35 | - (id)actionForKey:(NSString *)key { 36 | if ([key isEqualToString:@"progress"]) { 37 | CABasicAnimation *progressAnimation = [CABasicAnimation animation]; 38 | progressAnimation.fromValue = [self.presentationLayer valueForKey:key]; 39 | progressAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 40 | return progressAnimation; 41 | } 42 | 43 | return [super actionForKey:key]; 44 | } 45 | 46 | - (void)drawInContext:(CGContextRef)ctx { 47 | UIGraphicsPushContext(ctx); 48 | 49 | CGRect rect = CGRectInset(self.bounds, 1.0f, 1.0f); 50 | 51 | CGFloat radius = roundf(0.5f*(rect.size.height)); 52 | 53 | CGContextSetAllowsAntialiasing(ctx, TRUE); 54 | 55 | [[UIColor whiteColor] set]; 56 | 57 | UIBezierPath *stroker = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:radius]; 58 | 59 | [stroker setLineWidth:2.0f]; 60 | [stroker stroke]; 61 | 62 | // draw the inside moving filled rounded rectangle 63 | rect = CGRectInset(rect, 3.0f, 3.0f); 64 | radius = 0.5f * rect.size.height; 65 | 66 | // make sure the filled rounded rectangle is not smaller than 2 times the radius 67 | rect.size.width *= self.progress; 68 | if (rect.size.width < 2 * radius) { 69 | rect.size.width = 2 * radius; 70 | } 71 | 72 | UIBezierPath *filler = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:radius]; 73 | [filler setLineWidth:2.0f]; 74 | [filler fill]; 75 | 76 | UIGraphicsPopContext(); 77 | } 78 | 79 | @end 80 | 81 | 82 | @implementation MMLinearProgressView 83 | 84 | + (CGSize)sizeThatFitsSize:(CGSize)defaultSize maximumAvailableSize:(CGSize)totalAvailableSize { 85 | float aspectRatio = (11.0f/140.0f); 86 | CGFloat expectedHeight = roundf(totalAvailableSize.width*aspectRatio); 87 | if (expectedHeight > totalAvailableSize.height) { 88 | return CGSizeMake(roundf(totalAvailableSize.width/aspectRatio), totalAvailableSize.height); 89 | } 90 | else { 91 | return CGSizeMake(totalAvailableSize.width, roundf(totalAvailableSize.width*aspectRatio)); 92 | } 93 | } 94 | 95 | + (Class)layerClass { 96 | return [MMLinearProgressLayer class]; 97 | } 98 | 99 | - (instancetype)initWithFrame:(CGRect)frame { 100 | if ((self = [super initWithFrame:frame])) { 101 | self.backgroundColor = [UIColor clearColor]; 102 | self.layer.contentsScale = [[UIScreen mainScreen] scale];//set this or have fuzzy drawing on retina 103 | [self.layer setNeedsDisplay];//immediately draw empty circle 104 | } 105 | return self; 106 | } 107 | 108 | - (void)setProgress:(CGFloat)progress { 109 | [self setProgress:progress animated:NO]; 110 | } 111 | 112 | - (void)setProgress:(CGFloat)progress animated:(BOOL)animated { 113 | [self setProgress:progress animated:animated withCompletion:nil]; 114 | } 115 | 116 | - (void)setProgress:(CGFloat)progress animated:(BOOL)animated withCompletion:(void(^)(BOOL completed))completion { 117 | [CATransaction begin]; 118 | [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; 119 | if (animated == NO) { 120 | [CATransaction setDisableActions:YES]; 121 | } 122 | 123 | [CATransaction setCompletionBlock:^{ 124 | if (completion) { 125 | completion(YES); 126 | } 127 | }]; 128 | 129 | [((MMLinearProgressLayer *)self.layer) setProgress:progress]; 130 | 131 | [CATransaction commit]; 132 | } 133 | 134 | - (CGFloat)progress { 135 | return [((MMLinearProgressLayer *)self.layer) progress]; 136 | } 137 | 138 | @end 139 | -------------------------------------------------------------------------------- /Source/MMProgressHUD+Animations.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressHUD+Animations.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 7/2/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import "MMProgressHUD.h" 10 | 11 | @class CAAnimationGroup; 12 | @class CAAnimation; 13 | 14 | @interface MMProgressHUD (Animations) 15 | 16 | - (CAAnimationGroup *)_glowAnimation; 17 | - (void)_beginGlowAnimation; 18 | - (void)_endGlowAnimation; 19 | - (void)_dismissWithDropAnimation; 20 | - (void)_dismissWithExpandAnimation; 21 | - (void)_dismissWithShrinkAnimation; 22 | - (void)_dismissWithSwingLeftAnimation; 23 | - (void)_dismissWithSwingRightAnimation; 24 | - (void)_dismissWithBalloonAnimation; 25 | - (void)_dismissWithFadeAnimation; 26 | - (void)_showWithDropAnimation; 27 | - (void)_showWithExpandAnimation; 28 | - (void)_showWithShrinkAnimation; 29 | - (void)_showWithSwingInAnimationFromLeft:(BOOL)left; 30 | - (void)_showWithBalloonAnimation; 31 | - (void)_showWithFadeAnimation; 32 | 33 | - (void)_executeShowAnimation:(CAAnimation *)animation; 34 | - (void)_executeDismissAnimation:(CAAnimation *)animation; 35 | 36 | @property (nonatomic, retain, readwrite) CAAnimation *queuedDismissAnimation; 37 | @property (nonatomic, retain, readwrite) CAAnimation *queuedShowAnimation; 38 | @property (nonatomic, readwrite, getter = isVisible) BOOL visible; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Source/MMProgressHUDCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMCommonHeader.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 10/5/13. 6 | // Copyright (c) 2013 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #ifndef MM_PROGRESS_HUD_COMMON_H 10 | #define MM_PROGRESS_HUD_COMMON_H 11 | #ifdef DEBUG 12 | #ifdef MM_HUD_DEBUG 13 | #define MMHudLog(fmt, ...) NSLog((@"%@ [line %u]: " fmt), NSStringFromClass(self.class), __LINE__, ##__VA_ARGS__) 14 | #else 15 | #define MMHudLog(...) /* */ 16 | #endif 17 | #else 18 | #define MMHudLog(...) /* */ 19 | #endif 20 | 21 | #define MMHudWLog(fmt, ...) NSLog((@"%@ WARNING [line %u]: " fmt), NSStringFromClass(self.class), __LINE__, ##__VA_ARGS__) 22 | 23 | #ifdef __cplusplus 24 | #define MMExtern extern "C" 25 | #else 26 | #define MMExtern extern 27 | #endif 28 | 29 | #endif// MM_PROGRESS_HUD_COMMON_H 30 | -------------------------------------------------------------------------------- /Source/MMProgressHUDOverlayView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressHUDOverlayView.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 7/5/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MMProgressHUD.h" 11 | 12 | @interface MMProgressHUDOverlayView : UIView 13 | 14 | /** The style of the overlay. */ 15 | @property (nonatomic) MMProgressHUDWindowOverlayMode overlayMode; 16 | 17 | /** The color for the overlay. This color will be used in both the linear and gradient overlay modes. */ 18 | @property (nonatomic) CGColorRef overlayColor; 19 | 20 | /** Init a new overlay view with the specified frame and overlayMode. 21 | 22 | @param frame The frame of the overlayView. 23 | @param overlayMode The style of the overlay. 24 | */ 25 | - (instancetype)initWithFrame:(CGRect)frame 26 | overlayMode:(MMProgressHUDWindowOverlayMode)overlayMode; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Source/MMProgressHUDViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressHUDViewController.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 6/28/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MMProgressHUDViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/MMProgressHUDViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressHUDViewController.m 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 6/28/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import "MMProgressHUDViewController.h" 10 | #import "MMProgressHUDWindow.h" 11 | #import "MMProgressHUD.h" 12 | #import "MMProgressHUDCommon.h" 13 | 14 | 15 | #define suppressDeprecation(Stuff) \ 16 | do { \ 17 | _Pragma("clang diagnostic push") \ 18 | _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \ 19 | Stuff; \ 20 | _Pragma("clang diagnostic pop") \ 21 | } while (0) 22 | 23 | 24 | @implementation MMProgressHUDViewController 25 | 26 | - (void)setView:(UIView *)view { 27 | [super setView:view]; 28 | 29 | #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED 30 | #ifdef __IPHONE_7_0 31 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0 32 | /** this line is important. this tells the view controller to not resize 33 | the view to display the status bar -- unless we're on iOS 7 -- in 34 | which case it's deprecated and does nothing */ 35 | [self setWantsFullScreenLayout:YES]; 36 | #endif 37 | #endif 38 | #endif 39 | 40 | } 41 | 42 | - (BOOL)oldRootViewControllerShouldRotateToOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 43 | BOOL shouldRotateToOrientation = NO; 44 | MMProgressHUDWindow *win = (MMProgressHUDWindow *)self.view.window; 45 | UIViewController *rootViewController = win.oldWindow.rootViewController; 46 | suppressDeprecation( 47 | if ([[self superclass] instancesRespondToSelector:@selector(presentedViewController)] && 48 | ([rootViewController presentedViewController] != nil)) { 49 | MMHudLog(@"Presented view controller: %@", rootViewController.presentedViewController); 50 | shouldRotateToOrientation = [rootViewController.presentedViewController shouldAutorotateToInterfaceOrientation:toInterfaceOrientation]; 51 | } 52 | 53 | if ((shouldRotateToOrientation == NO) && 54 | (rootViewController != nil)) { 55 | 56 | shouldRotateToOrientation = [rootViewController shouldAutorotateToInterfaceOrientation:toInterfaceOrientation]; 57 | } 58 | else if (rootViewController == nil) { 59 | MMHudWLog(@"Root view controller for your application cannot be found! Defaulting to liberal rotation handling for your device!"); 60 | 61 | shouldRotateToOrientation = [super shouldAutorotateToInterfaceOrientation:toInterfaceOrientation]; 62 | } 63 | ); 64 | 65 | return shouldRotateToOrientation; 66 | } 67 | 68 | /** The rotation callbacks for this view controller will never get fired on iOS <5.0. This must be related to creating a view controller in a new window besides the default keyWindow. Since this is the case, the manual method of animating the rotating the view's transform is used via notification observers added in setView: above. 69 | 70 | */ 71 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 72 | 73 | if ([self.view.window isKindOfClass:[MMProgressHUDWindow class]]) { 74 | return [self oldRootViewControllerShouldRotateToOrientation:toInterfaceOrientation];; 75 | } 76 | else { 77 | return [super shouldAutorotateToInterfaceOrientation:toInterfaceOrientation]; 78 | } 79 | } 80 | 81 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations { 82 | MMProgressHUDWindow *win = (MMProgressHUDWindow *)self.view.window; 83 | UIViewController *rootViewController = win.oldWindow.rootViewController; 84 | 85 | if ([win isKindOfClass:[MMProgressHUDWindow class]] && 86 | [rootViewController respondsToSelector:@selector(supportedInterfaceOrientations)]) { 87 | return [rootViewController supportedInterfaceOrientations]; 88 | } 89 | else { 90 | MMHudWLog(@"Root view controller for your application cannot be found! Defaulting to liberal rotation handling for your device!"); 91 | } 92 | 93 | return [super supportedInterfaceOrientations]; 94 | } 95 | 96 | - (BOOL)shouldAutorotate { 97 | MMProgressHUDWindow *win = (MMProgressHUDWindow *)self.view.window; 98 | UIViewController *rootViewController = win.oldWindow.rootViewController; 99 | 100 | if ([win isKindOfClass:[MMProgressHUDWindow class]] && 101 | [rootViewController respondsToSelector:@selector(shouldAutorotate)]) { 102 | 103 | return [rootViewController shouldAutorotate]; 104 | } 105 | else { 106 | MMHudWLog(@"Root view controller for your application cannot be found! Defaulting to liberal rotation handling for your device!"); 107 | } 108 | 109 | return [super shouldAutorotate]; 110 | } 111 | 112 | - (void)dealloc { 113 | MMHudLog(@"dealloc"); 114 | } 115 | 116 | - (UIStatusBarStyle)preferredStatusBarStyle NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."){ 117 | return [[UIApplication sharedApplication] statusBarStyle]; 118 | } 119 | 120 | - (BOOL)prefersStatusBarHidden NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."){ 121 | return [[UIApplication sharedApplication] isStatusBarHidden]; 122 | } 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /Source/MMProgressHUDWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressHUDWindow.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 6/28/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MMProgressHUD.h" 11 | 12 | @interface MMProgressHUDWindow : UIWindow 13 | 14 | /** The window that was key at presentation time. Used to grab the view controller associated with the key window for rotation callbacks if they are available. */ 15 | @property (nonatomic, weak) UIWindow *oldWindow; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Source/MMProgressHUDWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressHUDWindow.m 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 6/28/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import "MMProgressHUDWindow.h" 10 | #import "MMProgressHUDCommon.h" 11 | 12 | @implementation MMProgressHUDWindow 13 | 14 | - (instancetype)init { 15 | if ((self = [super initWithFrame:[[UIScreen mainScreen] bounds]])) { 16 | [self commonInit]; 17 | } 18 | return self; 19 | } 20 | 21 | - (instancetype)initWithFrame:(CGRect)frame { 22 | self = [super initWithFrame:frame]; 23 | if (self) { 24 | [self commonInit]; 25 | } 26 | return self; 27 | } 28 | 29 | - (void)commonInit { 30 | self.windowLevel = UIWindowLevelStatusBar; 31 | 32 | self.backgroundColor = [UIColor clearColor]; 33 | } 34 | 35 | - (void)makeKeyAndVisible { 36 | MMHudLog(@"Making key"); 37 | 38 | [super makeKeyAndVisible]; 39 | } 40 | 41 | 42 | #pragma clang diagnostic push 43 | #pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" 44 | - (UIWindow *)oldWindow NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."){ 45 | if (_oldWindow == nil) { 46 | self.oldWindow = [[[UIApplication sharedApplication] windows] firstObject]; 47 | } 48 | 49 | MMHudLog(@"Old Window: %@", _oldWindow); 50 | 51 | return _oldWindow; 52 | } 53 | #pragma clang diagnostic pop 54 | 55 | - (void)setRootViewController:(UIViewController *)rootViewController { 56 | [super setRootViewController:rootViewController]; 57 | 58 | NSString *reqSysVer = @"8.0"; 59 | NSString *currSysVer = [[UIDevice currentDevice] systemVersion]; 60 | BOOL usesWindowTransformRotation = ([currSysVer compare:reqSysVer 61 | options:NSNumericSearch] != NSOrderedAscending); 62 | 63 | if (usesWindowTransformRotation == NO) { 64 | [self orientRootViewControllerForOrientation:rootViewController.interfaceOrientation]; 65 | } 66 | } 67 | 68 | - (void)orientRootViewControllerForOrientation:(UIInterfaceOrientation)interfaceOrientation { 69 | CGAffineTransform transform; 70 | 71 | switch (interfaceOrientation) { 72 | case UIInterfaceOrientationLandscapeRight: 73 | transform = CGAffineTransformMakeRotation(M_PI_2); 74 | break; 75 | case UIInterfaceOrientationLandscapeLeft: 76 | transform = CGAffineTransformMakeRotation(-M_PI_2); 77 | break; 78 | case UIInterfaceOrientationPortraitUpsideDown: 79 | transform = CGAffineTransformMakeRotation(M_PI); 80 | break; 81 | default: 82 | case UIInterfaceOrientationPortrait: 83 | transform = CGAffineTransformIdentity; 84 | break; 85 | } 86 | 87 | self.rootViewController.view.transform = transform; 88 | } 89 | 90 | - (void)dealloc { 91 | MMHudLog(@"dealloc"); 92 | } 93 | 94 | @end 95 | 96 | -------------------------------------------------------------------------------- /Source/MMProgressView-Protocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressView.h 3 | // MMProgressHUD 4 | // 5 | // Created by Jonas Gessner on 04.08.13. 6 | // Copyright (c) 2012 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol MMProgressView 12 | 13 | /** The percent of the pie that will be filled in. Valid values are between 0 and 1. 14 | 15 | @warning When implementing progress changes, the default setter *should* implicitly animate the property change. 16 | */ 17 | @property (nonatomic) CGFloat progress; 18 | 19 | /** Change the progress percent animated. 20 | 21 | @param progress The progress as a percent (0-1). 22 | @param animated A boolean to indicate whether to animate the change in progress animated. 23 | */ 24 | - (void)setProgress:(CGFloat)progress animated:(BOOL)animated; 25 | 26 | /** Change the progress percent animated with a completion block. 27 | 28 | @param progress The progress as a percent (0-1). 29 | @param animated A boolean to indicate whether to animate the change in progress animated. 30 | @param completion A block that will fire upon completion of animating the change in progress. The boolean sent with the block will indicate if the animation finished successfully. 31 | */ 32 | - (void)setProgress:(CGFloat)progress animated:(BOOL)animated withCompletion:(void(^)(BOOL completed))completion; 33 | 34 | 35 | /** The size required of the progress view in bounds of the defaultSize and the totalAvailableSize. */ 36 | + (CGSize)sizeThatFitsSize:(CGSize)defaultSize maximumAvailableSize:(CGSize)totalAvailableSize; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Source/MMRadialProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMRadialProgress.h 3 | // MMProgressHUDDemo 4 | // 5 | // Created by Lars Anderson on 5/14/12. 6 | // Copyright (c) 2012 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MMProgressView-Protocol.h" 11 | 12 | @interface MMRadialProgressView : UIView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/MMVectorImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMVectorImage.h 3 | // MMProgressHUD 4 | // 5 | // Created by Lars Anderson on 2/17/13. 6 | // Copyright (c) 2013 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger, MMVectorShapeType) { 12 | MMVectorShapeTypeCheck = 0, 13 | MMVectorShapeTypeX 14 | }; 15 | 16 | @interface MMVectorImage : NSObject 17 | 18 | + (UIImage *)vectorImageShapeOfType:(MMVectorShapeType)shapeType 19 | size:(CGSize)size 20 | fillColor:(UIColor *)fillColor; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/MMVectorImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMVectorImage.m 3 | // MMProgressHUD 4 | // 5 | // Created by Lars Anderson on 2/17/13. 6 | // Copyright (c) 2013 Mutual Mobile. All rights reserved. 7 | // 8 | 9 | #import "MMVectorImage.h" 10 | 11 | @implementation MMVectorImage 12 | 13 | + (UIImage *)vectorImageShapeOfType:(MMVectorShapeType)shapeType size:(CGSize)size fillColor:(UIColor *)fillColor { 14 | CGFloat scale = [[UIScreen mainScreen] scale]; 15 | 16 | CGSize imageSize = size; 17 | if (size.width != size.height) { 18 | CGFloat dimension = MAX(size.width, size.height); 19 | imageSize = CGSizeMake(dimension, dimension); 20 | } 21 | 22 | UIGraphicsBeginImageContextWithOptions(imageSize, NO, scale); 23 | 24 | [self drawShapeOfType:shapeType size:imageSize fillColor:fillColor]; 25 | 26 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 27 | UIGraphicsEndImageContext(); 28 | 29 | return image; 30 | } 31 | 32 | + (void)drawShapeOfType:(MMVectorShapeType)shapeType size:(CGSize)size fillColor:(UIColor *)fillColor { 33 | CGSize vectorSize = CGSizeMake(512.f, 512.f);//vector strings based on 512x512 size 34 | NSString *pointsString = [self vectorPointStringForShapeType:shapeType]; 35 | NSArray *pointsStringArray = [pointsString componentsSeparatedByString:@" "]; 36 | UIBezierPath *vectorPath = [UIBezierPath bezierPath]; 37 | for (NSString *point in pointsStringArray) { 38 | NSArray *individualPoint = [point componentsSeparatedByString:@","]; 39 | CGFloat x = [individualPoint[0] floatValue]/vectorSize.width; 40 | CGFloat y = [individualPoint[1] floatValue]/vectorSize.height; 41 | CGPoint newPoint = CGPointMake(x*size.width, y*size.height); 42 | if ([vectorPath isEmpty]) { 43 | [vectorPath moveToPoint:newPoint]; 44 | } 45 | else { 46 | [vectorPath addLineToPoint:newPoint]; 47 | } 48 | } 49 | 50 | if ([vectorPath isEmpty] == NO) { 51 | [vectorPath closePath]; 52 | 53 | [fillColor setFill]; 54 | 55 | [vectorPath fill]; 56 | } 57 | } 58 | 59 | + (NSString *)checkMarkVectorString { 60 | return @"434.442,58.997 195.559,297.881 77.554,179.88 0,257.438 195.559,453.003 512,136.551"; 61 | } 62 | 63 | + (NSString *)xMarkVectorString { 64 | return @"512,120.859 391.141,0 255.997,135.146 120.855,0 0,120.859 135.132,256.006 0,391.146 120.855,512 255.997,376.872 391.141,512 512,391.146 376.862,256.006"; 65 | } 66 | 67 | + (NSString *)vectorPointStringForShapeType:(MMVectorShapeType)shapeType { 68 | switch (shapeType) { 69 | case MMVectorShapeTypeCheck: 70 | return [self checkMarkVectorString]; 71 | case MMVectorShapeTypeX: 72 | return [self xMarkVectorString]; 73 | } 74 | } 75 | 76 | @end 77 | --------------------------------------------------------------------------------