diff --git a/Demo/MMProgressHUDDemo.xcodeproj/project.pbxproj b/Demo/MMProgressHUDDemo.xcodeproj/project.pbxproj index 23d50f2..e3aeb00 100644 --- a/Demo/MMProgressHUDDemo.xcodeproj/project.pbxproj +++ b/Demo/MMProgressHUDDemo.xcodeproj/project.pbxproj @@ -70,7 +70,40 @@ 69DA08CC158261EE000DC29E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A19B38155492E000D65BB8 /* Foundation.framework */; }; 69DA08D2158261EE000DC29E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 69DA08D0158261EE000DC29E /* InfoPlist.strings */; }; 69DA08D5158261EE000DC29E /* MMProgressHUDTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 69DA08D4158261EE000DC29E /* MMProgressHUDTests.m */; }; + DD29615D17E4BC2700AC6831 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A19B42155492E000D65BB8 /* main.m */; }; + DD29615E17E4BC2700AC6831 /* MMAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A19B46155492E000D65BB8 /* MMAppDelegate.m */; }; + DD29615F17E4BC2700AC6831 /* MMViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A19B49155492E000D65BB8 /* MMViewController.m */; }; + DD29616017E4BC2700AC6831 /* MMProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A19B5C155493B500D65BB8 /* MMProgressHUD.m */; }; + DD29616117E4BC2700AC6831 /* MMRadialProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 550D504B15615BEF0092B975 /* MMRadialProgressView.m */; }; + DD29616217E4BC2700AC6831 /* MMProgressHUDDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBE93BD17CA561D00B78C77 /* MMProgressHUDDefines.m */; }; + DD29616317E4BC2700AC6831 /* MMHud.m in Sources */ = {isa = PBXBuildFile; fileRef = 5527AEFA159CD7650037D67D /* MMHud.m */; }; + DD29616417E4BC2700AC6831 /* MMProgressHUDWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 5527AEFE159CD7D50037D67D /* MMProgressHUDWindow.m */; }; + DD29616517E4BC2700AC6831 /* MMProgressHUDViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5527AF02159CD8200037D67D /* MMProgressHUDViewController.m */; }; + DD29616617E4BC2700AC6831 /* MMProgressHUD+Animations.m in Sources */ = {isa = PBXBuildFile; fileRef = 55F0596015A2083C00A47983 /* MMProgressHUD+Animations.m */; }; + DD29616717E4BC2700AC6831 /* MMProgressHUD+Class.m in Sources */ = {isa = PBXBuildFile; fileRef = 55F0596515A20BDD00A47983 /* MMProgressHUD+Class.m */; }; + DD29616817E4BC2700AC6831 /* MMProgressHUDDefines-Private.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBE93C217CA5BF300B78C77 /* MMProgressHUDDefines-Private.m */; }; + DD29616917E4BC2700AC6831 /* MMProgressHUDOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 55AC1A0415A602A500D64C1F /* MMProgressHUDOverlayView.m */; }; + DD29616A17E4BC2700AC6831 /* MMLinearProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBCC20417C2822A00C3BF8C /* MMLinearProgressView.m */; }; + DD29616B17E4BC2700AC6831 /* MMVectorImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 46F3F73E16D1E76700E255A2 /* MMVectorImage.m */; }; + DD29616D17E4BC2700AC6831 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A19B5F15549B0300D65BB8 /* QuartzCore.framework */; }; + DD29616E17E4BC2700AC6831 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A19B36155492E000D65BB8 /* UIKit.framework */; }; + DD29616F17E4BC2700AC6831 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A19B38155492E000D65BB8 /* Foundation.framework */; }; + DD29617017E4BC2700AC6831 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A19B3A155492E000D65BB8 /* CoreGraphics.framework */; }; + DD29617217E4BC2700AC6831 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 46A19B3F155492E000D65BB8 /* InfoPlist.strings */; }; + DD29617317E4BC2700AC6831 /* 1.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A19B6215549F5200D65BB8 /* 1.png */; }; + DD29617417E4BC2700AC6831 /* 2.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A19B6315549F5200D65BB8 /* 2.png */; }; + DD29617517E4BC2700AC6831 /* 3.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A19B6415549F5200D65BB8 /* 3.png */; }; + DD29617617E4BC2700AC6831 /* 4.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A19B6515549F5200D65BB8 /* 4.png */; }; + DD29617717E4BC2700AC6831 /* 5.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A19B6615549F5200D65BB8 /* 5.png */; }; + DD29617817E4BC2700AC6831 /* 6.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A19B6715549F5200D65BB8 /* 6.png */; }; + DD29617917E4BC2700AC6831 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 463AE40616B105B300A93EED /* Default-568h@2x.png */; }; DDBCC20617C2822A00C3BF8C /* MMLinearProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBCC20417C2822A00C3BF8C /* MMLinearProgressView.m */; }; + DDBE93BE17CA59FD00B78C77 /* MMProgressHUDDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBE93BD17CA561D00B78C77 /* MMProgressHUDDefines.m */; }; + DDBE93BF17CA59FE00B78C77 /* MMProgressHUDDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBE93BD17CA561D00B78C77 /* MMProgressHUDDefines.m */; }; + DDBE93C017CA59FE00B78C77 /* MMProgressHUDDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBE93BD17CA561D00B78C77 /* MMProgressHUDDefines.m */; }; + DDBE93C317CA5BF300B78C77 /* MMProgressHUDDefines-Private.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBE93C217CA5BF300B78C77 /* MMProgressHUDDefines-Private.m */; }; + DDBE93C417CA5BF300B78C77 /* MMProgressHUDDefines-Private.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBE93C217CA5BF300B78C77 /* MMProgressHUDDefines-Private.m */; }; + DDBE93C517CA5BF300B78C77 /* MMProgressHUDDefines-Private.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBE93C217CA5BF300B78C77 /* MMProgressHUDDefines-Private.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -81,6 +114,13 @@ remoteGlobalIDString = 69DA08C7158261EE000DC29E; remoteInfo = LogicTests; }; + DD29615B17E4BC2700AC6831 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A19B29155492E000D65BB8 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 69DA08C7158261EE000DC29E; + remoteInfo = LogicTests; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -143,10 +183,14 @@ 69DA08D1158261EE000DC29E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 69DA08D4158261EE000DC29E /* MMProgressHUDTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMProgressHUDTests.m; sourceTree = ""; }; 69DA08D6158261EE000DC29E /* LogicTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LogicTests-Prefix.pch"; sourceTree = ""; }; + DD29617E17E4BC2700AC6831 /* MMProgressHUDDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MMProgressHUDDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; DDB2DD6A17C626570077C18E /* MMProgressHUDDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMProgressHUDDefines.h; sourceTree = ""; }; DDBCC20317C2822A00C3BF8C /* MMLinearProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMLinearProgressView.h; sourceTree = ""; }; DDBCC20417C2822A00C3BF8C /* MMLinearProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMLinearProgressView.m; sourceTree = ""; }; - DDBCC20517C2822A00C3BF8C /* MMProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMProgressView.h; sourceTree = ""; }; + DDBCC20517C2822A00C3BF8C /* MMProgressView-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MMProgressView-Protocol.h"; sourceTree = ""; }; + DDBE93BD17CA561D00B78C77 /* MMProgressHUDDefines.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMProgressHUDDefines.m; sourceTree = ""; }; + DDBE93C117CA5BF300B78C77 /* MMProgressHUDDefines-Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MMProgressHUDDefines-Private.h"; sourceTree = ""; }; + DDBE93C217CA5BF300B78C77 /* MMProgressHUDDefines-Private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MMProgressHUDDefines-Private.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -187,6 +231,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DD29616C17E4BC2700AC6831 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DD29616D17E4BC2700AC6831 /* QuartzCore.framework in Frameworks */, + DD29616E17E4BC2700AC6831 /* UIKit.framework in Frameworks */, + DD29616F17E4BC2700AC6831 /* Foundation.framework in Frameworks */, + DD29617017E4BC2700AC6831 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -210,6 +265,7 @@ 46A19B32155492E000D65BB8 /* MMProgressHUDDemo.app */, 69DA08C8158261EE000DC29E /* LogicTests.octest */, 55F0587C159E02DD00A47983 /* GHUnitTests.app */, + DD29617E17E4BC2700AC6831 /* MMProgressHUDDemo.app */, ); name = Products; sourceTree = ""; @@ -257,6 +313,9 @@ 46F3F73D16D1E76700E255A2 /* MMVectorImage.h */, 46F3F73E16D1E76700E255A2 /* MMVectorImage.m */, DDB2DD6A17C626570077C18E /* MMProgressHUDDefines.h */, + DDBE93BD17CA561D00B78C77 /* MMProgressHUDDefines.m */, + DDBE93C117CA5BF300B78C77 /* MMProgressHUDDefines-Private.h */, + DDBE93C217CA5BF300B78C77 /* MMProgressHUDDefines-Private.m */, 46A19B5B155493B500D65BB8 /* MMProgressHUD.h */, 46A19B5C155493B500D65BB8 /* MMProgressHUD.m */, 55AC1A0315A602A500D64C1F /* MMProgressHUDOverlayView.h */, @@ -264,7 +323,7 @@ 55F0596515A20BDD00A47983 /* MMProgressHUD+Class.m */, 55F0595F15A2083C00A47983 /* MMProgressHUD+Animations.h */, 55F0596015A2083C00A47983 /* MMProgressHUD+Animations.m */, - DDBCC20517C2822A00C3BF8C /* MMProgressView.h */, + DDBCC20517C2822A00C3BF8C /* MMProgressView-Protocol.h */, DDBCC20317C2822A00C3BF8C /* MMLinearProgressView.h */, DDBCC20417C2822A00C3BF8C /* MMLinearProgressView.m */, 550D504A15615BEF0092B975 /* MMRadialProgressView.h */, @@ -407,6 +466,25 @@ productReference = 69DA08C8158261EE000DC29E /* LogicTests.octest */; productType = "com.apple.product-type.bundle"; }; + DD29615917E4BC2700AC6831 /* MMProgressHUDDemo64 */ = { + isa = PBXNativeTarget; + buildConfigurationList = DD29617B17E4BC2700AC6831 /* Build configuration list for PBXNativeTarget "MMProgressHUDDemo64" */; + buildPhases = ( + DD29615C17E4BC2700AC6831 /* Sources */, + DD29616C17E4BC2700AC6831 /* Frameworks */, + DD29617117E4BC2700AC6831 /* Resources */, + DD29617A17E4BC2700AC6831 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + DD29615A17E4BC2700AC6831 /* PBXTargetDependency */, + ); + name = MMProgressHUDDemo64; + productName = MMProgressHUDDemo; + productReference = DD29617E17E4BC2700AC6831 /* MMProgressHUDDemo.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -430,6 +508,7 @@ projectRoot = ""; targets = ( 46A19B31155492E000D65BB8 /* MMProgressHUDDemo */, + DD29615917E4BC2700AC6831 /* MMProgressHUDDemo64 */, 69DA08C7158261EE000DC29E /* LogicTests */, 55F0587B159E02DD00A47983 /* GHUnitTests */, ); @@ -467,6 +546,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DD29617117E4BC2700AC6831 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DD29617217E4BC2700AC6831 /* InfoPlist.strings in Resources */, + DD29617317E4BC2700AC6831 /* 1.png in Resources */, + DD29617417E4BC2700AC6831 /* 2.png in Resources */, + DD29617517E4BC2700AC6831 /* 3.png in Resources */, + DD29617617E4BC2700AC6831 /* 4.png in Resources */, + DD29617717E4BC2700AC6831 /* 5.png in Resources */, + DD29617817E4BC2700AC6831 /* 6.png in Resources */, + DD29617917E4BC2700AC6831 /* Default-568h@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -496,6 +590,19 @@ shellPath = /bin/sh; shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; + DD29617A17E4BC2700AC6831 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "KEYWORDS=\"TODO:|FIXME:|\\?\\?\\?:|\\!\\!\\!:\"\nfind \"${SRCROOT}/..\" \\( -name \"*.h\" -or -name \"*.m\" \\) -print0 | xargs -0 egrep --with-filename --line-number --only-matching \"($KEYWORDS).*\\$\" | perl -p -e \"s/($KEYWORDS)/ warning: \\$1/\""; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -508,11 +615,13 @@ 46A19B4A155492E000D65BB8 /* MMViewController.m in Sources */, 46A19B5D155493B500D65BB8 /* MMProgressHUD.m in Sources */, 550D504C15615BEF0092B975 /* MMRadialProgressView.m in Sources */, + DDBE93BE17CA59FD00B78C77 /* MMProgressHUDDefines.m in Sources */, 5527AEFB159CD7650037D67D /* MMHud.m in Sources */, 5527AEFF159CD7D50037D67D /* MMProgressHUDWindow.m in Sources */, 5527AF03159CD8200037D67D /* MMProgressHUDViewController.m in Sources */, 55F0596115A2083C00A47983 /* MMProgressHUD+Animations.m in Sources */, 55F0596615A20BDD00A47983 /* MMProgressHUD+Class.m in Sources */, + DDBE93C317CA5BF300B78C77 /* MMProgressHUDDefines-Private.m in Sources */, 55AC1A0515A602A500D64C1F /* MMProgressHUDOverlayView.m in Sources */, DDBCC20617C2822A00C3BF8C /* MMLinearProgressView.m in Sources */, 46F3F73F16D1E76700E255A2 /* MMVectorImage.m in Sources */, @@ -528,11 +637,13 @@ 55F0589A159E04E200A47983 /* MMHudTests.m in Sources */, 55F0589B159E058600A47983 /* MMProgressHUD.m in Sources */, 55F0589C159E058600A47983 /* MMRadialProgressView.m in Sources */, + DDBE93C017CA59FE00B78C77 /* MMProgressHUDDefines.m in Sources */, 55F0589D159E058600A47983 /* MMHud.m in Sources */, 55F0589E159E058600A47983 /* MMProgressHUDWindow.m in Sources */, 55F0589F159E058600A47983 /* MMProgressHUDViewController.m in Sources */, 55F0596315A2083C00A47983 /* MMProgressHUD+Animations.m in Sources */, 55F0596815A20BDD00A47983 /* MMProgressHUD+Class.m in Sources */, + DDBE93C517CA5BF300B78C77 /* MMProgressHUDDefines-Private.m in Sources */, 55AC1A0615A602A500D64C1F /* MMProgressHUDOverlayView.m in Sources */, 46ACE86C17C50A610075C2A0 /* MMLinearProgressView.m in Sources */, 46F3F74116D1E76700E255A2 /* MMVectorImage.m in Sources */, @@ -548,17 +659,41 @@ 5527AF07159CD97A0037D67D /* MMHudTests.m in Sources */, 55F0592D159E39C400A47983 /* MMProgressHUD.m in Sources */, 55F0592E159E39CB00A47983 /* MMRadialProgressView.m in Sources */, + DDBE93BF17CA59FE00B78C77 /* MMProgressHUDDefines.m in Sources */, 55F0592F159E39CB00A47983 /* MMHud.m in Sources */, 55F05930159E39CB00A47983 /* MMProgressHUDWindow.m in Sources */, 55F05931159E39CB00A47983 /* MMProgressHUDViewController.m in Sources */, 55F0596215A2083C00A47983 /* MMProgressHUD+Animations.m in Sources */, 55F0596715A20BDD00A47983 /* MMProgressHUD+Class.m in Sources */, + DDBE93C417CA5BF300B78C77 /* MMProgressHUDDefines-Private.m in Sources */, 55AC1A0815A62B6900D64C1F /* MMProgressHUDOverlayView.m in Sources */, 46ACE86B17C50A580075C2A0 /* MMLinearProgressView.m in Sources */, 46F3F74016D1E76700E255A2 /* MMVectorImage.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; + DD29615C17E4BC2700AC6831 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DD29615D17E4BC2700AC6831 /* main.m in Sources */, + DD29615E17E4BC2700AC6831 /* MMAppDelegate.m in Sources */, + DD29615F17E4BC2700AC6831 /* MMViewController.m in Sources */, + DD29616017E4BC2700AC6831 /* MMProgressHUD.m in Sources */, + DD29616117E4BC2700AC6831 /* MMRadialProgressView.m in Sources */, + DD29616217E4BC2700AC6831 /* MMProgressHUDDefines.m in Sources */, + DD29616317E4BC2700AC6831 /* MMHud.m in Sources */, + DD29616417E4BC2700AC6831 /* MMProgressHUDWindow.m in Sources */, + DD29616517E4BC2700AC6831 /* MMProgressHUDViewController.m in Sources */, + DD29616617E4BC2700AC6831 /* MMProgressHUD+Animations.m in Sources */, + DD29616717E4BC2700AC6831 /* MMProgressHUD+Class.m in Sources */, + DD29616817E4BC2700AC6831 /* MMProgressHUDDefines-Private.m in Sources */, + DD29616917E4BC2700AC6831 /* MMProgressHUDOverlayView.m in Sources */, + DD29616A17E4BC2700AC6831 /* MMLinearProgressView.m in Sources */, + DD29616B17E4BC2700AC6831 /* MMVectorImage.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -567,6 +702,11 @@ target = 69DA08C7158261EE000DC29E /* LogicTests */; targetProxy = 69DA08DD15826291000DC29E /* PBXContainerItemProxy */; }; + DD29615A17E4BC2700AC6831 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 69DA08C7158261EE000DC29E /* LogicTests */; + targetProxy = DD29615B17E4BC2700AC6831 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -843,6 +983,70 @@ }; name = Release; }; + DD29617C17E4BC2700AC6831 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = NO; + CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MMProgressHUDDemo/MMProgressHUDDemo-Prefix.pch"; + GCC_VERSION = ""; + INFOPLIST_FILE = "MMProgressHUDDemo/MMProgressHUDDemo-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = MMProgressHUDDemo; + PROVISIONING_PROFILE = ""; + WARNING_CFLAGS = ( + "-Wall", + "-Wextra", + "-Wobjc-interface-ivars", + "-Wunused-macros", + "-Wunreachable-code", + "-Wimplicit-retain-self", + "-Wno-unused-parameter", + "-Wdeprecated-declarations", + ); + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + DD29617D17E4BC2700AC6831 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = NO; + CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MMProgressHUDDemo/MMProgressHUDDemo-Prefix.pch"; + GCC_VERSION = ""; + INFOPLIST_FILE = "MMProgressHUDDemo/MMProgressHUDDemo-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = MMProgressHUDDemo; + PROVISIONING_PROFILE = ""; + WARNING_CFLAGS = ( + "-Wall", + "-Wextra", + "-Wobjc-interface-ivars", + "-Wunused-macros", + "-Wunreachable-code", + "-Wimplicit-retain-self", + "-Wno-unused-parameter", + "-Wdeprecated-declarations", + ); + WRAPPER_EXTENSION = app; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -882,6 +1086,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + DD29617B17E4BC2700AC6831 /* Build configuration list for PBXNativeTarget "MMProgressHUDDemo64" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DD29617C17E4BC2700AC6831 /* Debug */, + DD29617D17E4BC2700AC6831 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 46A19B29155492E000D65BB8 /* Project object */; diff --git a/Source/MMHud.h b/Source/MMHud.h index 5cd2e24..e7c1e79 100755 --- a/Source/MMHud.h +++ b/Source/MMHud.h @@ -9,33 +9,6 @@ #import #import "MMProgressHUDDefines.h" -MMExtern CGFloat const MMProgressHUDAnimateInDurationLong; -MMExtern CGFloat const MMProgressHUDAnimateInDurationNormal; -MMExtern CGFloat const MMProgressHUDAnimateInDurationMedium; -MMExtern CGFloat const MMProgressHUDAnimateInDurationShort; -MMExtern CGFloat const MMProgressHUDAnimateInDurationVeryShort; - -MMExtern CGFloat const MMProgressHUDAnimateOutDurationLong; -MMExtern CGFloat const MMProgressHUDAnimateOutDurationMedium; -MMExtern CGFloat const MMProgressHUDAnimateOutDurationShort; - -typedef NS_ENUM(NSInteger, MMProgressHUDDisplayStyle) { - MMProgressHUDDisplayStylePlain = 0, - MMProgressHUDDisplayStyleBordered, -}; - -typedef NS_ENUM(NSInteger, MMProgressHUDProgressStyle) { - MMProgressHUDProgressStyleIndeterminate = 0, - MMProgressHUDProgressStyleRadial, - MMProgressHUDProgressStyleLinear, -} DEPRECATED_ATTRIBUTE; - -typedef NS_ENUM(NSInteger, MMProgressHUDCompletionState) { - MMProgressHUDCompletionStateNone = 0, - MMProgressHUDCompletionStateError, - MMProgressHUDCompletionStateSuccess, -}; - @class MMHud; @protocol MMHudDelegate diff --git a/Source/MMHud.m b/Source/MMHud.m index d6e5a27..c2b1fb0 100755 --- a/Source/MMHud.m +++ b/Source/MMHud.m @@ -9,44 +9,12 @@ #import #import "MMHud.h" #import "MMProgressHUD.h" -#import "MMProgressView.h" +#import "MMProgressView-Protocol.h" #import "MMRadialProgressView.h" -CGFloat const MMProgressHUDDefaultFontSize = 16.f; +#import "MMProgressHUDDefines-Private.h" -CGFloat const MMProgressHUDMaximumWidth = 300.f; -CGFloat const MMProgressHUDMinimumWidth = 100.f; -CGFloat const MMProgressHUDContentPadding = 5.f; - -CGFloat const MMProgressHUDAnimateInDurationLong = 1.5f; -CGFloat const MMProgressHUDAnimateInDurationMedium = 0.75f; -CGFloat const MMProgressHUDAnimateInDurationNormal = 0.35f; -CGFloat const MMProgressHUDAnimateInDurationShort = 0.25f; -CGFloat const MMProgressHUDAnimateInDurationVeryShort= 0.15f; - -CGFloat const MMProgressHUDAnimateOutDurationLong = 0.75f; -CGFloat const MMProgressHUDAnimateOutDurationMedium = 0.55f; -CGFloat const MMProgressHUDAnimateOutDurationShort = 0.35f; - -CGSize const MMProgressHUDDefaultContentAreaSize = { 100.f, 100.f }; -CGSize const MMProgressHUDProgressContentAreaSize = { 40.f, 40.f }; -CGSize const MMProgressHUDProgressMaximumAreaSize = {200.0f, 200.0f}; - - -NSString * const MMProgressHUDFontNameBold = @"HelveticaNeue-Bold"; -NSString * const MMProgressHUDFontNameNormal = @"HelveticaNeue-Light"; - -#ifdef DEBUG - #ifdef MM_HUD_FRAME_DEBUG - static const BOOL MMProgressHUDFrameDebugModeEnabled = YES; - #else - static const BOOL MMProgressHUDFrameDebugModeEnabled = NO; - #endif -#else - static const BOOL MMProgressHUDFrameDebugModeEnabled = NO; -#endif - -@interface MMHud() +@interface MMHud () @property (nonatomic, strong) UIView *progressViewContainer; @property (nonatomic, strong) UIView *progressView; @@ -507,11 +475,8 @@ - (void)_buildStatusLabel { _statusLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _statusLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; _statusLabel.numberOfLines = 0; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - _statusLabel.lineBreakMode = UILineBreakModeWordWrap; - _statusLabel.textAlignment = UITextAlignmentCenter; -#pragma clang diagnostic pop + _statusLabel.lineBreakMode = NSLineBreakByWordWrapping; + _statusLabel.textAlignment = NSTextAlignmentCenter; _statusLabel.backgroundColor = [UIColor clearColor]; _statusLabel.font = [UIFont fontWithName:MMProgressHUDFontNameNormal size:MMProgressHUDDefaultFontSize]; _statusLabel.textColor = [UIColor colorWithWhite:0.9f alpha:0.95f]; @@ -539,11 +504,8 @@ - (void)_buildTitleLabel { _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _titleLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; _titleLabel.numberOfLines = 0; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - _titleLabel.lineBreakMode = UILineBreakModeWordWrap; - _titleLabel.textAlignment = UITextAlignmentCenter; -#pragma clang diagnostic pop + _titleLabel.lineBreakMode = NSLineBreakByWordWrapping; + _titleLabel.textAlignment = NSTextAlignmentCenter; _titleLabel.backgroundColor = [UIColor clearColor]; _titleLabel.font = [UIFont fontWithName:MMProgressHUDFontNameBold size:MMProgressHUDDefaultFontSize]; _titleLabel.textColor = [UIColor whiteColor]; diff --git a/Source/MMLinearProgressView.h b/Source/MMLinearProgressView.h index 026a3d6..86bc199 100644 --- a/Source/MMLinearProgressView.h +++ b/Source/MMLinearProgressView.h @@ -7,7 +7,7 @@ // #import -#import "MMProgressView.h" +#import "MMProgressView-Protocol.h" @interface MMLinearProgressView : UIView diff --git a/Source/MMProgressHUD+Animations.m b/Source/MMProgressHUD+Animations.m index 12712d8..b5190bf 100755 --- a/Source/MMProgressHUD+Animations.m +++ b/Source/MMProgressHUD+Animations.m @@ -8,6 +8,8 @@ #import #import "MMProgressHUD+Animations.h" +#import "MMProgressHUDDefines-Private.h" + @interface MMProgressHUD () - (CGPoint)_windowCenterForHUDAnchor:(CGPoint)anchor; diff --git a/Source/MMProgressHUD+Class.m b/Source/MMProgressHUD+Class.m index 3bf3afa..4c04221 100755 --- a/Source/MMProgressHUD+Class.m +++ b/Source/MMProgressHUD+Class.m @@ -7,6 +7,7 @@ // #import "MMProgressHUD.h" +#import "MMProgressHUDDefines-Private.h" @interface MMProgressHUD() @@ -14,13 +15,14 @@ - (CGPoint)_windowCenterForHUDAnchor:(CGPoint)anchor; - (void)dismissWithCompletionState:(MMProgressHUDCompletionState)completionState title:(NSString *)title status:(NSString *)status - afterDelay:(float)delay; + afterDelay:(NSTimeInterval)delay; - (void)_updateHUDAnimated:(BOOL)animated withCompletion:(void(^)(BOOL completed))completionBlock; - (void)show; - (void)dismiss; +- (void)dismissAfterDelay:(NSTimeInterval)delay; @end @@ -109,6 +111,16 @@ + (void)updateProgress:(CGFloat)progress { } //indeterminate status + ++ (void)show { + [MMProgressHUD showWithTitle:nil status:nil]; +} + ++ (void)showWithTitle:(NSString *)title { + [MMProgressHUD showWithTitle:title + status:nil]; +} + + (void)showWithStatus:(NSString *)status { [MMProgressHUD showWithTitle:nil status:status]; @@ -157,7 +169,7 @@ + (void)showWithTitle:(NSString *)title [MMProgressHUD showWithTitle:title status:status cancelBlock:cancelBlock - images:@[image]]; + images:(image != nil ? @[image] : nil)]; } + (void)showWithTitle:(NSString *)title @@ -222,7 +234,7 @@ + (void)showWithTitle:(NSString *)title //dismissal + (void)dismissWithError:(NSString *)status title:(NSString *)title - afterDelay:(float)delay { + afterDelay:(NSTimeInterval)delay { if ([NSThread isMainThread] == NO) { dispatch_sync(dispatch_get_main_queue(), ^{ [[MMProgressHUD sharedHUD] dismissWithCompletionState:MMProgressHUDCompletionStateError @@ -252,7 +264,7 @@ + (void)dismissWithError:(NSString *)status { } + (void)dismissWithError:(NSString *)status - afterDelay:(float)delay { + afterDelay:(NSTimeInterval)delay { [MMProgressHUD dismissWithError:status title:nil afterDelay:delay]; @@ -260,7 +272,7 @@ + (void)dismissWithError:(NSString *)status + (void)dismissWithSuccess:(NSString *)status title:(NSString *)title - afterDelay:(float)delay { + afterDelay:(NSTimeInterval)delay { if ([NSThread isMainThread] == NO) { dispatch_sync(dispatch_get_main_queue(), ^{ [[MMProgressHUD sharedHUD] dismissWithCompletionState:MMProgressHUDCompletionStateSuccess @@ -289,10 +301,14 @@ + (void)dismissWithSuccess:(NSString *)status { title:nil]; } ++ (void)dismissAfterDelay:(NSTimeInterval)delay { + [[MMProgressHUD sharedHUD] dismissAfterDelay:delay]; +} + + (void)dismiss { if ([NSThread isMainThread] == NO) { dispatch_sync(dispatch_get_main_queue(), ^{ - [[MMProgressHUD sharedHUD] dismiss]; + [[MMProgressHUD sharedHUD] dismiss]; }); } else { diff --git a/Source/MMProgressHUD.h b/Source/MMProgressHUD.h index da71c31..dd5af1e 100755 --- a/Source/MMProgressHUD.h +++ b/Source/MMProgressHUD.h @@ -9,44 +9,9 @@ #import #import "MMHud.h" -MMExtern NSString * const MMProgressHUDDefaultConfirmationMessage; - -MMExtern NSString * const MMProgressHUDAnimationShow; -MMExtern NSString * const MMProgressHUDAnimationDismiss; -MMExtern NSString * const MMProgressHUDAnimationWindowFadeOut; -MMExtern NSString * const MMProgressHUDAnimationKeyShowAnimation; -MMExtern NSString * const MMProgressHUDAnimationKeyDismissAnimation; - - -MMExtern float const MMProgressHUDStandardDismissDelay; - @class MMProgressHUDWindow; @class MMProgressHUDOverlayView; -typedef NS_ENUM(NSInteger, MMProgressHUDPresentationStyle) { - MMProgressHUDPresentationStyleDrop = 0, //default - MMProgressHUDPresentationStyleExpand, - MMProgressHUDPresentationStyleShrink, - MMProgressHUDPresentationStyleSwingLeft, - MMProgressHUDPresentationStyleSwingRight, - MMProgressHUDPresentationStyleBalloon, - MMProgressHUDPresentationStyleFade, - MMProgressHUDPresentationStyleNone -}; - -typedef NS_ENUM(NSInteger, MMProgressHUDWindowOverlayMode) { - MMProgressHUDWindowOverlayModeNone = -1, - MMProgressHUDWindowOverlayModeGradient = 0, - MMProgressHUDWindowOverlayModeLinear, - /*MMProgressHUDWindowOverlayModeBlur*/ //iOS 7 only -}; - -//iOS 7 only -//typedef NS_ENUM(NSInteger, MMProgressHUDOptions) { -// MMProgressHUDOptionGravityEnabled = 1 << 0, -// MMProgressHUDOptionGyroEnabled = 1 << 1, -//}; - @interface MMProgressHUD : UIView /** An enum to specify the style in which to display progress. @@ -57,9 +22,6 @@ typedef NS_ENUM(NSInteger, MMProgressHUDWindowOverlayMode) { */ @property (nonatomic, assign) MMProgressHUDProgressStyle progressStyle DEPRECATED_ATTRIBUTE; -/** A boolean value that indicates whether or not the HUD has been cancelled manually. */ -@property (nonatomic, assign, getter = isCancelled) BOOL cancelled; - /** The determinate progress state. The progress ranges from 0-1. @@ -69,6 +31,9 @@ typedef NS_ENUM(NSInteger, MMProgressHUDWindowOverlayMode) { /** A Boolean value that indicates whether or not the HUD is visible. */ @property(nonatomic, readonly, getter = isVisible) BOOL visible; +/** A boolean value that indicates whether or not the HUD has been cancelled manually. */ +@property (nonatomic, assign, getter = isCancelled) BOOL cancelled; + /** The presentation style for the HUD. Persistent across show calls. @@ -164,6 +129,34 @@ This message will be presented to the user when a cancelBlock is present after t /** @name Presentation */ //----------------------------------------------- +/** Shows indeterminate HUD. + + @warning All show methods are mutually exclusive of one another. Use the updateStatus: method to update the HUD's status while maintaining all previously set presentation attributes such as image, images, cancelBlock, title, or confirmationMessage. For example: calling showWithTitle:status: after calling showWithTitle:status:image: will wipe out the image specified in the latter call. + + */ ++ (void)show; + + +/** Shows indeterminate HUD with specified title. + + @warning All show methods are mutually exclusive of one another. Use the updateStatus: method to update the HUD's status while maintaining all previously set presentation attributes such as image, images, cancelBlock, title, or confirmationMessage. For example: calling showWithTitle:status: after calling showWithTitle:status:image: will wipe out the image specified in the latter call. + + @param title Title to display. + */ ++ (void)showWithTitle:(NSString *)title; + + +/** Shows user-blocking HUD with only a status message. + + Since the title of this HUD is nil, the status message font will become bold by default. + + @warning All show methods are mutually exclusive of one another. Use the updateStatus: method to update the HUD's status while maintaining all previously set presentation attributes such as image, images, cancelBlock, title, or confirmationMessage. For example: calling showWithTitle:status: after calling showWithTitle:status:image: will wipe out the image specified in the latter call. + + @param status Status message to display. + */ ++ (void)showWithStatus:(NSString *)status; + + /** Shows indeterminate HUD with specified title and status. When the title of the HUD is nil, the status message font will become bold by default. @@ -301,16 +294,6 @@ This message will be presented to the user when a cancelBlock is present after t status:(NSString *)status images:(NSArray *)images; -/** Shows user-blocking HUD with only a status message. - - Since the title of this HUD is nil, the status message font will become bold by default. - - @warning All show methods are mutually exclusive of one another. Use the updateStatus: method to update the HUD's status while maintaining all previously set presentation attributes such as image, images, cancelBlock, title, or confirmationMessage. For example: calling showWithTitle:status: after calling showWithTitle:status:image: will wipe out the image specified in the latter call. - - @param status Status message to display. - */ -+ (void)showWithStatus:(NSString *)status; - //----------------------------------------------- /** @name Dismissal */ //----------------------------------------------- @@ -318,6 +301,12 @@ This message will be presented to the user when a cancelBlock is present after t /** Dismisses the shared HUD with the current presentationStyle and default delay. */ + (void)dismiss; + +/** Dismisses the shared HUD with the current presentationStyle and specified delay. + @param delay Delay to wait before animating the dismiss of the HUD. + */ ++ (void)dismissAfterDelay:(NSTimeInterval)delay; + #pragma mark - Dismiss with Error /** Dismisses the shared HUD with the current presentationStyle in an error-state after a user-specified delay. @@ -328,7 +317,7 @@ This message will be presented to the user when a cancelBlock is present after t */ + (void)dismissWithError:(NSString *)message title:(NSString *)title - afterDelay:(float)delay; + afterDelay:(NSTimeInterval)delay; /** Dismisses the shared HUD with the current presentationStyle in an error-state after a standard delay. @@ -350,7 +339,7 @@ This message will be presented to the user when a cancelBlock is present after t @param delay Delay to wait before animating the dismiss of the HUD. */ + (void)dismissWithError:(NSString *)message - afterDelay:(float)delay; + afterDelay:(NSTimeInterval)delay; #pragma mark - Dismiss with Success /** Dismisses the shared HUD with the current presentationStyle in a success-state after a user-specified delay. @@ -361,7 +350,7 @@ This message will be presented to the user when a cancelBlock is present after t */ + (void)dismissWithSuccess:(NSString *)message title:(NSString *)title - afterDelay:(float)delay; + afterDelay:(NSTimeInterval)delay; /** Dismisses the shared HUD with the current presentationStyle in a success-state. diff --git a/Source/MMProgressHUD.m b/Source/MMProgressHUD.m index cd1e67f..820e28d 100755 --- a/Source/MMProgressHUD.m +++ b/Source/MMProgressHUD.m @@ -20,24 +20,7 @@ #import "MMLinearProgressView.h" #import "MMRadialProgressView.h" -#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 -#error MMProgressHUD uses APIs only available in iOS 5.0+ -#endif - -static const BOOL kMMProgressHUDDebugMode = NO; - -NSString * const MMProgressHUDDefaultConfirmationMessage = @"Cancel?"; -NSString * const MMProgressHUDAnimationShow = @"mm-progress-hud-present-animation"; -NSString * const MMProgressHUDAnimationDismiss = @"mm-progress-hud-dismiss-animation"; -NSString * const MMProgressHUDAnimationWindowFadeOut = @"mm-progress-hud-window-fade-out"; -NSString * const MMProgressHUDAnimationKeyShowAnimation = @"show"; -NSString * const MMProgressHUDAnimationKeyDismissAnimation = @"dismiss"; - -NSUInteger const MMProgressHUDConfirmationPulseCount = 8;//Keep this number even - -CGFloat const MMProgressHUDStandardDismissDelay = 0.75f; - -CGSize const MMProgressHUDDefaultImageSize = {37.f, 37.f}; +#import "MMProgressHUDDefines-Private.h" #pragma mark - MMProgressHUD @interface MMProgressHUD () @@ -90,11 +73,11 @@ - (void)showDeterminateProgressWithTitle:(NSString *)title } - (void)showWithTitle:(NSString *)title - status:(NSString *)status + status:(NSString *)status confirmationMessage:(NSString *)confirmationMessage cancelBlock:(void(^)(void))cancelBlock images:(NSArray *)images { - + self.image = nil; self.animationImages = nil; @@ -105,22 +88,6 @@ - (void)showWithTitle:(NSString *)title self.animationImages = images; } - [self showWithTitle:title - status:status - confirmationMessage:confirmationMessage - cancelBlock:cancelBlock - indeterminate:self.hud.isIndeterminate]; -} - -- (void)showWithTitle:(NSString *)title - status:(NSString *)status - confirmationMessage:(NSString *)confirmationMessage - cancelBlock:(void(^)(void))cancelBlock - indeterminate:(BOOL)indeterminate { - - MMHudLog(@"Beginning %@ show...", NSStringFromClass(self.class)); - - self.hud.indeterminate = indeterminate; self.cancelBlock = cancelBlock; self.title = title; self.status = status; @@ -145,7 +112,7 @@ - (void)showWithTitle:(NSString *)title - (void)dismissWithCompletionState:(MMProgressHUDCompletionState)completionState title:(NSString *)title status:(NSString *)status - afterDelay:(float)delay { + afterDelay:(NSTimeInterval)delay { if (title) { self.title = title; } @@ -158,25 +125,9 @@ - (void)dismissWithCompletionState:(MMProgressHUDCompletionState)completionState if (self.isVisible) { [self _updateHUDAnimated:YES withCompletion:^(BOOL completed) { - if (delay != INFINITY && delay != DISPATCH_TIME_FOREVER) { - //create a timer in order to be cancellable - [self.dismissDelayTimer invalidate]; - self.dismissDelayTimer = [NSTimer scheduledTimerWithTimeInterval:delay - target:self - selector:@selector(dismiss) - userInfo:nil - repeats:NO]; - } + [self dismissAfterDelay:delay]; }]; } - else { - [self.dismissDelayTimer invalidate]; - self.dismissDelayTimer = [NSTimer scheduledTimerWithTimeInterval:delay - target:self - selector:@selector(dismiss) - userInfo:nil - repeats:NO]; - } } - (void)updateProgress:(CGFloat)progress withStatus:(NSString *)status title:(NSString *)title{ @@ -427,6 +378,8 @@ - (void)_buildHUD { self.hud.layer.transform = CATransform3DIdentity; + [self.hud setNeedsUpdate:YES]; + [self.hud applyLayoutFrames]; [self addSubview:self.hud]; @@ -560,6 +513,11 @@ - (void)show { }]; } +- (void)dismissAfterDelay:(NSTimeInterval)delay { + [self.dismissDelayTimer invalidate]; + self.dismissDelayTimer = [NSTimer scheduledTimerWithTimeInterval:delay target:self selector:@selector(dismiss) userInfo:nil repeats:NO]; +} + - (void)dismiss { NSAssert([NSThread isMainThread], @"Dismiss method should be run on main thread!"); @@ -600,14 +558,14 @@ - (void)dismiss { break; } - CGFloat duration = (self.presentationStyle == MMProgressHUDPresentationStyleNone) ? 0.f : MMProgressHUDAnimateOutDurationLong; - CGFloat delay = (self.presentationStyle == MMProgressHUDPresentationStyleDrop) ? MMProgressHUDAnimateOutDurationShort : 0.f; + NSTimeInterval duration = (self.presentationStyle == MMProgressHUDPresentationStyleNone) ? 0.0 : MMProgressHUDAnimateOutDurationLong; + NSTimeInterval delay = (self.presentationStyle == MMProgressHUDPresentationStyleDrop) ? MMProgressHUDAnimateOutDurationShort : 0.0; [UIView animateWithDuration:duration delay:delay options:UIViewAnimationOptionCurveEaseIn | - UIViewAnimationOptionBeginFromCurrentState + UIViewAnimationOptionBeginFromCurrentState animations:^{ self.overlayView.alpha = 0.f; } diff --git a/Source/MMProgressHUDDefines-Private.h b/Source/MMProgressHUDDefines-Private.h new file mode 100644 index 0000000..4e41919 --- /dev/null +++ b/Source/MMProgressHUDDefines-Private.h @@ -0,0 +1,67 @@ +// +// MMProgressHUDDefines-Private.h +// MMProgressHUDDemo +// +// Created by Jonas Gessner on 25.08.13. +// Copyright (c) 2013 Jonas Gessner. All rights reserved. +// + + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 +#error MMProgressHUD uses APIs only available in iOS 5.0+ +#endif + + +#import "MMProgressHUDDefines.h" + +#ifdef DEBUG +#ifdef MM_HUD_DEBUG +#define MMHudLog(fmt, ...) NSLog((@"%@ [line %u]: " fmt), NSStringFromClass(self.class), __LINE__, ##__VA_ARGS__) +#else +#define MMHudLog(...) +#endif +#else +#define MMHudLog(...) +#endif + +#define MMHudWLog(fmt, ...) NSLog((@"%@ WARNING [line %u]: " fmt), NSStringFromClass(self.class), __LINE__, ##__VA_ARGS__) + + +MMExtern BOOL const kMMProgressHUDDebugMode; + +MMExtern NSString * const MMProgressHUDDefaultConfirmationMessage; +MMExtern NSString * const MMProgressHUDAnimationShow; +MMExtern NSString * const MMProgressHUDAnimationDismiss; +MMExtern NSString * const MMProgressHUDAnimationWindowFadeOut; +MMExtern NSString * const MMProgressHUDAnimationKeyShowAnimation; +MMExtern NSString * const MMProgressHUDAnimationKeyDismissAnimation; + +MMExtern NSUInteger const MMProgressHUDConfirmationPulseCount;//Keep this number even + +MMExtern NSTimeInterval const MMProgressHUDStandardDismissDelay; + +MMExtern CGSize const MMProgressHUDDefaultImageSize; + + +MMExtern CGFloat const MMProgressHUDDefaultFontSize; + +MMExtern CGFloat const MMProgressHUDMaximumWidth; +MMExtern CGFloat const MMProgressHUDMinimumWidth; +MMExtern CGFloat const MMProgressHUDContentPadding; +MMExtern CGSize const MMProgressHUDDefaultContentAreaSize; +MMExtern CGSize const MMProgressHUDProgressContentAreaSize; +MMExtern CGSize const MMProgressHUDProgressMaximumAreaSize; + +MMExtern NSString * const MMProgressHUDFontNameBold; +MMExtern NSString * const MMProgressHUDFontNameNormal; + +#ifdef DEBUG +#ifdef MM_HUD_FRAME_DEBUG +MMExtern BOOL const MMProgressHUDFrameDebugModeEnabled; +#else +MMExtern BOOL const MMProgressHUDFrameDebugModeEnabled; +#endif +#else +MMExtern BOOL const MMProgressHUDFrameDebugModeEnabled; +#endif + diff --git a/Source/MMProgressHUDDefines-Private.m b/Source/MMProgressHUDDefines-Private.m new file mode 100644 index 0000000..49ac263 --- /dev/null +++ b/Source/MMProgressHUDDefines-Private.m @@ -0,0 +1,51 @@ +// +// MMProgressHUDDefines-Private.m +// MMProgressHUDDemo +// +// Created by Jonas Gessner on 25.08.13. +// Copyright (c) 2013 Jonas Gessner. All rights reserved. +// + +#import "MMProgressHUDDefines-Private.h" + + +BOOL const kMMProgressHUDDebugMode = NO; + +NSString * const MMProgressHUDDefaultConfirmationMessage = @"Cancel?"; +NSString * const MMProgressHUDAnimationShow = @"mm-progress-hud-present-animation"; +NSString * const MMProgressHUDAnimationDismiss = @"mm-progress-hud-dismiss-animation"; +NSString * const MMProgressHUDAnimationWindowFadeOut = @"mm-progress-hud-window-fade-out"; +NSString * const MMProgressHUDAnimationKeyShowAnimation = @"show"; +NSString * const MMProgressHUDAnimationKeyDismissAnimation = @"dismiss"; + + +NSUInteger const MMProgressHUDConfirmationPulseCount = 8;//Keep this number even + +NSTimeInterval const MMProgressHUDStandardDismissDelay = 0.75; + +CGSize const MMProgressHUDDefaultImageSize = {37.f, 37.f}; + + +CGFloat const MMProgressHUDDefaultFontSize = 16.f; + +CGFloat const MMProgressHUDMaximumWidth = 300.f; +CGFloat const MMProgressHUDMinimumWidth = 100.f; +CGFloat const MMProgressHUDContentPadding = 5.f; +CGSize const MMProgressHUDDefaultContentAreaSize = { 100.f, 100.f }; +CGSize const MMProgressHUDProgressContentAreaSize = { 40.f, 40.f }; +CGSize const MMProgressHUDProgressMaximumAreaSize = {200.0f, 200.0f}; + + +NSString * const MMProgressHUDFontNameBold = @"HelveticaNeue-Bold"; +NSString * const MMProgressHUDFontNameNormal = @"HelveticaNeue-Light"; + + +#ifdef DEBUG +#ifdef MM_HUD_FRAME_DEBUG +BOOL const MMProgressHUDFrameDebugModeEnabled; +#else +BOOL const MMProgressHUDFrameDebugModeEnabled; +#endif +#else +BOOL const MMProgressHUDFrameDebugModeEnabled; +#endif \ No newline at end of file diff --git a/Source/MMProgressHUDDefines.h b/Source/MMProgressHUDDefines.h index aeeda23..46def04 100644 --- a/Source/MMProgressHUDDefines.h +++ b/Source/MMProgressHUDDefines.h @@ -6,20 +6,61 @@ // Copyright (c) 2013 Jonas Gessner. All rights reserved. // -#ifdef DEBUG -#ifdef MM_HUD_DEBUG -#define MMHudLog(fmt, ...) NSLog((@"%@ [line %u]: " fmt), NSStringFromClass(self.class), __LINE__, ##__VA_ARGS__) -#else -#define MMHudLog(...) -#endif -#else -#define MMHudLog(...) -#endif +typedef NS_ENUM(NSInteger, MMProgressHUDPresentationStyle) { + MMProgressHUDPresentationStyleDrop = 0, //default + MMProgressHUDPresentationStyleExpand, + MMProgressHUDPresentationStyleShrink, + MMProgressHUDPresentationStyleSwingLeft, + MMProgressHUDPresentationStyleSwingRight, + MMProgressHUDPresentationStyleBalloon, + MMProgressHUDPresentationStyleFade, + MMProgressHUDPresentationStyleNone +}; + +typedef NS_ENUM(NSInteger, MMProgressHUDWindowOverlayMode) { + MMProgressHUDWindowOverlayModeNone = -1, + MMProgressHUDWindowOverlayModeGradient = 0, + MMProgressHUDWindowOverlayModeLinear, + /*MMProgressHUDWindowOverlayModeBlur*/ //iOS 7 only +}; + +typedef NS_ENUM(NSInteger, MMProgressHUDDisplayStyle) { + MMProgressHUDDisplayStylePlain = 0, + MMProgressHUDDisplayStyleBordered, +}; + +typedef NS_ENUM(NSInteger, MMProgressHUDProgressStyle) { + MMProgressHUDProgressStyleIndeterminate = 0, + MMProgressHUDProgressStyleRadial, + MMProgressHUDProgressStyleLinear, +} DEPRECATED_ATTRIBUTE; -#define MMHudWLog(fmt, ...) NSLog((@"%@ WARNING [line %u]: " fmt), NSStringFromClass(self.class), __LINE__, ##__VA_ARGS__) +typedef NS_ENUM(NSInteger, MMProgressHUDCompletionState) { + MMProgressHUDCompletionStateNone = 0, + MMProgressHUDCompletionStateError, + MMProgressHUDCompletionStateSuccess, +}; + +//iOS 7 only +//typedef NS_ENUM(NSInteger, MMProgressHUDOptions) { +// MMProgressHUDOptionGravityEnabled = 1 << 0, +// MMProgressHUDOptionGyroEnabled = 1 << 1, +//}; #ifdef __cplusplus #define MMExtern extern "C" #else #define MMExtern extern -#endif \ No newline at end of file +#endif + +MMExtern NSTimeInterval const MMProgressHUDAnimateInDurationLong; +MMExtern NSTimeInterval const MMProgressHUDAnimateInDurationMedium; +MMExtern NSTimeInterval const MMProgressHUDAnimateInDurationNormal; +MMExtern NSTimeInterval const MMProgressHUDAnimateInDurationShort; +MMExtern NSTimeInterval const MMProgressHUDAnimateInDurationVeryShort; + +MMExtern NSTimeInterval const MMProgressHUDAnimateOutDurationLong; +MMExtern NSTimeInterval const MMProgressHUDAnimateOutDurationMedium; +MMExtern NSTimeInterval const MMProgressHUDAnimateOutDurationShort; + + diff --git a/Source/MMProgressHUDDefines.m b/Source/MMProgressHUDDefines.m new file mode 100644 index 0000000..91853ea --- /dev/null +++ b/Source/MMProgressHUDDefines.m @@ -0,0 +1,20 @@ +// +// MMProgressHUDDefines.m +// MMProgressHUDDemo +// +// Created by Jonas Gessner on 25.08.13. +// Copyright (c) 2013 Jonas Gessner. All rights reserved. +// + +#import "MMProgressHUDDefines.h" + +NSTimeInterval const MMProgressHUDAnimateInDurationLong = 1.5; +NSTimeInterval const MMProgressHUDAnimateInDurationMedium = 0.75; +NSTimeInterval const MMProgressHUDAnimateInDurationNormal = 0.35; +NSTimeInterval const MMProgressHUDAnimateInDurationShort = 0.25; +NSTimeInterval const MMProgressHUDAnimateInDurationVeryShort = 0.15; + +NSTimeInterval const MMProgressHUDAnimateOutDurationLong = 0.75; +NSTimeInterval const MMProgressHUDAnimateOutDurationMedium = 0.55; +NSTimeInterval const MMProgressHUDAnimateOutDurationShort = 0.35; + diff --git a/Source/MMProgressHUDViewController.m b/Source/MMProgressHUDViewController.m index 0a2dca2..8364ecb 100755 --- a/Source/MMProgressHUDViewController.m +++ b/Source/MMProgressHUDViewController.m @@ -10,6 +10,8 @@ #import "MMProgressHUDWindow.h" #import "MMProgressHUD.h" +#import "MMProgressHUDDefines-Private.h" + #define suppressDeprecation(Stuff) \ do { \ diff --git a/Source/MMProgressHUDWindow.m b/Source/MMProgressHUDWindow.m index d094066..0023dac 100755 --- a/Source/MMProgressHUDWindow.m +++ b/Source/MMProgressHUDWindow.m @@ -8,6 +8,8 @@ #import "MMProgressHUDWindow.h" +#import "MMProgressHUDDefines-Private.h" + @implementation MMProgressHUDWindow - (instancetype)init { diff --git a/Source/MMProgressView.h b/Source/MMProgressView-Protocol.h similarity index 100% rename from Source/MMProgressView.h rename to Source/MMProgressView-Protocol.h diff --git a/Source/MMRadialProgressView.h b/Source/MMRadialProgressView.h index e860d3c..f96d545 100755 --- a/Source/MMRadialProgressView.h +++ b/Source/MMRadialProgressView.h @@ -7,7 +7,7 @@ // #import -#import "MMProgressView.h" +#import "MMProgressView-Protocol.h" @interface MMRadialProgressView : UIView