├── .gitignore ├── HudOSXDemo ├── HudOSXDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── HudOSXDemo.xccheckout │ │ └── xcuserdata │ │ │ └── waynesfox.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── WorkspaceSettings.xcsettings │ └── xcuserdata │ │ └── waynesfox.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── HudOSXDemo.xcscheme │ │ └── xcschememanagement.plist └── HudOSXDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── HudOSXDemo-Info.plist │ ├── HudOSXDemo-Prefix.pch │ ├── HudOSXDemoViewController.h │ ├── HudOSXDemoViewController.m │ ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib │ └── main.m ├── HudiOSDemo ├── Classes │ ├── HudDemoAppDelegate.h │ ├── HudDemoAppDelegate.m │ ├── HudDemoViewController.h │ └── HudDemoViewController.m ├── HudDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── HudDemo.xccheckout │ │ └── xcuserdata │ │ │ └── waynesfox.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── WorkspaceSettings.xcsettings │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── HudDemo.xcscheme │ └── xcuserdata │ │ └── waynesfox.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── HudDemo_Prefix.pch ├── Images │ ├── 37x-Checkmark.png │ ├── 37x-Checkmark@2x.png │ ├── Default-568h@2x.png │ ├── Default-iOS7-568h@2x.png │ ├── Default-iOS7@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── Icon-Small.png │ ├── Icon-Small@2x.png │ ├── Icon-iOS7@2x.png │ ├── Icon.png │ └── Icon@2x.png ├── Info.plist ├── en.lproj │ ├── HudDemoViewController.xib │ └── MainWindow.xib └── main.m ├── LICENSE ├── MBProgressHUD.h ├── MBProgressHUD.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # CocoaPods 2 | # 3 | # We recommend against adding the Pods directory to your .gitignore. However 4 | # you should judge for yourself, the pros and cons are mentioned at: 5 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control? 6 | # 7 | # Pods/ 8 | 9 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B236132D18FE81EE00B2F547 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B236132C18FE81EE00B2F547 /* Cocoa.framework */; }; 11 | B236133718FE81EE00B2F547 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B236133518FE81EE00B2F547 /* InfoPlist.strings */; }; 12 | B236133918FE81EE00B2F547 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B236133818FE81EE00B2F547 /* main.m */; }; 13 | B236133D18FE81EE00B2F547 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = B236133B18FE81EE00B2F547 /* Credits.rtf */; }; 14 | B236134018FE81EE00B2F547 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B236133F18FE81EE00B2F547 /* AppDelegate.m */; }; 15 | B236134318FE81EE00B2F547 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = B236134118FE81EE00B2F547 /* MainMenu.xib */; }; 16 | B236134518FE81EE00B2F547 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B236134418FE81EE00B2F547 /* Images.xcassets */; }; 17 | B236136218FE848200B2F547 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = B236136118FE848200B2F547 /* MBProgressHUD.m */; }; 18 | B236138018FE85BA00B2F547 /* HudOSXDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B236137F18FE85BA00B2F547 /* HudOSXDemoViewController.m */; }; 19 | B2ED02EA1980BE4600C6CE12 /* 37x-Checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02DE1980BE4600C6CE12 /* 37x-Checkmark.png */; }; 20 | B2ED02EB1980BE4600C6CE12 /* 37x-Checkmark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02DF1980BE4600C6CE12 /* 37x-Checkmark@2x.png */; }; 21 | B2ED02EC1980BE4600C6CE12 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E01980BE4600C6CE12 /* Default-568h@2x.png */; }; 22 | B2ED02ED1980BE4600C6CE12 /* Default-iOS7-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E11980BE4600C6CE12 /* Default-iOS7-568h@2x.png */; }; 23 | B2ED02EE1980BE4600C6CE12 /* Default-iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E21980BE4600C6CE12 /* Default-iOS7@2x.png */; }; 24 | B2ED02EF1980BE4600C6CE12 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E31980BE4600C6CE12 /* Default.png */; }; 25 | B2ED02F01980BE4600C6CE12 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E41980BE4600C6CE12 /* Default@2x.png */; }; 26 | B2ED02F11980BE4600C6CE12 /* Icon-iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E51980BE4600C6CE12 /* Icon-iOS7@2x.png */; }; 27 | B2ED02F21980BE4600C6CE12 /* Icon-Small.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E61980BE4600C6CE12 /* Icon-Small.png */; }; 28 | B2ED02F31980BE4600C6CE12 /* Icon-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E71980BE4600C6CE12 /* Icon-Small@2x.png */; }; 29 | B2ED02F41980BE4600C6CE12 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E81980BE4600C6CE12 /* Icon.png */; }; 30 | B2ED02F51980BE4600C6CE12 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B2ED02E91980BE4600C6CE12 /* Icon@2x.png */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | B236132918FE81EE00B2F547 /* HudOSXDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HudOSXDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | B236132C18FE81EE00B2F547 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 36 | B236132F18FE81EE00B2F547 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 37 | B236133018FE81EE00B2F547 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 38 | B236133118FE81EE00B2F547 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 39 | B236133418FE81EE00B2F547 /* HudOSXDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HudOSXDemo-Info.plist"; sourceTree = ""; }; 40 | B236133618FE81EE00B2F547 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 41 | B236133818FE81EE00B2F547 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 42 | B236133A18FE81EE00B2F547 /* HudOSXDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HudOSXDemo-Prefix.pch"; sourceTree = ""; }; 43 | B236133C18FE81EE00B2F547 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 44 | B236133E18FE81EE00B2F547 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | B236133F18FE81EE00B2F547 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | B236134418FE81EE00B2F547 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 47 | B236136018FE848200B2F547 /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBProgressHUD.h; path = ../../MBProgressHUD.h; sourceTree = ""; }; 48 | B236136118FE848200B2F547 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MBProgressHUD.m; path = ../../MBProgressHUD.m; sourceTree = ""; }; 49 | B236137E18FE85BA00B2F547 /* HudOSXDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HudOSXDemoViewController.h; sourceTree = ""; }; 50 | B236137F18FE85BA00B2F547 /* HudOSXDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HudOSXDemoViewController.m; sourceTree = ""; }; 51 | B236138518FEBFEB00B2F547 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 52 | B27CDDFE1985E2750034E045 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../../README.md; sourceTree = ""; }; 53 | B2ED02DE1980BE4600C6CE12 /* 37x-Checkmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "37x-Checkmark.png"; path = "../HudiOSDemo/Images/37x-Checkmark.png"; sourceTree = ""; }; 54 | B2ED02DF1980BE4600C6CE12 /* 37x-Checkmark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "37x-Checkmark@2x.png"; path = "../HudiOSDemo/Images/37x-Checkmark@2x.png"; sourceTree = ""; }; 55 | B2ED02E01980BE4600C6CE12 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../HudiOSDemo/Images/Default-568h@2x.png"; sourceTree = ""; }; 56 | B2ED02E11980BE4600C6CE12 /* Default-iOS7-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-iOS7-568h@2x.png"; path = "../HudiOSDemo/Images/Default-iOS7-568h@2x.png"; sourceTree = ""; }; 57 | B2ED02E21980BE4600C6CE12 /* Default-iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-iOS7@2x.png"; path = "../HudiOSDemo/Images/Default-iOS7@2x.png"; sourceTree = ""; }; 58 | B2ED02E31980BE4600C6CE12 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = ../HudiOSDemo/Images/Default.png; sourceTree = ""; }; 59 | B2ED02E41980BE4600C6CE12 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "../HudiOSDemo/Images/Default@2x.png"; sourceTree = ""; }; 60 | B2ED02E51980BE4600C6CE12 /* Icon-iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-iOS7@2x.png"; path = "../HudiOSDemo/Images/Icon-iOS7@2x.png"; sourceTree = ""; }; 61 | B2ED02E61980BE4600C6CE12 /* Icon-Small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-Small.png"; path = "../HudiOSDemo/Images/Icon-Small.png"; sourceTree = ""; }; 62 | B2ED02E71980BE4600C6CE12 /* Icon-Small@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-Small@2x.png"; path = "../HudiOSDemo/Images/Icon-Small@2x.png"; sourceTree = ""; }; 63 | B2ED02E81980BE4600C6CE12 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../HudiOSDemo/Images/Icon.png; sourceTree = ""; }; 64 | B2ED02E91980BE4600C6CE12 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../HudiOSDemo/Images/Icon@2x.png"; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | B236132618FE81EE00B2F547 /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | B236132D18FE81EE00B2F547 /* Cocoa.framework in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | B236132018FE81EE00B2F547 = { 80 | isa = PBXGroup; 81 | children = ( 82 | B236133218FE81EE00B2F547 /* HudOSXDemo */, 83 | B236136318FE84A000B2F547 /* Resources */, 84 | B236132B18FE81EE00B2F547 /* Frameworks */, 85 | B236132A18FE81EE00B2F547 /* Products */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | B236132A18FE81EE00B2F547 /* Products */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | B236132918FE81EE00B2F547 /* HudOSXDemo.app */, 93 | ); 94 | name = Products; 95 | sourceTree = ""; 96 | }; 97 | B236132B18FE81EE00B2F547 /* Frameworks */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | B236132C18FE81EE00B2F547 /* Cocoa.framework */, 101 | B236132E18FE81EE00B2F547 /* Other Frameworks */, 102 | ); 103 | name = Frameworks; 104 | sourceTree = ""; 105 | }; 106 | B236132E18FE81EE00B2F547 /* Other Frameworks */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | B236132F18FE81EE00B2F547 /* AppKit.framework */, 110 | B236133018FE81EE00B2F547 /* CoreData.framework */, 111 | B236133118FE81EE00B2F547 /* Foundation.framework */, 112 | ); 113 | name = "Other Frameworks"; 114 | sourceTree = ""; 115 | }; 116 | B236133218FE81EE00B2F547 /* HudOSXDemo */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | B236133E18FE81EE00B2F547 /* AppDelegate.h */, 120 | B236133F18FE81EE00B2F547 /* AppDelegate.m */, 121 | B236137E18FE85BA00B2F547 /* HudOSXDemoViewController.h */, 122 | B236137F18FE85BA00B2F547 /* HudOSXDemoViewController.m */, 123 | B236136018FE848200B2F547 /* MBProgressHUD.h */, 124 | B236136118FE848200B2F547 /* MBProgressHUD.m */, 125 | B236134418FE81EE00B2F547 /* Images.xcassets */, 126 | B236133318FE81EE00B2F547 /* Supporting Files */, 127 | ); 128 | path = HudOSXDemo; 129 | sourceTree = ""; 130 | }; 131 | B236133318FE81EE00B2F547 /* Supporting Files */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | B27CDDFE1985E2750034E045 /* README.md */, 135 | B236133418FE81EE00B2F547 /* HudOSXDemo-Info.plist */, 136 | B236133518FE81EE00B2F547 /* InfoPlist.strings */, 137 | B236133818FE81EE00B2F547 /* main.m */, 138 | B236133A18FE81EE00B2F547 /* HudOSXDemo-Prefix.pch */, 139 | B236133B18FE81EE00B2F547 /* Credits.rtf */, 140 | ); 141 | name = "Supporting Files"; 142 | sourceTree = ""; 143 | }; 144 | B236136318FE84A000B2F547 /* Resources */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | B236136418FE84BB00B2F547 /* UI */, 148 | B236136518FE84C800B2F547 /* Images */, 149 | ); 150 | name = Resources; 151 | sourceTree = ""; 152 | }; 153 | B236136418FE84BB00B2F547 /* UI */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | B236134118FE81EE00B2F547 /* MainMenu.xib */, 157 | ); 158 | name = UI; 159 | sourceTree = ""; 160 | }; 161 | B236136518FE84C800B2F547 /* Images */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | B2ED02DE1980BE4600C6CE12 /* 37x-Checkmark.png */, 165 | B2ED02DF1980BE4600C6CE12 /* 37x-Checkmark@2x.png */, 166 | B2ED02E01980BE4600C6CE12 /* Default-568h@2x.png */, 167 | B2ED02E11980BE4600C6CE12 /* Default-iOS7-568h@2x.png */, 168 | B2ED02E21980BE4600C6CE12 /* Default-iOS7@2x.png */, 169 | B2ED02E31980BE4600C6CE12 /* Default.png */, 170 | B2ED02E41980BE4600C6CE12 /* Default@2x.png */, 171 | B2ED02E51980BE4600C6CE12 /* Icon-iOS7@2x.png */, 172 | B2ED02E61980BE4600C6CE12 /* Icon-Small.png */, 173 | B2ED02E71980BE4600C6CE12 /* Icon-Small@2x.png */, 174 | B2ED02E81980BE4600C6CE12 /* Icon.png */, 175 | B2ED02E91980BE4600C6CE12 /* Icon@2x.png */, 176 | ); 177 | name = Images; 178 | sourceTree = ""; 179 | }; 180 | /* End PBXGroup section */ 181 | 182 | /* Begin PBXNativeTarget section */ 183 | B236132818FE81EE00B2F547 /* HudOSXDemo */ = { 184 | isa = PBXNativeTarget; 185 | buildConfigurationList = B236135A18FE81EE00B2F547 /* Build configuration list for PBXNativeTarget "HudOSXDemo" */; 186 | buildPhases = ( 187 | B236132518FE81EE00B2F547 /* Sources */, 188 | B236132618FE81EE00B2F547 /* Frameworks */, 189 | B236132718FE81EE00B2F547 /* Resources */, 190 | ); 191 | buildRules = ( 192 | ); 193 | dependencies = ( 194 | ); 195 | name = HudOSXDemo; 196 | productName = HudOSXDemo; 197 | productReference = B236132918FE81EE00B2F547 /* HudOSXDemo.app */; 198 | productType = "com.apple.product-type.application"; 199 | }; 200 | /* End PBXNativeTarget section */ 201 | 202 | /* Begin PBXProject section */ 203 | B236132118FE81EE00B2F547 /* Project object */ = { 204 | isa = PBXProject; 205 | attributes = { 206 | LastUpgradeCheck = 0610; 207 | ORGANIZATIONNAME = "Wayne Fox"; 208 | }; 209 | buildConfigurationList = B236132418FE81EE00B2F547 /* Build configuration list for PBXProject "HudOSXDemo" */; 210 | compatibilityVersion = "Xcode 3.2"; 211 | developmentRegion = English; 212 | hasScannedForEncodings = 0; 213 | knownRegions = ( 214 | en, 215 | Base, 216 | ); 217 | mainGroup = B236132018FE81EE00B2F547; 218 | productRefGroup = B236132A18FE81EE00B2F547 /* Products */; 219 | projectDirPath = ""; 220 | projectRoot = ""; 221 | targets = ( 222 | B236132818FE81EE00B2F547 /* HudOSXDemo */, 223 | ); 224 | }; 225 | /* End PBXProject section */ 226 | 227 | /* Begin PBXResourcesBuildPhase section */ 228 | B236132718FE81EE00B2F547 /* Resources */ = { 229 | isa = PBXResourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | B2ED02F41980BE4600C6CE12 /* Icon.png in Resources */, 233 | B236133718FE81EE00B2F547 /* InfoPlist.strings in Resources */, 234 | B2ED02EA1980BE4600C6CE12 /* 37x-Checkmark.png in Resources */, 235 | B2ED02F21980BE4600C6CE12 /* Icon-Small.png in Resources */, 236 | B2ED02F31980BE4600C6CE12 /* Icon-Small@2x.png in Resources */, 237 | B236134518FE81EE00B2F547 /* Images.xcassets in Resources */, 238 | B2ED02EB1980BE4600C6CE12 /* 37x-Checkmark@2x.png in Resources */, 239 | B2ED02F51980BE4600C6CE12 /* Icon@2x.png in Resources */, 240 | B2ED02F01980BE4600C6CE12 /* Default@2x.png in Resources */, 241 | B236133D18FE81EE00B2F547 /* Credits.rtf in Resources */, 242 | B236134318FE81EE00B2F547 /* MainMenu.xib in Resources */, 243 | B2ED02EC1980BE4600C6CE12 /* Default-568h@2x.png in Resources */, 244 | B2ED02EE1980BE4600C6CE12 /* Default-iOS7@2x.png in Resources */, 245 | B2ED02ED1980BE4600C6CE12 /* Default-iOS7-568h@2x.png in Resources */, 246 | B2ED02F11980BE4600C6CE12 /* Icon-iOS7@2x.png in Resources */, 247 | B2ED02EF1980BE4600C6CE12 /* Default.png in Resources */, 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | /* End PBXResourcesBuildPhase section */ 252 | 253 | /* Begin PBXSourcesBuildPhase section */ 254 | B236132518FE81EE00B2F547 /* Sources */ = { 255 | isa = PBXSourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | B236138018FE85BA00B2F547 /* HudOSXDemoViewController.m in Sources */, 259 | B236134018FE81EE00B2F547 /* AppDelegate.m in Sources */, 260 | B236136218FE848200B2F547 /* MBProgressHUD.m in Sources */, 261 | B236133918FE81EE00B2F547 /* main.m in Sources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | /* End PBXSourcesBuildPhase section */ 266 | 267 | /* Begin PBXVariantGroup section */ 268 | B236133518FE81EE00B2F547 /* InfoPlist.strings */ = { 269 | isa = PBXVariantGroup; 270 | children = ( 271 | B236133618FE81EE00B2F547 /* en */, 272 | ); 273 | name = InfoPlist.strings; 274 | sourceTree = ""; 275 | }; 276 | B236133B18FE81EE00B2F547 /* Credits.rtf */ = { 277 | isa = PBXVariantGroup; 278 | children = ( 279 | B236133C18FE81EE00B2F547 /* en */, 280 | ); 281 | name = Credits.rtf; 282 | sourceTree = ""; 283 | }; 284 | B236134118FE81EE00B2F547 /* MainMenu.xib */ = { 285 | isa = PBXVariantGroup; 286 | children = ( 287 | B236138518FEBFEB00B2F547 /* en */, 288 | ); 289 | name = MainMenu.xib; 290 | path = HudOSXDemo; 291 | sourceTree = ""; 292 | }; 293 | /* End PBXVariantGroup section */ 294 | 295 | /* Begin XCBuildConfiguration section */ 296 | B236135818FE81EE00B2F547 /* Debug */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | ALWAYS_SEARCH_USER_PATHS = NO; 300 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 301 | CLANG_CXX_LIBRARY = "libc++"; 302 | CLANG_ENABLE_MODULES = YES; 303 | CLANG_ENABLE_OBJC_ARC = YES; 304 | CLANG_WARN_BOOL_CONVERSION = YES; 305 | CLANG_WARN_CONSTANT_CONVERSION = YES; 306 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 307 | CLANG_WARN_EMPTY_BODY = YES; 308 | CLANG_WARN_ENUM_CONVERSION = YES; 309 | CLANG_WARN_INT_CONVERSION = YES; 310 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 311 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 312 | COPY_PHASE_STRIP = NO; 313 | GCC_C_LANGUAGE_STANDARD = gnu99; 314 | GCC_DYNAMIC_NO_PIC = NO; 315 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 316 | GCC_OPTIMIZATION_LEVEL = 0; 317 | GCC_PREPROCESSOR_DEFINITIONS = ( 318 | "DEBUG=1", 319 | "$(inherited)", 320 | ); 321 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 322 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 323 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 324 | GCC_WARN_UNDECLARED_SELECTOR = YES; 325 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 326 | GCC_WARN_UNUSED_FUNCTION = YES; 327 | GCC_WARN_UNUSED_VARIABLE = YES; 328 | MACOSX_DEPLOYMENT_TARGET = 10.7; 329 | ONLY_ACTIVE_ARCH = YES; 330 | SDKROOT = macosx; 331 | }; 332 | name = Debug; 333 | }; 334 | B236135918FE81EE00B2F547 /* Release */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | ALWAYS_SEARCH_USER_PATHS = NO; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 345 | CLANG_WARN_EMPTY_BODY = YES; 346 | CLANG_WARN_ENUM_CONVERSION = YES; 347 | CLANG_WARN_INT_CONVERSION = YES; 348 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 349 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 350 | COPY_PHASE_STRIP = YES; 351 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 352 | ENABLE_NS_ASSERTIONS = NO; 353 | GCC_C_LANGUAGE_STANDARD = gnu99; 354 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 355 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 356 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 357 | GCC_WARN_UNDECLARED_SELECTOR = YES; 358 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 359 | GCC_WARN_UNUSED_FUNCTION = YES; 360 | GCC_WARN_UNUSED_VARIABLE = YES; 361 | MACOSX_DEPLOYMENT_TARGET = 10.7; 362 | SDKROOT = macosx; 363 | }; 364 | name = Release; 365 | }; 366 | B236135B18FE81EE00B2F547 /* Debug */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 370 | COMBINE_HIDPI_IMAGES = YES; 371 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 372 | GCC_PREFIX_HEADER = "HudOSXDemo/HudOSXDemo-Prefix.pch"; 373 | INFOPLIST_FILE = "HudOSXDemo/HudOSXDemo-Info.plist"; 374 | PRODUCT_NAME = "$(TARGET_NAME)"; 375 | WRAPPER_EXTENSION = app; 376 | }; 377 | name = Debug; 378 | }; 379 | B236135C18FE81EE00B2F547 /* Release */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 383 | COMBINE_HIDPI_IMAGES = YES; 384 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 385 | GCC_PREFIX_HEADER = "HudOSXDemo/HudOSXDemo-Prefix.pch"; 386 | INFOPLIST_FILE = "HudOSXDemo/HudOSXDemo-Info.plist"; 387 | PRODUCT_NAME = "$(TARGET_NAME)"; 388 | WRAPPER_EXTENSION = app; 389 | }; 390 | name = Release; 391 | }; 392 | /* End XCBuildConfiguration section */ 393 | 394 | /* Begin XCConfigurationList section */ 395 | B236132418FE81EE00B2F547 /* Build configuration list for PBXProject "HudOSXDemo" */ = { 396 | isa = XCConfigurationList; 397 | buildConfigurations = ( 398 | B236135818FE81EE00B2F547 /* Debug */, 399 | B236135918FE81EE00B2F547 /* Release */, 400 | ); 401 | defaultConfigurationIsVisible = 0; 402 | defaultConfigurationName = Release; 403 | }; 404 | B236135A18FE81EE00B2F547 /* Build configuration list for PBXNativeTarget "HudOSXDemo" */ = { 405 | isa = XCConfigurationList; 406 | buildConfigurations = ( 407 | B236135B18FE81EE00B2F547 /* Debug */, 408 | B236135C18FE81EE00B2F547 /* Release */, 409 | ); 410 | defaultConfigurationIsVisible = 0; 411 | defaultConfigurationName = Release; 412 | }; 413 | /* End XCConfigurationList section */ 414 | }; 415 | rootObject = B236132118FE81EE00B2F547 /* Project object */; 416 | } 417 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo.xcodeproj/project.xcworkspace/xcshareddata/HudOSXDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 49A1269C-243B-4C76-9001-39DB5028DE88 9 | IDESourceControlProjectName 10 | HudOSXDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 9216234465E28AF4110CA9480EA255273B2C94F7 14 | https://github.com/Foxnolds/MBProgressHUD-OSX.git 15 | 16 | IDESourceControlProjectPath 17 | HudOSXDemo/HudOSXDemo.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 9216234465E28AF4110CA9480EA255273B2C94F7 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/Foxnolds/MBProgressHUD-OSX.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 9216234465E28AF4110CA9480EA255273B2C94F7 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 9216234465E28AF4110CA9480EA255273B2C94F7 36 | IDESourceControlWCCName 37 | MBProgressHUD-OSX 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo.xcodeproj/project.xcworkspace/xcuserdata/waynesfox.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudOSXDemo/HudOSXDemo.xcodeproj/project.xcworkspace/xcuserdata/waynesfox.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo.xcodeproj/project.xcworkspace/xcuserdata/waynesfox.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo.xcodeproj/xcuserdata/waynesfox.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo.xcodeproj/xcuserdata/waynesfox.xcuserdatad/xcschemes/HudOSXDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo.xcodeproj/xcuserdata/waynesfox.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | HudOSXDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B236132818FE81EE00B2F547 16 | 17 | primary 18 | 19 | 20 | B236134918FE81EE00B2F547 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HudOSXDemo 4 | // 5 | // Created by Wayne Fox on 16/04/2014. 6 | // Copyright (c) 2014 Wayne Fox. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HudOSXDemoViewController.h" 11 | 12 | @interface AppDelegate : NSObject 13 | { 14 | IBOutlet NSWindow *window; 15 | IBOutlet HudOSXDemoViewController* viewController; 16 | } 17 | 18 | @property (nonatomic, strong) IBOutlet NSWindow *window; 19 | @property (nonatomic, strong) IBOutlet HudOSXDemoViewController* viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HudOSXDemo 4 | // 5 | // Created by Wayne Fox on 16/04/2014. 6 | // Copyright (c) 2014 Wayne Fox. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | @synthesize window; 14 | @synthesize viewController; 15 | 16 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 17 | { 18 | // Insert code here to initialize your application 19 | NSMenu* mainMenu = [[NSApplication sharedApplication] mainMenu]; 20 | NSMenuItem* helpMenuItem = [mainMenu itemAtIndex:[mainMenu numberOfItems]-1]; 21 | #ifdef DEBUG 22 | NSLog(@"[Line %d] %s MenuTitle: %@ now hidden", __LINE__, __FUNCTION__, helpMenuItem.title); 23 | #endif // DEBUG 24 | helpMenuItem.hidden = YES; 25 | } 26 | 27 | - (void)dealloc { 28 | #if !__has_feature(objc_arc) 29 | [viewController release]; 30 | [window release]; 31 | [super dealloc]; 32 | #endif 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/HudOSXDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | wf.${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 25 | LSApplicationCategoryType 26 | public.app-category.utilities 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSHumanReadableCopyright 30 | Copyright © 2014 Wayne Fox. All rights reserved. 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/HudOSXDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/HudOSXDemoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HudDemoViewController.h 3 | // HudDemo 4 | // 5 | // Created by Matej Bukovinski on 30.9.09. 6 | // Copyright bukovinski.com 2009. All rights reserved. 7 | // 8 | 9 | // #import 10 | #import 11 | #import 12 | #import "MBProgressHUD.h" 13 | 14 | @interface HudOSXDemoViewController : NSViewController { 15 | MBProgressHUD *HUD; 16 | 17 | long long expectedLength; 18 | long long currentLength; 19 | } 20 | 21 | - (IBAction)showSimple:(id)sender; 22 | - (IBAction)showWithLabel:(id)sender; 23 | - (IBAction)showWithDetailsLabel:(id)sender; 24 | - (IBAction)showWithLabelDeterminate:(id)sender; 25 | - (IBAction)showWIthLabelAnnularDeterminate:(id)sender; 26 | - (IBAction)showWithLabelDeterminateHorizontalBar:(id)sender; 27 | - (IBAction)showWithCustomView:(id)sender; 28 | - (IBAction)showWithLabelMixed:(id)sender; 29 | - (IBAction)showUsingBlocks:(id)sender; 30 | - (IBAction)showOnWindow:(id)sender; 31 | - (IBAction)showURL:(id)sender; 32 | 33 | - (void)myTask; 34 | - (void)myProgressTask; 35 | - (void)myMixedTask; 36 | 37 | @end 38 | 39 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/HudOSXDemoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HudDemoViewController.m 3 | // HudDemo 4 | // 5 | // Created by Matej Bukovinski on 30.9.09. 6 | // Copyright bukovinski.com 2009. All rights reserved. 7 | // 8 | 9 | #import "HudOSXDemoViewController.h" 10 | #import 11 | 12 | #if __has_feature(objc_arc) 13 | #define MB_AUTORELEASE(exp) exp 14 | #define MB_RELEASE(exp) exp 15 | #define MB_RETAIN(exp) exp 16 | #else 17 | #define MB_AUTORELEASE(exp) [exp autorelease] 18 | #define MB_RELEASE(exp) [exp release] 19 | #define MB_RETAIN(exp) [exp retain] 20 | #endif 21 | 22 | 23 | #define SCREENSHOT_MODE 0 24 | 25 | 26 | @implementation HudOSXDemoViewController 27 | 28 | #pragma mark - 29 | #pragma mark Lifecycle methods 30 | 31 | //- (void)viewDidLoad { 32 | // NSView *content = [[self.view subviews] objectAtIndex:0]; 33 | //#if SCREENSHOT_MODE 34 | // [content.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; 35 | //#endif 36 | // ((NSScrollView *)self.view).contentSize = content.bounds.size; 37 | //} 38 | 39 | //- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 40 | // return YES; 41 | //} 42 | 43 | //- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { 44 | // UIView *content = [[self.view subviews] objectAtIndex:0]; 45 | // ((UIScrollView *)self.view).contentSize = content.bounds.size; 46 | //} 47 | 48 | - (void)dealloc { 49 | #if !__has_feature(objc_arc) 50 | [super dealloc]; 51 | #endif 52 | } 53 | 54 | #pragma mark - 55 | #pragma mark IBActions 56 | 57 | - (IBAction)showSimple:(id)sender { 58 | // The hud will dispable all input on the view (use the higest view possible in the view hierarchy) 59 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 60 | [self.view addSubview:HUD]; 61 | 62 | // Regiser for HUD callbacks so we can remove it from the window at the right time 63 | HUD.delegate = self; 64 | 65 | // Show the HUD while the provided method executes in a new thread 66 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 67 | } 68 | 69 | - (IBAction)showWithLabel:(id)sender { 70 | 71 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 72 | [self.view addSubview:HUD]; 73 | 74 | HUD.delegate = self; 75 | HUD.labelText = @"Loading"; 76 | 77 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 78 | } 79 | 80 | - (IBAction)showWithDetailsLabel:(id)sender { 81 | 82 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 83 | [self.view addSubview:HUD]; 84 | 85 | HUD.delegate = self; 86 | HUD.labelText = @"Loading"; 87 | HUD.detailsLabelText = @"updating data"; 88 | HUD.square = YES; 89 | 90 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 91 | } 92 | 93 | - (IBAction)showWithLabelDeterminate:(id)sender { 94 | 95 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 96 | [self.view addSubview:HUD]; 97 | 98 | // Set determinate mode 99 | HUD.mode = MBProgressHUDModeDeterminate; 100 | 101 | HUD.delegate = self; 102 | HUD.labelText = @"Loading"; 103 | 104 | // myProgressTask uses the HUD instance to update progress 105 | [HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES]; 106 | } 107 | 108 | - (IBAction)showWIthLabelAnnularDeterminate:(id)sender { 109 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 110 | [self.view addSubview:HUD]; 111 | 112 | // Set determinate mode 113 | HUD.mode = MBProgressHUDModeAnnularDeterminate; 114 | 115 | HUD.delegate = self; 116 | HUD.labelText = @"Loading"; 117 | 118 | // myProgressTask uses the HUD instance to update progress 119 | [HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES]; 120 | } 121 | 122 | - (IBAction)showWithLabelDeterminateHorizontalBar:(id)sender { 123 | 124 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 125 | [self.view addSubview:HUD]; 126 | 127 | // Set determinate bar mode 128 | HUD.mode = MBProgressHUDModeDeterminateHorizontalBar; 129 | 130 | HUD.delegate = self; 131 | 132 | // myProgressTask uses the HUD instance to update progress 133 | [HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES]; 134 | } 135 | 136 | - (IBAction)showWithCustomView:(id)sender { 137 | 138 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 139 | [self.view addSubview:HUD]; 140 | 141 | // The sample image is based on the work by http://www.pixelpressicons.com, http://creativecommons.org/licenses/by/2.5/ca/ 142 | // Make the customViews 37 by 37 pixels for best results (those are the bounds of the build-in progress indicators) 143 | HUD.customView = MB_AUTORELEASE([[NSImageView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, 37.0f, 37.0f)]); 144 | NSImage *img = [NSImage imageNamed:@"37x-Checkmark"]; 145 | if (!img) img = [NSImage imageNamed:@"37x-Checkmark.png"]; 146 | [(NSImageView *)HUD.customView setImage:img]; 147 | 148 | // Set custom view mode 149 | HUD.mode = MBProgressHUDModeCustomView; 150 | 151 | HUD.delegate = self; 152 | HUD.labelText = @"Completed"; 153 | 154 | [HUD show:YES]; 155 | [HUD hide:YES afterDelay:3]; 156 | } 157 | 158 | - (IBAction)showWithLabelMixed:(id)sender { 159 | 160 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 161 | [self.view addSubview:HUD]; 162 | 163 | HUD.delegate = self; 164 | HUD.labelText = @"Connecting"; 165 | HUD.minSize = CGSizeMake(135.f, 135.f); 166 | 167 | [HUD showWhileExecuting:@selector(myMixedTask) onTarget:self withObject:nil animated:YES]; 168 | } 169 | 170 | - (IBAction)showUsingBlocks:(id)sender { 171 | #if NS_BLOCKS_AVAILABLE 172 | MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self.view]; 173 | [self.view addSubview:hud]; 174 | hud.labelText = @"With a block"; 175 | 176 | [hud showAnimated:YES whileExecutingBlock:^{ 177 | [self myTask]; 178 | } completionBlock:^{ 179 | [hud removeFromSuperview]; 180 | #if !__has_feature(objc_arc) 181 | [hud release]; 182 | #endif 183 | }]; 184 | #endif 185 | } 186 | 187 | - (IBAction)showOnWindow:(id)sender { 188 | // The hud will dispable all input on the window 189 | HUD = [[MBProgressHUD alloc] initWithWindow:self.view.window]; 190 | [self.view addSubview:HUD]; 191 | 192 | HUD.delegate = self; 193 | HUD.labelText = @"Loading"; 194 | 195 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 196 | } 197 | 198 | - (IBAction)showURL:(id)sender { 199 | NSURL *URL = [NSURL URLWithString:@"http://a1408.g.akamai.net/5/1408/1388/2005110403/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_iPod.m4v.zip"]; 200 | NSURLRequest *request = [NSURLRequest requestWithURL:URL]; 201 | 202 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 203 | [connection start]; 204 | #if !__has_feature(objc_arc) 205 | [connection release]; 206 | #endif 207 | 208 | HUD = MB_RETAIN([MBProgressHUD showHUDAddedTo:self.view animated:YES]); 209 | HUD.delegate = self; 210 | } 211 | 212 | 213 | - (IBAction)showWithGradient:(id)sender { 214 | 215 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 216 | [self.view addSubview:HUD]; 217 | 218 | HUD.dimBackground = YES; 219 | 220 | // Regiser for HUD callbacks so we can remove it from the window at the right time 221 | HUD.delegate = self; 222 | 223 | // Show the HUD while the provided method executes in a new thread 224 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 225 | } 226 | 227 | - (IBAction)showTextOnly:(id)sender { 228 | 229 | MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 230 | 231 | // Configure for text only and offset down 232 | hud.mode = MBProgressHUDModeText; 233 | hud.labelText = @"Some message..."; 234 | hud.margin = 10.f; 235 | hud.yOffset = 150.f; 236 | hud.removeFromSuperViewOnHide = YES; 237 | 238 | [hud hide:YES afterDelay:3]; 239 | } 240 | 241 | - (IBAction)showWithColor:(id)sender{ 242 | HUD = [[MBProgressHUD alloc] initWithView:self.view]; 243 | [self.view addSubview:HUD]; 244 | 245 | // Set the hud to display with a color 246 | HUD.color = [NSColor colorWithDeviceRed:0.23 green:0.50 blue:0.82 alpha:0.90]; 247 | 248 | HUD.delegate = self; 249 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 250 | } 251 | 252 | #pragma mark - 253 | #pragma mark Execution code 254 | 255 | - (void)myTask { 256 | // Do something usefull in here instead of sleeping ... 257 | sleep(3); 258 | } 259 | 260 | - (void)myProgressTask { 261 | // This just increases the progress indicator in a loop 262 | float progress = 0.0f; 263 | while (progress < 1.0f) { 264 | progress += 0.01f; 265 | HUD.progress = progress; 266 | usleep(50000); 267 | } 268 | } 269 | 270 | - (void)myMixedTask { 271 | // Indeterminate mode 272 | sleep(2); 273 | // Switch to determinate mode 274 | HUD.mode = MBProgressHUDModeDeterminate; 275 | HUD.labelText = @"Progress"; 276 | float progress = 0.0f; 277 | while (progress < 1.0f) 278 | { 279 | progress += 0.01f; 280 | HUD.progress = progress; 281 | usleep(50000); 282 | } 283 | // Back to indeterminate mode 284 | HUD.mode = MBProgressHUDModeIndeterminate; 285 | HUD.labelText = @"Cleaning up"; 286 | sleep(2); 287 | // UIImageView is a UIKit class, we have to initialize it on the main thread 288 | __block NSImageView *imageView; 289 | dispatch_sync(dispatch_get_main_queue(), ^{ 290 | NSImage *image = [NSImage imageNamed:@"37x-Checkmark.png"]; 291 | imageView = [[NSImageView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, 37.0f, 37.0f)]; 292 | imageView.image = image; 293 | }); 294 | HUD.customView = MB_AUTORELEASE(imageView); 295 | HUD.mode = MBProgressHUDModeCustomView; 296 | HUD.labelText = @"Completed"; 297 | sleep(2); 298 | } 299 | 300 | #pragma mark - 301 | #pragma mark NSURLConnectionDelegete 302 | 303 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { 304 | expectedLength = MAX([response expectedContentLength], 1); 305 | currentLength = 0; 306 | HUD.mode = MBProgressHUDModeDeterminate; 307 | } 308 | 309 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { 310 | currentLength += [data length]; 311 | HUD.progress = currentLength / (float)expectedLength; 312 | } 313 | 314 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection { 315 | HUD.customView = MB_AUTORELEASE([[NSImageView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, 37.0f, 37.0f)]); 316 | [(NSImageView *)HUD.customView setImage:[NSImage imageNamed:@"37x-Checkmark.png"]]; 317 | HUD.mode = MBProgressHUDModeCustomView; 318 | [HUD hide:YES afterDelay:2]; 319 | } 320 | 321 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { 322 | [HUD hide:YES]; 323 | } 324 | 325 | #pragma mark - 326 | #pragma mark MBProgressHUDDelegate methods 327 | 328 | - (void)hudWasHidden:(MBProgressHUD *)hud { 329 | // Remove HUD from screen when the HUD was hidded 330 | [HUD removeFromSuperview]; 331 | #if !__has_feature(objc_arc) 332 | [HUD release]; 333 | #endif 334 | HUD = nil; 335 | } 336 | 337 | @end 338 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/en.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | Default 545 | 546 | 547 | 548 | 549 | 550 | 551 | Left to Right 552 | 553 | 554 | 555 | 556 | 557 | 558 | Right to Left 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | Default 570 | 571 | 572 | 573 | 574 | 575 | 576 | Left to Right 577 | 578 | 579 | 580 | 581 | 582 | 583 | Right to Left 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 695 | 706 | 717 | 728 | 739 | 750 | 761 | 772 | 783 | 794 | 805 | 816 | 827 | 838 | 839 | 840 | 841 | 842 | 843 | -------------------------------------------------------------------------------- /HudOSXDemo/HudOSXDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HudOSXDemo 4 | // 5 | // Created by Wayne Fox on 16/04/2014. 6 | // Copyright (c) 2014 Wayne Fox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) 12 | { 13 | return NSApplicationMain(argc, argv); 14 | } 15 | -------------------------------------------------------------------------------- /HudiOSDemo/Classes/HudDemoAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // HudDemoAppDelegate.h 3 | // HudDemo 4 | // 5 | // Created by Matej Bukovinski on 2.4.09. 6 | // Copyright bukovinski.com 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class HudDemoViewController; 12 | 13 | 14 | @interface HudDemoAppDelegate : NSObject { 15 | UIWindow *window; 16 | UINavigationController *navController; 17 | } 18 | 19 | @property (nonatomic, retain) IBOutlet UIWindow *window; 20 | @property (nonatomic, retain) IBOutlet UINavigationController *navController; 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /HudiOSDemo/Classes/HudDemoAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // HudDemoAppDelegate.m 3 | // HudDemo 4 | // 5 | // Created by Matej Bukovinski on 2.4.09. 6 | // Copyright bukovinski.com 2009. All rights reserved. 7 | // 8 | 9 | #import "HudDemoAppDelegate.h" 10 | #import "HudDemoViewController.h" 11 | 12 | 13 | @implementation HudDemoAppDelegate 14 | 15 | @synthesize window; 16 | @synthesize navController; 17 | 18 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 19 | window.rootViewController = navController; 20 | [window makeKeyAndVisible]; 21 | } 22 | 23 | - (void)dealloc { 24 | [navController release]; 25 | [window release]; 26 | [super dealloc]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /HudiOSDemo/Classes/HudDemoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HudDemoViewController.h 3 | // HudDemo 4 | // 5 | // Created by Matej Bukovinski on 30.9.09. 6 | // Copyright bukovinski.com 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MBProgressHUD.h" 11 | 12 | @interface HudDemoViewController : UIViewController { 13 | MBProgressHUD *HUD; 14 | 15 | long long expectedLength; 16 | long long currentLength; 17 | } 18 | 19 | - (IBAction)showSimple:(id)sender; 20 | - (IBAction)showWithLabel:(id)sender; 21 | - (IBAction)showWithDetailsLabel:(id)sender; 22 | - (IBAction)showWithLabelDeterminate:(id)sender; 23 | - (IBAction)showWIthLabelAnnularDeterminate:(id)sender; 24 | - (IBAction)showWithLabelDeterminateHorizontalBar:(id)sender; 25 | - (IBAction)showWithCustomView:(id)sender; 26 | - (IBAction)showWithLabelMixed:(id)sender; 27 | - (IBAction)showUsingBlocks:(id)sender; 28 | - (IBAction)showOnWindow:(id)sender; 29 | - (IBAction)showURL:(id)sender; 30 | 31 | - (void)myTask; 32 | - (void)myProgressTask; 33 | - (void)myMixedTask; 34 | 35 | @end 36 | 37 | -------------------------------------------------------------------------------- /HudiOSDemo/Classes/HudDemoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HudDemoViewController.m 3 | // HudDemo 4 | // 5 | // Created by Matej Bukovinski on 30.9.09. 6 | // Copyright bukovinski.com 2009. All rights reserved. 7 | // 8 | 9 | #import "HudDemoViewController.h" 10 | #import 11 | 12 | 13 | #define SCREENSHOT_MODE 0 14 | 15 | 16 | @implementation HudDemoViewController 17 | 18 | #pragma mark - 19 | #pragma mark Lifecycle methods 20 | 21 | - (void)viewDidLoad { 22 | UIView *content = [[self.view subviews] objectAtIndex:0]; 23 | #if SCREENSHOT_MODE 24 | [content.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; 25 | #endif 26 | ((UIScrollView *)self.view).contentSize = content.bounds.size; 27 | } 28 | 29 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 30 | return YES; 31 | } 32 | 33 | - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { 34 | UIView *content = [[self.view subviews] objectAtIndex:0]; 35 | ((UIScrollView *)self.view).contentSize = content.bounds.size; 36 | } 37 | 38 | - (void)dealloc { 39 | [super dealloc]; 40 | } 41 | 42 | #pragma mark - 43 | #pragma mark IBActions 44 | 45 | - (IBAction)showSimple:(id)sender { 46 | // The hud will dispable all input on the view (use the higest view possible in the view hierarchy) 47 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 48 | [self.navigationController.view addSubview:HUD]; 49 | 50 | // Regiser for HUD callbacks so we can remove it from the window at the right time 51 | HUD.delegate = self; 52 | 53 | // Show the HUD while the provided method executes in a new thread 54 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 55 | } 56 | 57 | - (IBAction)showWithLabel:(id)sender { 58 | 59 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 60 | [self.navigationController.view addSubview:HUD]; 61 | 62 | HUD.delegate = self; 63 | HUD.labelText = @"Loading"; 64 | 65 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 66 | } 67 | 68 | - (IBAction)showWithDetailsLabel:(id)sender { 69 | 70 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 71 | [self.navigationController.view addSubview:HUD]; 72 | 73 | HUD.delegate = self; 74 | HUD.labelText = @"Loading"; 75 | HUD.detailsLabelText = @"updating data"; 76 | HUD.square = YES; 77 | 78 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 79 | } 80 | 81 | - (IBAction)showWithLabelDeterminate:(id)sender { 82 | 83 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 84 | [self.navigationController.view addSubview:HUD]; 85 | 86 | // Set determinate mode 87 | HUD.mode = MBProgressHUDModeDeterminate; 88 | 89 | HUD.delegate = self; 90 | HUD.labelText = @"Loading"; 91 | 92 | // myProgressTask uses the HUD instance to update progress 93 | [HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES]; 94 | } 95 | 96 | - (IBAction)showWIthLabelAnnularDeterminate:(id)sender { 97 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 98 | [self.navigationController.view addSubview:HUD]; 99 | 100 | // Set determinate mode 101 | HUD.mode = MBProgressHUDModeAnnularDeterminate; 102 | 103 | HUD.delegate = self; 104 | HUD.labelText = @"Loading"; 105 | 106 | // myProgressTask uses the HUD instance to update progress 107 | [HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES]; 108 | } 109 | 110 | - (IBAction)showWithLabelDeterminateHorizontalBar:(id)sender { 111 | 112 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 113 | [self.navigationController.view addSubview:HUD]; 114 | 115 | // Set determinate bar mode 116 | HUD.mode = MBProgressHUDModeDeterminateHorizontalBar; 117 | 118 | HUD.delegate = self; 119 | 120 | // myProgressTask uses the HUD instance to update progress 121 | [HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES]; 122 | } 123 | 124 | - (IBAction)showWithCustomView:(id)sender { 125 | 126 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 127 | [self.navigationController.view addSubview:HUD]; 128 | 129 | // The sample image is based on the work by http://www.pixelpressicons.com, http://creativecommons.org/licenses/by/2.5/ca/ 130 | // Make the customViews 37 by 37 pixels for best results (those are the bounds of the build-in progress indicators) 131 | HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease]; 132 | 133 | // Set custom view mode 134 | HUD.mode = MBProgressHUDModeCustomView; 135 | 136 | HUD.delegate = self; 137 | HUD.labelText = @"Completed"; 138 | 139 | [HUD show:YES]; 140 | [HUD hide:YES afterDelay:3]; 141 | } 142 | 143 | - (IBAction)showWithLabelMixed:(id)sender { 144 | 145 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 146 | [self.navigationController.view addSubview:HUD]; 147 | 148 | HUD.delegate = self; 149 | HUD.labelText = @"Connecting"; 150 | HUD.minSize = CGSizeMake(135.f, 135.f); 151 | 152 | [HUD showWhileExecuting:@selector(myMixedTask) onTarget:self withObject:nil animated:YES]; 153 | } 154 | 155 | - (IBAction)showUsingBlocks:(id)sender { 156 | #if NS_BLOCKS_AVAILABLE 157 | MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 158 | [self.navigationController.view addSubview:hud]; 159 | hud.labelText = @"With a block"; 160 | 161 | [hud showAnimated:YES whileExecutingBlock:^{ 162 | [self myTask]; 163 | } completionBlock:^{ 164 | [hud removeFromSuperview]; 165 | [hud release]; 166 | }]; 167 | #endif 168 | } 169 | 170 | - (IBAction)showOnWindow:(id)sender { 171 | // The hud will dispable all input on the window 172 | HUD = [[MBProgressHUD alloc] initWithView:self.view.window]; 173 | [self.view.window addSubview:HUD]; 174 | 175 | HUD.delegate = self; 176 | HUD.labelText = @"Loading"; 177 | 178 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 179 | } 180 | 181 | - (IBAction)showURL:(id)sender { 182 | NSURL *URL = [NSURL URLWithString:@"http://a1408.g.akamai.net/5/1408/1388/2005110403/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_iPod.m4v.zip"]; 183 | NSURLRequest *request = [NSURLRequest requestWithURL:URL]; 184 | 185 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 186 | [connection start]; 187 | [connection release]; 188 | 189 | HUD = [[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES] retain]; 190 | HUD.delegate = self; 191 | } 192 | 193 | 194 | - (IBAction)showWithGradient:(id)sender { 195 | 196 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 197 | [self.navigationController.view addSubview:HUD]; 198 | 199 | HUD.dimBackground = YES; 200 | 201 | // Regiser for HUD callbacks so we can remove it from the window at the right time 202 | HUD.delegate = self; 203 | 204 | // Show the HUD while the provided method executes in a new thread 205 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 206 | } 207 | 208 | - (IBAction)showTextOnly:(id)sender { 209 | 210 | MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES]; 211 | 212 | // Configure for text only and offset down 213 | hud.mode = MBProgressHUDModeText; 214 | hud.labelText = @"Some message..."; 215 | hud.margin = 10.f; 216 | hud.yOffset = 150.f; 217 | hud.removeFromSuperViewOnHide = YES; 218 | 219 | [hud hide:YES afterDelay:3]; 220 | } 221 | 222 | - (IBAction)showWithColor:(id)sender{ 223 | HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; 224 | [self.navigationController.view addSubview:HUD]; 225 | 226 | // Set the hud to display with a color 227 | HUD.color = [UIColor colorWithRed:0.23 green:0.50 blue:0.82 alpha:0.90]; 228 | 229 | HUD.delegate = self; 230 | [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; 231 | } 232 | 233 | #pragma mark - 234 | #pragma mark Execution code 235 | 236 | - (void)myTask { 237 | // Do something usefull in here instead of sleeping ... 238 | sleep(3); 239 | } 240 | 241 | - (void)myProgressTask { 242 | // This just increases the progress indicator in a loop 243 | float progress = 0.0f; 244 | while (progress < 1.0f) { 245 | progress += 0.01f; 246 | HUD.progress = progress; 247 | usleep(50000); 248 | } 249 | } 250 | 251 | - (void)myMixedTask { 252 | // Indeterminate mode 253 | sleep(2); 254 | // Switch to determinate mode 255 | HUD.mode = MBProgressHUDModeDeterminate; 256 | HUD.labelText = @"Progress"; 257 | float progress = 0.0f; 258 | while (progress < 1.0f) 259 | { 260 | progress += 0.01f; 261 | HUD.progress = progress; 262 | usleep(50000); 263 | } 264 | // Back to indeterminate mode 265 | HUD.mode = MBProgressHUDModeIndeterminate; 266 | HUD.labelText = @"Cleaning up"; 267 | sleep(2); 268 | // UIImageView is a UIKit class, we have to initialize it on the main thread 269 | __block UIImageView *imageView; 270 | dispatch_sync(dispatch_get_main_queue(), ^{ 271 | UIImage *image = [UIImage imageNamed:@"37x-Checkmark.png"]; 272 | imageView = [[UIImageView alloc] initWithImage:image]; 273 | }); 274 | HUD.customView = [imageView autorelease]; 275 | HUD.mode = MBProgressHUDModeCustomView; 276 | HUD.labelText = @"Completed"; 277 | sleep(2); 278 | } 279 | 280 | #pragma mark - 281 | #pragma mark NSURLConnectionDelegete 282 | 283 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { 284 | expectedLength = MAX([response expectedContentLength], 1); 285 | currentLength = 0; 286 | HUD.mode = MBProgressHUDModeDeterminate; 287 | } 288 | 289 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { 290 | currentLength += [data length]; 291 | HUD.progress = currentLength / (float)expectedLength; 292 | } 293 | 294 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection { 295 | HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease]; 296 | HUD.mode = MBProgressHUDModeCustomView; 297 | [HUD hide:YES afterDelay:2]; 298 | } 299 | 300 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { 301 | [HUD hide:YES]; 302 | } 303 | 304 | #pragma mark - 305 | #pragma mark MBProgressHUDDelegate methods 306 | 307 | - (void)hudWasHidden:(MBProgressHUD *)hud { 308 | // Remove HUD from screen when the HUD was hidded 309 | [HUD removeFromSuperview]; 310 | [HUD release]; 311 | HUD = nil; 312 | } 313 | 314 | @end 315 | -------------------------------------------------------------------------------- /HudiOSDemo/HudDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* HudDemoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* HudDemoAppDelegate.m */; }; 11 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 12 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 13 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 14 | 28D7ACF80DDB3853001CB0EB /* HudDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* HudDemoViewController.m */; }; 15 | D21D40801611CF6C005FCE55 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D21D407F1611CF6C005FCE55 /* Default-568h@2x.png */; }; 16 | D22F7D810F85241C00550BB3 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D22F7D800F85241C00550BB3 /* MBProgressHUD.m */; }; 17 | D24A23051780ADCD0020310A /* Icon-Small.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E61780AA77008D5939 /* Icon-Small.png */; }; 18 | D24A23061780ADD10020310A /* Icon-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E71780AA77008D5939 /* Icon-Small@2x.png */; }; 19 | D24A23071780ADDA0020310A /* Icon-iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E51780A9C6008D5939 /* Icon-iOS7@2x.png */; }; 20 | D24A23081780ADE60020310A /* Default-iOS7-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E31780A913008D5939 /* Default-iOS7-568h@2x.png */; }; 21 | D24A23091780ADE90020310A /* Default-iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E41780A913008D5939 /* Default-iOS7@2x.png */; }; 22 | D277FDB311FC834200304321 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = D277FDB211FC834200304321 /* Default.png */; }; 23 | D277FDB911FC877E00304321 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = D277FDB711FC877E00304321 /* Icon.png */; }; 24 | D277FDBA11FC877E00304321 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D277FDB811FC877E00304321 /* Icon@2x.png */; }; 25 | D286A6801518736B00E13FB8 /* 37x-Checkmark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D286A67F1518736B00E13FB8 /* 37x-Checkmark@2x.png */; }; 26 | D286A7321518C53500E13FB8 /* HudDemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D286A7341518C53500E13FB8 /* HudDemoViewController.xib */; }; 27 | D286A7361518C53C00E13FB8 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = D286A7381518C53C00E13FB8 /* MainWindow.xib */; }; 28 | D286A76D1518CA9F00E13FB8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D286A76C1518CA9F00E13FB8 /* CoreGraphics.framework */; }; 29 | D2A6FD1D13ABC5A200BFE4C9 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D2A6FD1C13ABC5A200BFE4C9 /* Default@2x.png */; }; 30 | D2F88CD6115E9F7F00E6DB82 /* 37x-Checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = D2F88CD5115E9F7F00E6DB82 /* 37x-Checkmark.png */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 35 | 1D3623240D0F684500981E51 /* HudDemoAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HudDemoAppDelegate.h; sourceTree = ""; }; 36 | 1D3623250D0F684500981E51 /* HudDemoAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HudDemoAppDelegate.m; sourceTree = ""; }; 37 | 1D6058910D05DD3D006BFB54 /* HudDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HudDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 39 | 28D7ACF60DDB3853001CB0EB /* HudDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HudDemoViewController.h; sourceTree = ""; }; 40 | 28D7ACF70DDB3853001CB0EB /* HudDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HudDemoViewController.m; sourceTree = ""; usesTabs = 1; }; 41 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 42 | 32CA4F630368D1EE00C91783 /* HudDemo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HudDemo_Prefix.pch; sourceTree = ""; }; 43 | 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | D21D407F1611CF6C005FCE55 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Images/Default-568h@2x.png"; sourceTree = ""; }; 45 | D22568E31780A913008D5939 /* Default-iOS7-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-iOS7-568h@2x.png"; path = "Images/Default-iOS7-568h@2x.png"; sourceTree = ""; }; 46 | D22568E41780A913008D5939 /* Default-iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-iOS7@2x.png"; path = "Images/Default-iOS7@2x.png"; sourceTree = ""; }; 47 | D22568E51780A9C6008D5939 /* Icon-iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-iOS7@2x.png"; path = "Images/Icon-iOS7@2x.png"; sourceTree = ""; }; 48 | D22568E61780AA77008D5939 /* Icon-Small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-Small.png"; path = "Images/Icon-Small.png"; sourceTree = ""; }; 49 | D22568E71780AA77008D5939 /* Icon-Small@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-Small@2x.png"; path = "Images/Icon-Small@2x.png"; sourceTree = ""; }; 50 | D22F7D7F0F85241C00550BB3 /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBProgressHUD.h; path = ../MBProgressHUD.h; sourceTree = SOURCE_ROOT; }; 51 | D22F7D800F85241C00550BB3 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MBProgressHUD.m; path = ../../MBProgressHUD.m; sourceTree = ""; }; 52 | D277FDB211FC834200304321 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Images/Default.png; sourceTree = ""; }; 53 | D277FDB711FC877E00304321 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = Images/Icon.png; sourceTree = ""; }; 54 | D277FDB811FC877E00304321 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "Images/Icon@2x.png"; sourceTree = ""; }; 55 | D286A67F1518736B00E13FB8 /* 37x-Checkmark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "37x-Checkmark@2x.png"; path = "Images/37x-Checkmark@2x.png"; sourceTree = ""; }; 56 | D286A7331518C53500E13FB8 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/HudDemoViewController.xib; sourceTree = ""; }; 57 | D286A7371518C53C00E13FB8 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = ""; }; 58 | D286A76C1518CA9F00E13FB8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 59 | D2A6FD1C13ABC5A200BFE4C9 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Images/Default@2x.png"; sourceTree = ""; }; 60 | D2F88CD5115E9F7F00E6DB82 /* 37x-Checkmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "37x-Checkmark.png"; path = "Images/37x-Checkmark.png"; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | D286A76D1518CA9F00E13FB8 /* CoreGraphics.framework in Frameworks */, 69 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 70 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 080E96DDFE201D6D7F000001 /* Classes */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | D22F7D7F0F85241C00550BB3 /* MBProgressHUD.h */, 81 | D22F7D800F85241C00550BB3 /* MBProgressHUD.m */, 82 | 1D3623240D0F684500981E51 /* HudDemoAppDelegate.h */, 83 | 1D3623250D0F684500981E51 /* HudDemoAppDelegate.m */, 84 | 28D7ACF60DDB3853001CB0EB /* HudDemoViewController.h */, 85 | 28D7ACF70DDB3853001CB0EB /* HudDemoViewController.m */, 86 | ); 87 | path = Classes; 88 | sourceTree = ""; 89 | }; 90 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 1D6058910D05DD3D006BFB54 /* HudDemo.app */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 080E96DDFE201D6D7F000001 /* Classes */, 102 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 103 | 29B97317FDCFA39411CA2CEA /* Resources */, 104 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 105 | 19C28FACFE9D520D11CA2CBB /* Products */, 106 | ); 107 | name = CustomTemplate; 108 | sourceTree = ""; 109 | }; 110 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 32CA4F630368D1EE00C91783 /* HudDemo_Prefix.pch */, 114 | 29B97316FDCFA39411CA2CEA /* main.m */, 115 | ); 116 | name = "Other Sources"; 117 | sourceTree = ""; 118 | }; 119 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | D277FDBF11FC880100304321 /* UI */, 123 | D277FDBD11FC879500304321 /* Images */, 124 | 8D1107310486CEB800E47090 /* Info.plist */, 125 | ); 126 | name = Resources; 127 | sourceTree = ""; 128 | }; 129 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | D286A76C1518CA9F00E13FB8 /* CoreGraphics.framework */, 133 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 134 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 135 | ); 136 | name = Frameworks; 137 | sourceTree = ""; 138 | }; 139 | D277FDBD11FC879500304321 /* Images */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | D277FDB711FC877E00304321 /* Icon.png */, 143 | D277FDB811FC877E00304321 /* Icon@2x.png */, 144 | D22568E61780AA77008D5939 /* Icon-Small.png */, 145 | D22568E71780AA77008D5939 /* Icon-Small@2x.png */, 146 | D22568E51780A9C6008D5939 /* Icon-iOS7@2x.png */, 147 | D277FDB211FC834200304321 /* Default.png */, 148 | D2A6FD1C13ABC5A200BFE4C9 /* Default@2x.png */, 149 | D21D407F1611CF6C005FCE55 /* Default-568h@2x.png */, 150 | D22568E31780A913008D5939 /* Default-iOS7-568h@2x.png */, 151 | D22568E41780A913008D5939 /* Default-iOS7@2x.png */, 152 | D2F88CD5115E9F7F00E6DB82 /* 37x-Checkmark.png */, 153 | D286A67F1518736B00E13FB8 /* 37x-Checkmark@2x.png */, 154 | ); 155 | name = Images; 156 | sourceTree = ""; 157 | }; 158 | D277FDBF11FC880100304321 /* UI */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | D286A7341518C53500E13FB8 /* HudDemoViewController.xib */, 162 | D286A7381518C53C00E13FB8 /* MainWindow.xib */, 163 | ); 164 | name = UI; 165 | sourceTree = ""; 166 | }; 167 | /* End PBXGroup section */ 168 | 169 | /* Begin PBXNativeTarget section */ 170 | 1D6058900D05DD3D006BFB54 /* HudDemo */ = { 171 | isa = PBXNativeTarget; 172 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HudDemo" */; 173 | buildPhases = ( 174 | 1D60588D0D05DD3D006BFB54 /* Resources */, 175 | 1D60588E0D05DD3D006BFB54 /* Sources */, 176 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | ); 182 | name = HudDemo; 183 | productName = HudDemo; 184 | productReference = 1D6058910D05DD3D006BFB54 /* HudDemo.app */; 185 | productType = "com.apple.product-type.application"; 186 | }; 187 | /* End PBXNativeTarget section */ 188 | 189 | /* Begin PBXProject section */ 190 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 191 | isa = PBXProject; 192 | attributes = { 193 | CLASSPREFIX = MB; 194 | LastUpgradeCheck = 0610; 195 | ORGANIZATIONNAME = "Matej Bukovinski"; 196 | }; 197 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HudDemo" */; 198 | compatibilityVersion = "Xcode 3.2"; 199 | developmentRegion = English; 200 | hasScannedForEncodings = 1; 201 | knownRegions = ( 202 | English, 203 | Japanese, 204 | French, 205 | German, 206 | ); 207 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 208 | projectDirPath = ""; 209 | projectRoot = ""; 210 | targets = ( 211 | 1D6058900D05DD3D006BFB54 /* HudDemo */, 212 | ); 213 | }; 214 | /* End PBXProject section */ 215 | 216 | /* Begin PBXResourcesBuildPhase section */ 217 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 218 | isa = PBXResourcesBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | D286A7361518C53C00E13FB8 /* MainWindow.xib in Resources */, 222 | D286A7321518C53500E13FB8 /* HudDemoViewController.xib in Resources */, 223 | D2F88CD6115E9F7F00E6DB82 /* 37x-Checkmark.png in Resources */, 224 | D277FDB311FC834200304321 /* Default.png in Resources */, 225 | D277FDB911FC877E00304321 /* Icon.png in Resources */, 226 | D277FDBA11FC877E00304321 /* Icon@2x.png in Resources */, 227 | D2A6FD1D13ABC5A200BFE4C9 /* Default@2x.png in Resources */, 228 | D286A6801518736B00E13FB8 /* 37x-Checkmark@2x.png in Resources */, 229 | D24A23081780ADE60020310A /* Default-iOS7-568h@2x.png in Resources */, 230 | D24A23051780ADCD0020310A /* Icon-Small.png in Resources */, 231 | D24A23071780ADDA0020310A /* Icon-iOS7@2x.png in Resources */, 232 | D21D40801611CF6C005FCE55 /* Default-568h@2x.png in Resources */, 233 | D24A23061780ADD10020310A /* Icon-Small@2x.png in Resources */, 234 | D24A23091780ADE90020310A /* Default-iOS7@2x.png in Resources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXResourcesBuildPhase section */ 239 | 240 | /* Begin PBXSourcesBuildPhase section */ 241 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 242 | isa = PBXSourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 246 | 1D3623260D0F684500981E51 /* HudDemoAppDelegate.m in Sources */, 247 | 28D7ACF80DDB3853001CB0EB /* HudDemoViewController.m in Sources */, 248 | D22F7D810F85241C00550BB3 /* MBProgressHUD.m in Sources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | /* End PBXSourcesBuildPhase section */ 253 | 254 | /* Begin PBXVariantGroup section */ 255 | D286A7341518C53500E13FB8 /* HudDemoViewController.xib */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | D286A7331518C53500E13FB8 /* en */, 259 | ); 260 | name = HudDemoViewController.xib; 261 | sourceTree = ""; 262 | }; 263 | D286A7381518C53C00E13FB8 /* MainWindow.xib */ = { 264 | isa = PBXVariantGroup; 265 | children = ( 266 | D286A7371518C53C00E13FB8 /* en */, 267 | ); 268 | name = MainWindow.xib; 269 | sourceTree = ""; 270 | }; 271 | /* End PBXVariantGroup section */ 272 | 273 | /* Begin XCBuildConfiguration section */ 274 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ALWAYS_SEARCH_USER_PATHS = NO; 278 | COPY_PHASE_STRIP = NO; 279 | GCC_DYNAMIC_NO_PIC = NO; 280 | GCC_OPTIMIZATION_LEVEL = 0; 281 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 282 | GCC_PREFIX_HEADER = HudDemo_Prefix.pch; 283 | GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; 284 | INFOPLIST_FILE = Info.plist; 285 | PRODUCT_NAME = HudDemo; 286 | }; 287 | name = Debug; 288 | }; 289 | 1D6058950D05DD3E006BFB54 /* Release */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | ALWAYS_SEARCH_USER_PATHS = NO; 293 | COPY_PHASE_STRIP = YES; 294 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 295 | GCC_PREFIX_HEADER = HudDemo_Prefix.pch; 296 | INFOPLIST_FILE = Info.plist; 297 | PRODUCT_NAME = HudDemo; 298 | SDKROOT = iphoneos; 299 | }; 300 | name = Release; 301 | }; 302 | C01FCF4F08A954540054247B /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | CLANG_WARN_BOOL_CONVERSION = YES; 306 | CLANG_WARN_CONSTANT_CONVERSION = YES; 307 | CLANG_WARN_EMPTY_BODY = YES; 308 | CLANG_WARN_ENUM_CONVERSION = YES; 309 | CLANG_WARN_INT_CONVERSION = YES; 310 | CLANG_WARN_UNREACHABLE_CODE = YES; 311 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 312 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 313 | ENABLE_STRICT_OBJC_MSGSEND = YES; 314 | GCC_C_LANGUAGE_STANDARD = c99; 315 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 323 | ONLY_ACTIVE_ARCH = YES; 324 | SDKROOT = iphoneos; 325 | }; 326 | name = Debug; 327 | }; 328 | C01FCF5008A954540054247B /* Release */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_CONSTANT_CONVERSION = YES; 333 | CLANG_WARN_EMPTY_BODY = YES; 334 | CLANG_WARN_ENUM_CONVERSION = YES; 335 | CLANG_WARN_INT_CONVERSION = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | ENABLE_STRICT_OBJC_MSGSEND = YES; 340 | GCC_C_LANGUAGE_STANDARD = c99; 341 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 342 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 343 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 344 | GCC_WARN_UNDECLARED_SELECTOR = YES; 345 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 346 | GCC_WARN_UNUSED_FUNCTION = YES; 347 | GCC_WARN_UNUSED_VARIABLE = YES; 348 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 349 | SDKROOT = iphoneos; 350 | }; 351 | name = Release; 352 | }; 353 | /* End XCBuildConfiguration section */ 354 | 355 | /* Begin XCConfigurationList section */ 356 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HudDemo" */ = { 357 | isa = XCConfigurationList; 358 | buildConfigurations = ( 359 | 1D6058940D05DD3E006BFB54 /* Debug */, 360 | 1D6058950D05DD3E006BFB54 /* Release */, 361 | ); 362 | defaultConfigurationIsVisible = 0; 363 | defaultConfigurationName = Release; 364 | }; 365 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HudDemo" */ = { 366 | isa = XCConfigurationList; 367 | buildConfigurations = ( 368 | C01FCF4F08A954540054247B /* Debug */, 369 | C01FCF5008A954540054247B /* Release */, 370 | ); 371 | defaultConfigurationIsVisible = 0; 372 | defaultConfigurationName = Release; 373 | }; 374 | /* End XCConfigurationList section */ 375 | }; 376 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 377 | } 378 | -------------------------------------------------------------------------------- /HudiOSDemo/HudDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /HudiOSDemo/HudDemo.xcodeproj/project.xcworkspace/xcshareddata/HudDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | A622D1AE-30C6-43D5-B71F-B262717084D5 9 | IDESourceControlProjectName 10 | HudDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 9216234465E28AF4110CA9480EA255273B2C94F7 14 | https://github.com/Foxnolds/MBProgressHUD-OSX.git 15 | 16 | IDESourceControlProjectPath 17 | HudiOSDemo/HudDemo.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 9216234465E28AF4110CA9480EA255273B2C94F7 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/Foxnolds/MBProgressHUD-OSX.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 9216234465E28AF4110CA9480EA255273B2C94F7 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 9216234465E28AF4110CA9480EA255273B2C94F7 36 | IDESourceControlWCCName 37 | MBProgressHUD-OSX 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /HudiOSDemo/HudDemo.xcodeproj/project.xcworkspace/xcuserdata/waynesfox.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/HudDemo.xcodeproj/project.xcworkspace/xcuserdata/waynesfox.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /HudiOSDemo/HudDemo.xcodeproj/project.xcworkspace/xcuserdata/waynesfox.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /HudiOSDemo/HudDemo.xcodeproj/xcshareddata/xcschemes/HudDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 44 | 45 | 51 | 52 | 53 | 54 | 55 | 56 | 64 | 65 | 71 | 72 | 73 | 74 | 76 | 77 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /HudiOSDemo/HudDemo.xcodeproj/xcuserdata/waynesfox.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /HudiOSDemo/HudDemo.xcodeproj/xcuserdata/waynesfox.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SuppressBuildableAutocreation 6 | 7 | 1D6058900D05DD3D006BFB54 8 | 9 | primary 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /HudiOSDemo/HudDemo_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'HudDemo' target in the 'HudDemo' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /HudiOSDemo/Images/37x-Checkmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/37x-Checkmark.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/37x-Checkmark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/37x-Checkmark@2x.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Default-568h@2x.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Default-iOS7-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Default-iOS7-568h@2x.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Default-iOS7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Default-iOS7@2x.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Default.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Default@2x.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Icon-Small.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Icon-Small@2x.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Icon-iOS7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Icon-iOS7@2x.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Icon.png -------------------------------------------------------------------------------- /HudiOSDemo/Images/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Foxnolds/MBProgressHUD-OSX/6643495afa1195658f137f15b3ca2b02a3993357/HudiOSDemo/Images/Icon@2x.png -------------------------------------------------------------------------------- /HudiOSDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIconFiles 14 | 15 | Icon-Small 16 | Icon-iOS7 17 | Icon.png 18 | Icon@2x.png 19 | 20 | CFBundleIdentifier 21 | com.bukovinski.${PRODUCT_NAME:identifier} 22 | CFBundleInfoDictionaryVersion 23 | 6.0 24 | CFBundleName 25 | ${PRODUCT_NAME} 26 | CFBundlePackageType 27 | APPL 28 | CFBundleShortVersionString 29 | 1.0 30 | CFBundleSignature 31 | ???? 32 | CFBundleVersion 33 | 1.0 34 | LSRequiresIPhoneOS 35 | 36 | NSMainNibFile 37 | MainWindow 38 | UILaunchImages 39 | 40 | 41 | UILaunchImageMinimumOSVersion 42 | 7.0 43 | UILaunchImageName 44 | Default-iOS7 45 | UILaunchImageOrientation 46 | Portrait 47 | UILaunchImageSize 48 | {320, 568} 49 | 50 | 51 | UILaunchImageMinimumOSVersion 52 | 7.0 53 | UILaunchImageName 54 | Default-iOS7 55 | UILaunchImageOrientation 56 | Portrait 57 | UILaunchImageSize 58 | {320, 480} 59 | 60 | 61 | UISupportedInterfaceOrientations 62 | 63 | UIInterfaceOrientationPortrait 64 | UIInterfaceOrientationPortraitUpsideDown 65 | UIInterfaceOrientationLandscapeLeft 66 | UIInterfaceOrientationLandscapeRight 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /HudiOSDemo/en.lproj/HudDemoViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 37 | 52 | 69 | 84 | 99 | 114 | 129 | 144 | 159 | 174 | 189 | 204 | 219 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | -------------------------------------------------------------------------------- /HudiOSDemo/en.lproj/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /HudiOSDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HudDemo 4 | // 5 | // Created by Matej Bukovinski on 2.4.09. 6 | // Copyright bukovinski.com 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Foxnolds 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBProgressHUD.h 3 | // Version 0.8 + dismissible + OSX 10.7+ option added by Wayne Fox 21 Apr 2014 4 | // Created by Matej Bukovinski on 2.4.09. 5 | // 6 | 7 | // This code is distributed under the terms and conditions of the MIT license. 8 | 9 | // Copyright (c) 2013 Matej Bukovinski 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | #import 30 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 31 | #import 32 | #if __IPHONE 33 | #import 34 | #endif // __IPHONE 35 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 36 | #import 37 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 38 | 39 | @protocol MBProgressHUDDelegate; 40 | 41 | /* 42 | NSProgressIndicator* indicator = [[[NSProgressIndicator alloc] initWithFrame:NSMakeRect(20, 20, 30, 30)] autorelease]; 43 | [indicator setStyle:NSProgressIndicatorSpinningStyle]; 44 | 45 | https://developer.apple.com/library/mac/documentation/cocoa/conceptual/ProgIndic/Concepts/AboutProgIndic.html 46 | 47 | */ 48 | 49 | typedef enum { 50 | /** Progress is shown using an UIActivityIndicatorView. This is the default. */ 51 | MBProgressHUDModeIndeterminate, 52 | /** Progress is shown using a round, pie-chart like, progress view. */ 53 | MBProgressHUDModeDeterminate, 54 | /** Progress is shown using a horizontal progress bar */ 55 | MBProgressHUDModeDeterminateHorizontalBar, 56 | /** Progress is shown using a ring-shaped progress view. */ 57 | MBProgressHUDModeAnnularDeterminate, 58 | /** Shows a custom view */ 59 | MBProgressHUDModeCustomView, 60 | /** Shows only labels */ 61 | MBProgressHUDModeText 62 | } MBProgressHUDMode; 63 | 64 | typedef enum { 65 | /** Opacity animation */ 66 | MBProgressHUDAnimationFade, 67 | /** Opacity + scale animation */ 68 | MBProgressHUDAnimationZoom, 69 | MBProgressHUDAnimationZoomOut = MBProgressHUDAnimationZoom, 70 | MBProgressHUDAnimationZoomIn 71 | } MBProgressHUDAnimation; 72 | 73 | 74 | #ifndef MB_INSTANCETYPE 75 | #if __has_feature(objc_instancetype) 76 | #define MB_INSTANCETYPE instancetype 77 | #else 78 | #define MB_INSTANCETYPE id 79 | #endif 80 | #endif 81 | 82 | #ifndef MB_STRONG 83 | #if __has_feature(objc_arc) 84 | #define MB_STRONG strong 85 | #else 86 | #define MB_STRONG retain 87 | #endif 88 | #endif 89 | 90 | #ifndef MB_WEAK 91 | #if __has_feature(objc_arc_weak) 92 | #define MB_WEAK weak 93 | #elif __has_feature(objc_arc) 94 | #define MB_WEAK unsafe_unretained 95 | #else 96 | #define MB_WEAK assign 97 | #endif 98 | #endif 99 | 100 | #if NS_BLOCKS_AVAILABLE 101 | typedef void (^MBProgressHUDCompletionBlock)(); 102 | #endif 103 | 104 | #if !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 105 | 106 | enum { 107 | NSViewAutoresizingNone = NSViewNotSizable, 108 | NSViewAutoresizingFlexibleLeftMargin = NSViewMinXMargin, 109 | NSViewAutoresizingFlexibleWidth = NSViewWidthSizable, 110 | NSViewAutoresizingFlexibleRightMargin = NSViewMaxXMargin, 111 | NSViewAutoresizingFlexibleTopMargin = NSViewMaxYMargin, 112 | NSViewAutoresizingFlexibleHeight = NSViewHeightSizable, 113 | NSViewAutoresizingFlexibleBottomMargin = NSViewMinYMargin 114 | }; 115 | 116 | #endif 117 | 118 | /** 119 | * Displays a simple HUD window containing a progress indicator and two optional labels for short messages. 120 | * 121 | * This is a simple drop-in class for displaying a progress HUD view similar to Apple's private UIProgressHUD class. 122 | * The MBProgressHUD window spans over the entire space given to it by the initWithFrame constructor and catches all 123 | * user input on this region, thereby preventing the user operations on components below the view. The HUD itself is 124 | * drawn centered as a rounded semi-transparent view which resizes depending on the user specified content. 125 | * 126 | * This view supports four modes of operation: 127 | * - MBProgressHUDModeIndeterminate - shows a UIActivityIndicatorView 128 | * - MBProgressHUDModeDeterminate - shows a custom round progress indicator 129 | * - MBProgressHUDModeAnnularDeterminate - shows a custom annular progress indicator 130 | * - MBProgressHUDModeCustomView - shows an arbitrary, user specified view (@see customView) 131 | * 132 | * All three modes can have optional labels assigned: 133 | * - If the labelText property is set and non-empty then a label containing the provided content is placed below the 134 | * indicator view. 135 | * - If also the detailsLabelText property is set then another label is placed below the first label. 136 | */ 137 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 138 | @interface MBProgressHUD : UIView 139 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 140 | @interface MBProgressHUD : NSView 141 | { 142 | CGColorRef _cgColorFromNSColor; 143 | } 144 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 145 | 146 | #pragma mark - Class methods 147 | 148 | /** 149 | * Creates a new HUD, adds it to provided view and shows it. The counterpart to this method is hideHUDForView:animated:. 150 | * 151 | * @param view The view that the HUD will be added to 152 | * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use 153 | * animations while appearing. 154 | * @return A reference to the created HUD. 155 | * 156 | * @see hideHUDForView:animated: 157 | * @see animationType 158 | */ 159 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 160 | + (MB_INSTANCETYPE)showHUDAddedTo:(UIView *)view animated:(BOOL)animated; 161 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 162 | + (MB_INSTANCETYPE)showHUDAddedTo:(NSView *)view animated:(BOOL)animated; 163 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 164 | 165 | /** 166 | * Finds the top-most HUD subview and hides it. The counterpart to this method is showHUDAddedTo:animated:. 167 | * 168 | * @param view The view that is going to be searched for a HUD subview. 169 | * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use 170 | * animations while disappearing. 171 | * @return YES if a HUD was found and removed, NO otherwise. 172 | * 173 | * @see showHUDAddedTo:animated: 174 | * @see animationType 175 | */ 176 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 177 | + (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated; 178 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 179 | + (BOOL)hideHUDForView:(NSView *)view animated:(BOOL)animated; 180 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 181 | 182 | /** 183 | * Finds all the HUD subviews and hides them. 184 | * 185 | * @param view The view that is going to be searched for HUD subviews. 186 | * @param animated If set to YES the HUDs will disappear using the current animationType. If set to NO the HUDs will not use 187 | * animations while disappearing. 188 | * @return the number of HUDs found and removed. 189 | * 190 | * @see hideHUDForView:animated: 191 | * @see animationType 192 | */ 193 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 194 | + (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated; 195 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 196 | + (NSUInteger)hideAllHUDsForView:(NSView *)view animated:(BOOL)animated; 197 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 198 | 199 | /** 200 | * Finds the top-most HUD subview and returns it. 201 | * 202 | * @param view The view that is going to be searched. 203 | * @return A reference to the last HUD subview discovered. 204 | */ 205 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 206 | + (MB_INSTANCETYPE)HUDForView:(UIView *)view; 207 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 208 | + (MB_INSTANCETYPE)HUDForView:(NSView *)view; 209 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 210 | 211 | /** 212 | * Finds all HUD subviews and returns them. 213 | * 214 | * @param view The view that is going to be searched. 215 | * @return All found HUD views (array of MBProgressHUD objects). 216 | */ 217 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 218 | + (NSArray *)allHUDsForView:(UIView *)view; 219 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 220 | + (NSArray *)allHUDsForView:(NSView *)view; 221 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 222 | 223 | /** 224 | * OS X Helper method to convert NSColor value to CGColorRef value. 225 | * 226 | * @nscolor NSColur instance to convert. 227 | * @return Converted NSColor to CGColorRef. 228 | */ 229 | #if !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 230 | - (CGColorRef)NSColorToCGColor:(NSColor *)nscolor; 231 | #endif // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 232 | 233 | #pragma mark - Lifecycle 234 | 235 | /** 236 | * A convenience constructor that initializes the HUD with the window's bounds. Calls the designated constructor with 237 | * window.bounds as the parameter. 238 | * 239 | * @param window The window instance that will provide the bounds for the HUD. Should be the same instance as 240 | * the HUD's superview (i.e., the window that the HUD will be added to). 241 | */ 242 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 243 | - (id)initWithWindow:(UIWindow *)window; 244 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 245 | - (id)initWithWindow:(NSWindow *)window; 246 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 247 | 248 | /** 249 | * A convenience constructor that initializes the HUD with the view's bounds. Calls the designated constructor with 250 | * view.bounds as the parameter 251 | * 252 | * @param view The view instance that will provide the bounds for the HUD. Should be the same instance as 253 | * the HUD's superview (i.e., the view that the HUD will be added to). 254 | */ 255 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 256 | - (id)initWithView:(UIView *)view; 257 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 258 | - (id)initWithView:(NSView *)view; 259 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 260 | 261 | #pragma mark - Show & hide 262 | 263 | /** 264 | * Display the HUD. You need to make sure that the main thread completes its run loop soon after this method call so 265 | * the user interface can be updated. Call this method when your task is already set-up to be executed in a new thread 266 | * (e.g., when using something like NSOperation or calling an asynchronous call like NSURLRequest). 267 | * 268 | * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use 269 | * animations while appearing. 270 | * 271 | * @see animationType 272 | */ 273 | - (void)show:(BOOL)animated; 274 | 275 | /** 276 | * Hide the HUD. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to 277 | * hide the HUD when your task completes. 278 | * 279 | * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use 280 | * animations while disappearing. 281 | * 282 | * @see animationType 283 | */ 284 | - (void)hide:(BOOL)animated; 285 | 286 | /** 287 | * Hide the HUD after a delay. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to 288 | * hide the HUD when your task completes. 289 | * 290 | * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use 291 | * animations while disappearing. 292 | * @param delay Delay in seconds until the HUD is hidden. 293 | * 294 | * @see animationType 295 | */ 296 | - (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay; 297 | 298 | /** 299 | * Read Only method that returns TRUE if HUD is no longer visible 300 | */ 301 | - (BOOL)isFinished; 302 | 303 | #pragma mark - Threading 304 | 305 | /** 306 | * Shows the HUD while a background task is executing in a new thread, then hides the HUD. 307 | * 308 | * This method also takes care of autorelease pools so your method does not have to be concerned with setting up a 309 | * pool. 310 | * 311 | * @param method The method to be executed while the HUD is shown. This method will be executed in a new thread. 312 | * @param target The object that the target method belongs to. 313 | * @param object An optional object to be passed to the method. 314 | * @param animated If set to YES the HUD will (dis)appear using the current animationType. If set to NO the HUD will not use 315 | * animations while (dis)appearing. 316 | */ 317 | - (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(BOOL)animated; 318 | 319 | #if NS_BLOCKS_AVAILABLE 320 | 321 | /** 322 | * Shows the HUD while a block is executing on a background queue, then hides the HUD. 323 | * 324 | * @see showAnimated:whileExecutingBlock:onQueue:completionBlock: 325 | */ 326 | - (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block; 327 | 328 | /** 329 | * Shows the HUD while a block is executing on a background queue, then hides the HUD. 330 | * 331 | * @see showAnimated:whileExecutingBlock:onQueue:completionBlock: 332 | */ 333 | - (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block completionBlock:(MBProgressHUDCompletionBlock)completion; 334 | 335 | /** 336 | * Shows the HUD while a block is executing on the specified dispatch queue, then hides the HUD. 337 | * 338 | * @see showAnimated:whileExecutingBlock:onQueue:completionBlock: 339 | */ 340 | - (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue; 341 | 342 | /** 343 | * Shows the HUD while a block is executing on the specified dispatch queue, executes completion block on the main queue, and then hides the HUD. 344 | * 345 | * @param animated If set to YES the HUD will (dis)appear using the current animationType. If set to NO the HUD will 346 | * not use animations while (dis)appearing. 347 | * @param block The block to be executed while the HUD is shown. 348 | * @param queue The dispatch queue on which the block should be executed. 349 | * @param completion The block to be executed on completion. 350 | * 351 | * @see completionBlock 352 | */ 353 | - (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue 354 | completionBlock:(MBProgressHUDCompletionBlock)completion; 355 | 356 | #pragma mark - Properties 357 | 358 | /** 359 | * A block that gets called after the HUD was completely hidden. 360 | */ 361 | @property (copy) MBProgressHUDCompletionBlock completionBlock; 362 | 363 | #endif // NS_BLOCKS_AVAILABLE 364 | 365 | /** 366 | * MBProgressHUD operation mode. The default is MBProgressHUDModeIndeterminate. 367 | * 368 | * @see MBProgressHUDMode 369 | */ 370 | @property (assign) MBProgressHUDMode mode; 371 | 372 | /** 373 | * The animation type that should be used when the HUD is shown and hidden. 374 | * 375 | * @see MBProgressHUDAnimation 376 | */ 377 | @property (assign) MBProgressHUDAnimation animationType; 378 | 379 | /** 380 | * The UIView (e.g., a UIImageView) to be shown when the HUD is in MBProgressHUDModeCustomView. 381 | * For best results use a 37 by 37 pixel view (so the bounds match the built in indicator bounds). 382 | */ 383 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 384 | @property (MB_STRONG) UIView *customView; 385 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 386 | @property (MB_STRONG) NSView *customView; 387 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 388 | 389 | /** 390 | * The HUD delegate object. 391 | * 392 | * @see MBProgressHUDDelegate 393 | */ 394 | @property (MB_WEAK) id delegate; 395 | 396 | /** 397 | * An optional short message to be displayed below the activity indicator. The HUD is automatically resized to fit 398 | * the entire text. If the text is too long it will get clipped by displaying "..." at the end. If left unchanged or 399 | * set to @"", then no message is displayed. 400 | */ 401 | @property (copy) NSString *labelText; 402 | 403 | /** 404 | * An optional details message displayed below the labelText message. This message is displayed only if the labelText 405 | * property is also set and is different from an empty string (@""). The details text can span multiple lines. 406 | */ 407 | @property (copy) NSString *detailsLabelText; 408 | 409 | /** 410 | * The opacity of the HUD window. Defaults to 0.8 (80% opacity). 411 | */ 412 | @property (assign) float opacity; 413 | 414 | /** 415 | * The color of the HUD window. Defaults to black. If this property is set, color is set using 416 | * this UIColor and the opacity property is not used. using retain because performing copy on 417 | * UIColor base colors (like [UIColor greenColor]) cause problems with the copyZone. 418 | */ 419 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 420 | @property (MB_STRONG) UIColor *color; 421 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 422 | @property (MB_STRONG) NSColor *color; 423 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 424 | /** 425 | * The x-axis offset of the HUD relative to the centre of the superview. 426 | */ 427 | @property (assign) float xOffset; 428 | 429 | /** 430 | * The y-axis offset of the HUD relative to the centre of the superview. 431 | */ 432 | @property (assign) float yOffset; 433 | 434 | /** 435 | * The size both horizontally and vertically of the spinner 436 | * Defaults to 37.0 on iOS and to 60.0 for Mac OS X 437 | */ 438 | @property (assign) float spinsize; 439 | 440 | /** 441 | * The amount of space between the HUD edge and the HUD elements (labels, indicators or custom views). 442 | * Defaults to 20.0 443 | */ 444 | @property (assign) float margin; 445 | 446 | /** 447 | * The corner radius for th HUD 448 | * Defaults to 10.0 449 | */ 450 | @property (assign) float cornerRadius; 451 | 452 | /** 453 | * Cover the HUD background view with a radial gradient. 454 | */ 455 | @property (assign) BOOL dimBackground; 456 | 457 | /** 458 | * Allow User to dismiss HUD manually by a tap event. This calls the optional hudWasTapped: delegate. 459 | * Defaults to NO. 460 | */ 461 | @property (assign) BOOL dismissible; 462 | 463 | 464 | /* 465 | * Grace period is the time (in seconds) that the invoked method may be run without 466 | * showing the HUD. If the task finishes before the grace time runs out, the HUD will 467 | * not be shown at all. 468 | * This may be used to prevent HUD display for very short tasks. 469 | * Defaults to 0 (no grace time). 470 | * Grace time functionality is only supported when the task status is known! 471 | * @see taskInProgress 472 | */ 473 | @property (assign) float graceTime; 474 | 475 | /** 476 | * The minimum time (in seconds) that the HUD is shown. 477 | * This avoids the problem of the HUD being shown and than instantly hidden. 478 | * Defaults to 0 (no minimum show time). 479 | */ 480 | @property (assign) float minShowTime; 481 | 482 | /** 483 | * Indicates that the executed operation is in progress. Needed for correct graceTime operation. 484 | * If you don't set a graceTime (different than 0.0) this does nothing. 485 | * This property is automatically set when using showWhileExecuting:onTarget:withObject:animated:. 486 | * When threading is done outside of the HUD (i.e., when the show: and hide: methods are used directly), 487 | * you need to set this property when your task starts and completes in order to have normal graceTime 488 | * functionality. 489 | */ 490 | @property (assign) BOOL taskInProgress; 491 | 492 | /** 493 | * Removes the HUD from its parent view when hidden. 494 | * Defaults to NO. 495 | */ 496 | @property (assign) BOOL removeFromSuperViewOnHide; 497 | 498 | /** 499 | * Font to be used for the main label. Set this property if the default is not adequate. 500 | */ 501 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 502 | @property (MB_STRONG) UIFont* labelFont; 503 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 504 | @property (MB_STRONG) NSFont* labelFont; 505 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 506 | 507 | /** 508 | * Color to be used for the main label. Set this property if the default is not adequate. 509 | */ 510 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 511 | @property (MB_STRONG) UIColor* labelColor; 512 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 513 | @property (MB_STRONG) NSColor* labelColor; 514 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 515 | 516 | /** 517 | * Font to be used for the details label. Set this property if the default is not adequate. 518 | */ 519 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 520 | @property (MB_STRONG) UIFont* detailsLabelFont; 521 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 522 | @property (MB_STRONG) NSFont* detailsLabelFont; 523 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 524 | 525 | /** 526 | * Color to be used for the details label. Set this property if the default is not adequate. 527 | */ 528 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 529 | @property (MB_STRONG) UIColor* detailsLabelColor; 530 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 531 | @property (MB_STRONG) NSColor* detailsLabelColor; 532 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 533 | 534 | /** 535 | * The progress of the progress indicator, from 0.0 to 1.0. Defaults to 0.0. 536 | */ 537 | @property (assign) float progress; 538 | 539 | /** 540 | * The minimum size of the HUD bezel. Defaults to CGSizeZero (no minimum size). 541 | */ 542 | @property (assign) CGSize minSize; 543 | 544 | /** 545 | * Force the HUD dimensions to be equal if possible. 546 | */ 547 | @property (assign, getter = isSquare) BOOL square; 548 | 549 | @end 550 | 551 | 552 | @protocol MBProgressHUDDelegate 553 | 554 | @optional 555 | 556 | /** 557 | * Called after the HUD was fully hidden from the screen. 558 | */ 559 | - (void)hudWasHidden:(MBProgressHUD *)hud; 560 | 561 | /** 562 | * Called after the HUD delay timed out but before HUD was fully hidden from the screen. 563 | */ 564 | - (void)hudWasHiddenAfterDelay:(MBProgressHUD *)hud; 565 | 566 | /** 567 | * Called after the HUD was Tapped with dismissible option enabled. 568 | */ 569 | - (void)hudWasTapped:(MBProgressHUD *)hud; 570 | 571 | /** 572 | * OS X Helper method to convert NSColor value to CGColorRef value. 573 | * 574 | * @nscolor NSColur instance to convert. 575 | * @return Converted NSColor to CGColorRef. 576 | */ 577 | #if !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 578 | - (CGColorRef)NSColorToCGColor:(NSColor *)nscolor; 579 | #endif // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 580 | 581 | @end 582 | 583 | 584 | /** 585 | * A progress view for showing definite progress by filling up a circle (pie chart). 586 | */ 587 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 588 | @interface MBRoundProgressView : UIView 589 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 590 | @interface MBRoundProgressView : NSView 591 | { 592 | CGColorRef _cgColorFromNSColor; 593 | } 594 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 595 | 596 | /** 597 | * Progress (0.0 to 1.0) 598 | */ 599 | @property (nonatomic, assign) float progress; 600 | 601 | /** 602 | * Indicator progress color. 603 | * Defaults to white [UIColor whiteColor] 604 | */ 605 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 606 | @property (nonatomic, MB_STRONG) UIColor *progressTintColor; 607 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 608 | @property (nonatomic, MB_STRONG) NSColor *progressTintColor; 609 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 610 | 611 | /** 612 | * Indicator background (non-progress) color. 613 | * Defaults to translucent white (alpha 0.1) 614 | */ 615 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 616 | @property (nonatomic, MB_STRONG) UIColor *backgroundTintColor; 617 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 618 | @property (nonatomic, MB_STRONG) NSColor *backgroundTintColor; 619 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 620 | 621 | /* 622 | * Display mode - NO = round or YES = annular. Defaults to round. 623 | */ 624 | @property (nonatomic, assign, getter = isAnnular) BOOL annular; 625 | 626 | @end 627 | 628 | 629 | /** 630 | * A flat bar progress view. 631 | */ 632 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 633 | @interface MBBarProgressView : UIView 634 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 635 | @interface MBBarProgressView : NSView 636 | { 637 | CGColorRef _cgColorFromNSColor; 638 | } 639 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 640 | 641 | /** 642 | * Progress (0.0 to 1.0) 643 | */ 644 | @property (nonatomic, assign) float progress; 645 | 646 | /** 647 | * Bar border line color. 648 | * Defaults to white [UIColor whiteColor]. 649 | */ 650 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 651 | @property (nonatomic, MB_STRONG) UIColor *lineColor; 652 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 653 | @property (nonatomic, MB_STRONG) NSColor *lineColor; 654 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 655 | 656 | /** 657 | * Bar background color. 658 | * Defaults to clear [UIColor clearColor]; 659 | */ 660 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 661 | @property (nonatomic, MB_STRONG) UIColor *progressRemainingColor; 662 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 663 | @property (nonatomic, MB_STRONG) NSColor *progressRemainingColor; 664 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 665 | 666 | /** 667 | * Bar progress color. 668 | * Defaults to white [UIColor whiteColor]. 669 | */ 670 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 671 | @property (nonatomic, MB_STRONG) UIColor *progressColor; 672 | #else // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 673 | @property (nonatomic, MB_STRONG) NSColor *progressColor; 674 | #endif // (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 675 | 676 | /** 677 | * OS X Helper method to convert NSColor value to CGColorRef value. 678 | * 679 | * @nscolor NSColur instance to convert. 680 | * @return Converted NSColor to CGColorRef. 681 | */ 682 | #if !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 683 | - (CGColorRef)NSColorToCGColor:(NSColor *)nscolor; 684 | #endif // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 685 | 686 | @end 687 | 688 | #if !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 689 | /** 690 | * A Spinner indefinite progress view modifying look of NSProgressIndicator. 691 | */ 692 | @interface MBSpinnerProgressView : NSProgressIndicator 693 | 694 | @end 695 | 696 | // 697 | // YRKSpinningProgressIndicator.h 698 | // 699 | // Copyright 2009 Kelan Champagne. All rights reserved. 700 | // 701 | // Modified for ObjC-ARC compatibility by Wayne Fox 2014 702 | 703 | @interface YRKSpinningProgressIndicator : NSView { 704 | int _position; 705 | int _numFins; 706 | #if __has_feature(objc_arc) 707 | NSMutableArray *_finColors; 708 | #else 709 | NSColor **_finColors; 710 | #endif 711 | 712 | BOOL _isAnimating; 713 | BOOL _isFadingOut; 714 | NSTimer *_animationTimer; 715 | NSThread *_animationThread; 716 | 717 | NSColor *_foreColor; 718 | NSColor *_backColor; 719 | BOOL _drawsBackground; 720 | 721 | BOOL _displayedWhenStopped; 722 | BOOL _usesThreadedAnimation; 723 | 724 | // For determinate mode 725 | BOOL _isIndeterminate; 726 | double _currentValue; 727 | double _maxValue; 728 | } 729 | 730 | @property (nonatomic, retain) NSColor *color; 731 | @property (nonatomic, retain) NSColor *backgroundColor; 732 | @property (nonatomic, assign) BOOL drawsBackground; 733 | 734 | @property (nonatomic, assign, getter=isDisplayedWhenStopped) BOOL displayedWhenStopped; 735 | @property (nonatomic, assign) BOOL usesThreadedAnimation; 736 | 737 | @property (nonatomic, assign, getter=isIndeterminate) BOOL indeterminate; 738 | @property (nonatomic, assign) double doubleValue; 739 | @property (nonatomic, assign) double maxValue; 740 | 741 | - (void)stopAnimation:(id)sender; 742 | - (void)startAnimation:(id)sender; 743 | 744 | @end 745 | 746 | #endif // !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 747 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MBProgressHUD-OSX 2 | 3 | A fork and conversion of [Matej Bukovinski's MBProgressHUD](https://github.com/matej/MBProgressHUD) for iOS to run on OS X. 4 | See [Matej Bukovinski's MBProgressHUD in github](https://github.com/matej/MBProgressHUD) for latest iOS official repository. 5 | 6 | The MBProgressHUD class is still iOS compatible and can be deployed for either platform. 7 | The MBProgressHUD class also supports ARC and Non-ARC compilation. 8 | 9 | For OS X, I also used Kelan Champagne's YRKSpinningProgressIndicator, replacing 10 | the OS X NSProgressIndicator. 11 | 12 | MBProgressHUD is an iOS/OS X drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, private UIKit UIProgressHUD with some additional features. 13 | 14 | ## iOS Examples 15 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/1-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/1.png) 16 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/2-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/2.png) 17 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/3-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/3.png) 18 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/4-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/4.png) 19 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/5-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/5.png) 20 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/6-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/6.png) 21 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/7-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/7.png) 22 | 23 | ## OS X Examples 24 | [![](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_1_thumb.png)](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_1.png) 25 | [![](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_2_thumb.png)](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_2.png) 26 | [![](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_3_thumb.png)](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_3.png) 27 | [![](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_4_thumb.png)](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_4.png) 28 | [![](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_6_thumb.png)](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_6.png) 29 | [![](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_7_thumb.png)](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_7.png) 30 | [![](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_13_thumb.png)](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_13.png) 31 | [![](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_14_thumb.png)](http://dl.dropbox.com/u/176305/MBProgressHUD-OSX/OSX_14.png) 32 | 33 | 34 | ## Requirements 35 | 36 | MBProgressHUD works on any iOS or OS X version and is compatible with both ARC and non-ARC projects. It depends on the following Apple frameworks, which should already be included with most Xcode templates: 37 | 38 | ### iOS 39 | * Foundation.framework 40 | * UIKit.framework 41 | * CoreGraphics.framework 42 | 43 | ### OS X 44 | * Foundation.framework 45 | * AppKit.framework 46 | * CoreData.framework 47 | 48 | You will need LLVM 3.0 or later in order to build MBProgressHUD. 49 | 50 | ## Adding MBProgressHUD to your project 51 | 52 | ### Cocoapods 53 | 54 | I have not yet enabled [CocoaPods](http://cocoapods.org) for this OS X compatible version of MBProgressHUD. 55 | 56 | ### Source files 57 | 58 | Meanwhile, you can directly add the `MBProgressHUD.h` and `MBProgressHUD.m` source files to your project. 59 | 60 | 1. Download the [latest code version](https://github.com/Foxnolds/MBProgressHUD-OSX/archive/master.zip) or add the repository as a git submodule to your git-tracked project. 61 | 2. Open your project in Xcode, then drag and drop `MBProgressHUD.h` and `MBProgressHUD.m` onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project. 62 | 3. Include MBProgressHUD wherever you need it with `#import "MBProgressHUD.h"`. 63 | 64 | ### Static library 65 | 66 | You can also add MBProgressHUD as a static library to your project or workspace. 67 | 68 | 1. Download the [latest code version](https://github.com/Foxnolds/MBProgressHUD-OSX/archive/master.zip) or add the repository as a git submodule to your git-tracked project. 69 | 2. Open your project in Xcode, then drag and drop `MBProgressHUD.xcodeproj` onto your project or workspace (use the "Product Navigator view"). 70 | 3. Select your target and go to the Build phases tab. In the Link Binary With Libraries section select the add button. On the sheet find and add `libMBProgressHUD.a`. You might also need to add `MBProgressHUD` to the Target Dependencies list. 71 | 4. Include MBProgressHUD wherever you need it with `#import `. 72 | 73 | ## Usage 74 | 75 | The main guideline you need to follow when dealing with MBProgressHUD while running long-running tasks is keeping the main thread work-free, so the UI can be updated promptly. The recommended way of using MBProgressHUD is therefore to set it up on the main thread and then spinning the task, that you want to perform, off onto a new thread. 76 | 77 | ```objective-c 78 | [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 79 | dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ 80 | // Do something... 81 | dispatch_async(dispatch_get_main_queue(), ^{ 82 | [MBProgressHUD hideHUDForView:self.view animated:YES]; 83 | }); 84 | }); 85 | ``` 86 | 87 | If you need to configure the HUD you can do this by using the MBProgressHUD reference that showHUDAddedTo:animated: returns. 88 | 89 | ```objective-c 90 | MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 91 | hud.mode = MBProgressHUDModeAnnularDeterminate; 92 | hud.labelText = @"Loading"; 93 | [self doSomethingInBackgroundWithProgressCallback:^(float progress) { 94 | hud.progress = progress; 95 | } completionCallback:^{ 96 | [hud hide:YES]; 97 | }]; 98 | ``` 99 | 100 | UI updates should always be done on the main thread. Some MBProgressHUD setters are however considered "thread safe" and can be called from background threads. Those also include `setMode:`, `setCustomView:`, `setLabelText:`, `setLabelFont:`, `setDetailsLabelText:`, `setDetailsLabelFont:` and `setProgress:`. 101 | 102 | If you need to run your long-running task in the main thread, you should perform it with a slight delay, so UIKit will have enough time to update the UI (i.e., draw the HUD) before you block the main thread with your task. 103 | 104 | ```objective-c 105 | [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 106 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 0.01 * NSEC_PER_SEC); 107 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 108 | // Do something... 109 | [MBProgressHUD hideHUDForView:self.view animated:YES]; 110 | }); 111 | ``` 112 | 113 | You should be aware that any HUD updates issued inside the above block won't be displayed until the block completes. 114 | 115 | For more examples, including how to use MBProgressHUD with asynchronous operations such as NSURLConnection, take a look at the bundled demo project. Extensive API documentation is provided in the header file (MBProgressHUD.h). 116 | 117 | 118 | ## License 119 | 120 | This code is distributed under the terms and conditions of the [MIT license](LICENSE). 121 | 122 | ## Change-log 123 | 124 | - Initial fork of iOS 0.8 release. 125 | --------------------------------------------------------------------------------