├── .gitignore ├── LICENSE ├── Project ├── XHFriendlyLoadingView.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── XHFriendlyLoadingView │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── Main_iPad.storyboard │ │ └── Main_iPhone.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── 114.png │ │ │ ├── 120.png │ │ │ ├── 152.png │ │ │ ├── 76.png │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ ├── Contents.json │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default-Portrait.png │ │ │ ├── Default-Portrait@2x.png │ │ │ └── Default@2x.png │ ├── ViewController.h │ ├── ViewController.m │ ├── XHFriendlyLoadingView-Info.plist │ ├── XHFriendlyLoadingView-Prefix.pch │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── XHFriendlyLoadingViewTests │ ├── XHFriendlyLoadingViewTests-Info.plist │ ├── XHFriendlyLoadingViewTests.m │ └── en.lproj │ └── InfoPlist.strings ├── README.md ├── Screenshots └── XHFriendlyLoadingView.gif └── Source ├── Resources ├── refresh.png └── refresh@2x.png ├── XHFriendlyLoadingView.h └── XHFriendlyLoadingView.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 JackTeam 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | ABD224DD18736E5800969AD3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABD224DC18736E5800969AD3 /* Foundation.framework */; }; 11 | ABD224DF18736E5800969AD3 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABD224DE18736E5800969AD3 /* CoreGraphics.framework */; }; 12 | ABD224E118736E5800969AD3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABD224E018736E5800969AD3 /* UIKit.framework */; }; 13 | ABD224E718736E5800969AD3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ABD224E518736E5800969AD3 /* InfoPlist.strings */; }; 14 | ABD224E918736E5800969AD3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ABD224E818736E5800969AD3 /* main.m */; }; 15 | ABD224ED18736E5800969AD3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ABD224EC18736E5800969AD3 /* AppDelegate.m */; }; 16 | ABD224F018736E5800969AD3 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ABD224EE18736E5800969AD3 /* Main_iPhone.storyboard */; }; 17 | ABD224F318736E5800969AD3 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ABD224F118736E5800969AD3 /* Main_iPad.storyboard */; }; 18 | ABD224F618736E5800969AD3 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABD224F518736E5800969AD3 /* ViewController.m */; }; 19 | ABD224F818736E5800969AD3 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ABD224F718736E5800969AD3 /* Images.xcassets */; }; 20 | ABD224FF18736E5800969AD3 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABD224FE18736E5800969AD3 /* XCTest.framework */; }; 21 | ABD2250018736E5800969AD3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABD224DC18736E5800969AD3 /* Foundation.framework */; }; 22 | ABD2250118736E5800969AD3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABD224E018736E5800969AD3 /* UIKit.framework */; }; 23 | ABD2250918736E5800969AD3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ABD2250718736E5800969AD3 /* InfoPlist.strings */; }; 24 | ABD2250B18736E5800969AD3 /* XHFriendlyLoadingViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = ABD2250A18736E5800969AD3 /* XHFriendlyLoadingViewTests.m */; }; 25 | ABD2251718736E9500969AD3 /* XHFriendlyLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = ABD2251618736E9500969AD3 /* XHFriendlyLoadingView.m */; }; 26 | ABD2251B18737ACD00969AD3 /* refresh.png in Resources */ = {isa = PBXBuildFile; fileRef = ABD2251918737ACD00969AD3 /* refresh.png */; }; 27 | ABD2251C18737ACD00969AD3 /* refresh@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ABD2251A18737ACD00969AD3 /* refresh@2x.png */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXContainerItemProxy section */ 31 | ABD2250218736E5800969AD3 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = ABD224D118736E5800969AD3 /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = ABD224D818736E5800969AD3; 36 | remoteInfo = XHFriendlyLoadingView; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | ABD224D918736E5800969AD3 /* XHFriendlyLoadingView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XHFriendlyLoadingView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | ABD224DC18736E5800969AD3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 43 | ABD224DE18736E5800969AD3 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 44 | ABD224E018736E5800969AD3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 45 | ABD224E418736E5800969AD3 /* XHFriendlyLoadingView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XHFriendlyLoadingView-Info.plist"; sourceTree = ""; }; 46 | ABD224E618736E5800969AD3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 47 | ABD224E818736E5800969AD3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 48 | ABD224EA18736E5800969AD3 /* XHFriendlyLoadingView-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XHFriendlyLoadingView-Prefix.pch"; sourceTree = ""; }; 49 | ABD224EB18736E5800969AD3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 50 | ABD224EC18736E5800969AD3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 51 | ABD224EF18736E5800969AD3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; }; 52 | ABD224F218736E5800969AD3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; }; 53 | ABD224F418736E5800969AD3 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 54 | ABD224F518736E5800969AD3 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 55 | ABD224F718736E5800969AD3 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 56 | ABD224FD18736E5800969AD3 /* XHFriendlyLoadingViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XHFriendlyLoadingViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | ABD224FE18736E5800969AD3 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 58 | ABD2250618736E5800969AD3 /* XHFriendlyLoadingViewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XHFriendlyLoadingViewTests-Info.plist"; sourceTree = ""; }; 59 | ABD2250818736E5800969AD3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 60 | ABD2250A18736E5800969AD3 /* XHFriendlyLoadingViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XHFriendlyLoadingViewTests.m; sourceTree = ""; }; 61 | ABD2251518736E9500969AD3 /* XHFriendlyLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHFriendlyLoadingView.h; sourceTree = ""; }; 62 | ABD2251618736E9500969AD3 /* XHFriendlyLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHFriendlyLoadingView.m; sourceTree = ""; }; 63 | ABD2251918737ACD00969AD3 /* refresh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = refresh.png; sourceTree = ""; }; 64 | ABD2251A18737ACD00969AD3 /* refresh@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "refresh@2x.png"; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | ABD224D618736E5800969AD3 /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ABD224DF18736E5800969AD3 /* CoreGraphics.framework in Frameworks */, 73 | ABD224E118736E5800969AD3 /* UIKit.framework in Frameworks */, 74 | ABD224DD18736E5800969AD3 /* Foundation.framework in Frameworks */, 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | ABD224FA18736E5800969AD3 /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | ABD224FF18736E5800969AD3 /* XCTest.framework in Frameworks */, 83 | ABD2250118736E5800969AD3 /* UIKit.framework in Frameworks */, 84 | ABD2250018736E5800969AD3 /* Foundation.framework in Frameworks */, 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | /* End PBXFrameworksBuildPhase section */ 89 | 90 | /* Begin PBXGroup section */ 91 | ABD224D018736E5800969AD3 = { 92 | isa = PBXGroup; 93 | children = ( 94 | ABD2251418736E8800969AD3 /* Source */, 95 | ABD224E218736E5800969AD3 /* XHFriendlyLoadingView */, 96 | ABD2250418736E5800969AD3 /* XHFriendlyLoadingViewTests */, 97 | ABD224DB18736E5800969AD3 /* Frameworks */, 98 | ABD224DA18736E5800969AD3 /* Products */, 99 | ); 100 | sourceTree = ""; 101 | }; 102 | ABD224DA18736E5800969AD3 /* Products */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | ABD224D918736E5800969AD3 /* XHFriendlyLoadingView.app */, 106 | ABD224FD18736E5800969AD3 /* XHFriendlyLoadingViewTests.xctest */, 107 | ); 108 | name = Products; 109 | sourceTree = ""; 110 | }; 111 | ABD224DB18736E5800969AD3 /* Frameworks */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | ABD224DC18736E5800969AD3 /* Foundation.framework */, 115 | ABD224DE18736E5800969AD3 /* CoreGraphics.framework */, 116 | ABD224E018736E5800969AD3 /* UIKit.framework */, 117 | ABD224FE18736E5800969AD3 /* XCTest.framework */, 118 | ); 119 | name = Frameworks; 120 | sourceTree = ""; 121 | }; 122 | ABD224E218736E5800969AD3 /* XHFriendlyLoadingView */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | ABD224EB18736E5800969AD3 /* AppDelegate.h */, 126 | ABD224EC18736E5800969AD3 /* AppDelegate.m */, 127 | ABD224EE18736E5800969AD3 /* Main_iPhone.storyboard */, 128 | ABD224F118736E5800969AD3 /* Main_iPad.storyboard */, 129 | ABD224F418736E5800969AD3 /* ViewController.h */, 130 | ABD224F518736E5800969AD3 /* ViewController.m */, 131 | ABD224F718736E5800969AD3 /* Images.xcassets */, 132 | ABD224E318736E5800969AD3 /* Supporting Files */, 133 | ); 134 | path = XHFriendlyLoadingView; 135 | sourceTree = ""; 136 | }; 137 | ABD224E318736E5800969AD3 /* Supporting Files */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | ABD224E418736E5800969AD3 /* XHFriendlyLoadingView-Info.plist */, 141 | ABD224E518736E5800969AD3 /* InfoPlist.strings */, 142 | ABD224E818736E5800969AD3 /* main.m */, 143 | ABD224EA18736E5800969AD3 /* XHFriendlyLoadingView-Prefix.pch */, 144 | ); 145 | name = "Supporting Files"; 146 | sourceTree = ""; 147 | }; 148 | ABD2250418736E5800969AD3 /* XHFriendlyLoadingViewTests */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | ABD2250A18736E5800969AD3 /* XHFriendlyLoadingViewTests.m */, 152 | ABD2250518736E5800969AD3 /* Supporting Files */, 153 | ); 154 | path = XHFriendlyLoadingViewTests; 155 | sourceTree = ""; 156 | }; 157 | ABD2250518736E5800969AD3 /* Supporting Files */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | ABD2250618736E5800969AD3 /* XHFriendlyLoadingViewTests-Info.plist */, 161 | ABD2250718736E5800969AD3 /* InfoPlist.strings */, 162 | ); 163 | name = "Supporting Files"; 164 | sourceTree = ""; 165 | }; 166 | ABD2251418736E8800969AD3 /* Source */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | ABD2251818737AC200969AD3 /* Resources */, 170 | ABD2251518736E9500969AD3 /* XHFriendlyLoadingView.h */, 171 | ABD2251618736E9500969AD3 /* XHFriendlyLoadingView.m */, 172 | ); 173 | name = Source; 174 | path = ../Source; 175 | sourceTree = ""; 176 | }; 177 | ABD2251818737AC200969AD3 /* Resources */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | ABD2251918737ACD00969AD3 /* refresh.png */, 181 | ABD2251A18737ACD00969AD3 /* refresh@2x.png */, 182 | ); 183 | path = Resources; 184 | sourceTree = ""; 185 | }; 186 | /* End PBXGroup section */ 187 | 188 | /* Begin PBXNativeTarget section */ 189 | ABD224D818736E5800969AD3 /* XHFriendlyLoadingView */ = { 190 | isa = PBXNativeTarget; 191 | buildConfigurationList = ABD2250E18736E5900969AD3 /* Build configuration list for PBXNativeTarget "XHFriendlyLoadingView" */; 192 | buildPhases = ( 193 | ABD224D518736E5800969AD3 /* Sources */, 194 | ABD224D618736E5800969AD3 /* Frameworks */, 195 | ABD224D718736E5800969AD3 /* Resources */, 196 | ); 197 | buildRules = ( 198 | ); 199 | dependencies = ( 200 | ); 201 | name = XHFriendlyLoadingView; 202 | productName = XHFriendlyLoadingView; 203 | productReference = ABD224D918736E5800969AD3 /* XHFriendlyLoadingView.app */; 204 | productType = "com.apple.product-type.application"; 205 | }; 206 | ABD224FC18736E5800969AD3 /* XHFriendlyLoadingViewTests */ = { 207 | isa = PBXNativeTarget; 208 | buildConfigurationList = ABD2251118736E5900969AD3 /* Build configuration list for PBXNativeTarget "XHFriendlyLoadingViewTests" */; 209 | buildPhases = ( 210 | ABD224F918736E5800969AD3 /* Sources */, 211 | ABD224FA18736E5800969AD3 /* Frameworks */, 212 | ABD224FB18736E5800969AD3 /* Resources */, 213 | ); 214 | buildRules = ( 215 | ); 216 | dependencies = ( 217 | ABD2250318736E5800969AD3 /* PBXTargetDependency */, 218 | ); 219 | name = XHFriendlyLoadingViewTests; 220 | productName = XHFriendlyLoadingViewTests; 221 | productReference = ABD224FD18736E5800969AD3 /* XHFriendlyLoadingViewTests.xctest */; 222 | productType = "com.apple.product-type.bundle.unit-test"; 223 | }; 224 | /* End PBXNativeTarget section */ 225 | 226 | /* Begin PBXProject section */ 227 | ABD224D118736E5800969AD3 /* Project object */ = { 228 | isa = PBXProject; 229 | attributes = { 230 | LastUpgradeCheck = 0500; 231 | ORGANIZATIONNAME = "曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507"; 232 | TargetAttributes = { 233 | ABD224FC18736E5800969AD3 = { 234 | TestTargetID = ABD224D818736E5800969AD3; 235 | }; 236 | }; 237 | }; 238 | buildConfigurationList = ABD224D418736E5800969AD3 /* Build configuration list for PBXProject "XHFriendlyLoadingView" */; 239 | compatibilityVersion = "Xcode 3.2"; 240 | developmentRegion = English; 241 | hasScannedForEncodings = 0; 242 | knownRegions = ( 243 | en, 244 | Base, 245 | ); 246 | mainGroup = ABD224D018736E5800969AD3; 247 | productRefGroup = ABD224DA18736E5800969AD3 /* Products */; 248 | projectDirPath = ""; 249 | projectRoot = ""; 250 | targets = ( 251 | ABD224D818736E5800969AD3 /* XHFriendlyLoadingView */, 252 | ABD224FC18736E5800969AD3 /* XHFriendlyLoadingViewTests */, 253 | ); 254 | }; 255 | /* End PBXProject section */ 256 | 257 | /* Begin PBXResourcesBuildPhase section */ 258 | ABD224D718736E5800969AD3 /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | ABD224F318736E5800969AD3 /* Main_iPad.storyboard in Resources */, 263 | ABD224F818736E5800969AD3 /* Images.xcassets in Resources */, 264 | ABD224F018736E5800969AD3 /* Main_iPhone.storyboard in Resources */, 265 | ABD224E718736E5800969AD3 /* InfoPlist.strings in Resources */, 266 | ABD2251C18737ACD00969AD3 /* refresh@2x.png in Resources */, 267 | ABD2251B18737ACD00969AD3 /* refresh.png in Resources */, 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | ABD224FB18736E5800969AD3 /* Resources */ = { 272 | isa = PBXResourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | ABD2250918736E5800969AD3 /* InfoPlist.strings in Resources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXResourcesBuildPhase section */ 280 | 281 | /* Begin PBXSourcesBuildPhase section */ 282 | ABD224D518736E5800969AD3 /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | ABD2251718736E9500969AD3 /* XHFriendlyLoadingView.m in Sources */, 287 | ABD224F618736E5800969AD3 /* ViewController.m in Sources */, 288 | ABD224ED18736E5800969AD3 /* AppDelegate.m in Sources */, 289 | ABD224E918736E5800969AD3 /* main.m in Sources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | ABD224F918736E5800969AD3 /* Sources */ = { 294 | isa = PBXSourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | ABD2250B18736E5800969AD3 /* XHFriendlyLoadingViewTests.m in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXSourcesBuildPhase section */ 302 | 303 | /* Begin PBXTargetDependency section */ 304 | ABD2250318736E5800969AD3 /* PBXTargetDependency */ = { 305 | isa = PBXTargetDependency; 306 | target = ABD224D818736E5800969AD3 /* XHFriendlyLoadingView */; 307 | targetProxy = ABD2250218736E5800969AD3 /* PBXContainerItemProxy */; 308 | }; 309 | /* End PBXTargetDependency section */ 310 | 311 | /* Begin PBXVariantGroup section */ 312 | ABD224E518736E5800969AD3 /* InfoPlist.strings */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | ABD224E618736E5800969AD3 /* en */, 316 | ); 317 | name = InfoPlist.strings; 318 | sourceTree = ""; 319 | }; 320 | ABD224EE18736E5800969AD3 /* Main_iPhone.storyboard */ = { 321 | isa = PBXVariantGroup; 322 | children = ( 323 | ABD224EF18736E5800969AD3 /* Base */, 324 | ); 325 | name = Main_iPhone.storyboard; 326 | sourceTree = ""; 327 | }; 328 | ABD224F118736E5800969AD3 /* Main_iPad.storyboard */ = { 329 | isa = PBXVariantGroup; 330 | children = ( 331 | ABD224F218736E5800969AD3 /* Base */, 332 | ); 333 | name = Main_iPad.storyboard; 334 | sourceTree = ""; 335 | }; 336 | ABD2250718736E5800969AD3 /* InfoPlist.strings */ = { 337 | isa = PBXVariantGroup; 338 | children = ( 339 | ABD2250818736E5800969AD3 /* en */, 340 | ); 341 | name = InfoPlist.strings; 342 | sourceTree = ""; 343 | }; 344 | /* End PBXVariantGroup section */ 345 | 346 | /* Begin XCBuildConfiguration section */ 347 | ABD2250C18736E5900969AD3 /* Debug */ = { 348 | isa = XCBuildConfiguration; 349 | buildSettings = { 350 | ALWAYS_SEARCH_USER_PATHS = NO; 351 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 352 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 353 | CLANG_CXX_LIBRARY = "libc++"; 354 | CLANG_ENABLE_MODULES = YES; 355 | CLANG_ENABLE_OBJC_ARC = YES; 356 | CLANG_WARN_BOOL_CONVERSION = YES; 357 | CLANG_WARN_CONSTANT_CONVERSION = YES; 358 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INT_CONVERSION = YES; 362 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 365 | COPY_PHASE_STRIP = NO; 366 | GCC_C_LANGUAGE_STANDARD = gnu99; 367 | GCC_DYNAMIC_NO_PIC = NO; 368 | GCC_OPTIMIZATION_LEVEL = 0; 369 | GCC_PREPROCESSOR_DEFINITIONS = ( 370 | "DEBUG=1", 371 | "$(inherited)", 372 | ); 373 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 381 | ONLY_ACTIVE_ARCH = YES; 382 | SDKROOT = iphoneos; 383 | TARGETED_DEVICE_FAMILY = "1,2"; 384 | }; 385 | name = Debug; 386 | }; 387 | ABD2250D18736E5900969AD3 /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BOOL_CONVERSION = YES; 397 | CLANG_WARN_CONSTANT_CONVERSION = YES; 398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INT_CONVERSION = YES; 402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 405 | COPY_PHASE_STRIP = YES; 406 | ENABLE_NS_ASSERTIONS = NO; 407 | GCC_C_LANGUAGE_STANDARD = gnu99; 408 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 409 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 410 | GCC_WARN_UNDECLARED_SELECTOR = YES; 411 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 412 | GCC_WARN_UNUSED_FUNCTION = YES; 413 | GCC_WARN_UNUSED_VARIABLE = YES; 414 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 415 | SDKROOT = iphoneos; 416 | TARGETED_DEVICE_FAMILY = "1,2"; 417 | VALIDATE_PRODUCT = YES; 418 | }; 419 | name = Release; 420 | }; 421 | ABD2250F18736E5900969AD3 /* Debug */ = { 422 | isa = XCBuildConfiguration; 423 | buildSettings = { 424 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 425 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 426 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 427 | GCC_PREFIX_HEADER = "XHFriendlyLoadingView/XHFriendlyLoadingView-Prefix.pch"; 428 | INFOPLIST_FILE = "XHFriendlyLoadingView/XHFriendlyLoadingView-Info.plist"; 429 | PRODUCT_NAME = "$(TARGET_NAME)"; 430 | WRAPPER_EXTENSION = app; 431 | }; 432 | name = Debug; 433 | }; 434 | ABD2251018736E5900969AD3 /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 438 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 439 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 440 | GCC_PREFIX_HEADER = "XHFriendlyLoadingView/XHFriendlyLoadingView-Prefix.pch"; 441 | INFOPLIST_FILE = "XHFriendlyLoadingView/XHFriendlyLoadingView-Info.plist"; 442 | PRODUCT_NAME = "$(TARGET_NAME)"; 443 | WRAPPER_EXTENSION = app; 444 | }; 445 | name = Release; 446 | }; 447 | ABD2251218736E5900969AD3 /* Debug */ = { 448 | isa = XCBuildConfiguration; 449 | buildSettings = { 450 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 451 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XHFriendlyLoadingView.app/XHFriendlyLoadingView"; 452 | FRAMEWORK_SEARCH_PATHS = ( 453 | "$(SDKROOT)/Developer/Library/Frameworks", 454 | "$(inherited)", 455 | "$(DEVELOPER_FRAMEWORKS_DIR)", 456 | ); 457 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 458 | GCC_PREFIX_HEADER = "XHFriendlyLoadingView/XHFriendlyLoadingView-Prefix.pch"; 459 | GCC_PREPROCESSOR_DEFINITIONS = ( 460 | "DEBUG=1", 461 | "$(inherited)", 462 | ); 463 | INFOPLIST_FILE = "XHFriendlyLoadingViewTests/XHFriendlyLoadingViewTests-Info.plist"; 464 | PRODUCT_NAME = "$(TARGET_NAME)"; 465 | TEST_HOST = "$(BUNDLE_LOADER)"; 466 | WRAPPER_EXTENSION = xctest; 467 | }; 468 | name = Debug; 469 | }; 470 | ABD2251318736E5900969AD3 /* Release */ = { 471 | isa = XCBuildConfiguration; 472 | buildSettings = { 473 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 474 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XHFriendlyLoadingView.app/XHFriendlyLoadingView"; 475 | FRAMEWORK_SEARCH_PATHS = ( 476 | "$(SDKROOT)/Developer/Library/Frameworks", 477 | "$(inherited)", 478 | "$(DEVELOPER_FRAMEWORKS_DIR)", 479 | ); 480 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 481 | GCC_PREFIX_HEADER = "XHFriendlyLoadingView/XHFriendlyLoadingView-Prefix.pch"; 482 | INFOPLIST_FILE = "XHFriendlyLoadingViewTests/XHFriendlyLoadingViewTests-Info.plist"; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | TEST_HOST = "$(BUNDLE_LOADER)"; 485 | WRAPPER_EXTENSION = xctest; 486 | }; 487 | name = Release; 488 | }; 489 | /* End XCBuildConfiguration section */ 490 | 491 | /* Begin XCConfigurationList section */ 492 | ABD224D418736E5800969AD3 /* Build configuration list for PBXProject "XHFriendlyLoadingView" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | ABD2250C18736E5900969AD3 /* Debug */, 496 | ABD2250D18736E5900969AD3 /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | ABD2250E18736E5900969AD3 /* Build configuration list for PBXNativeTarget "XHFriendlyLoadingView" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | ABD2250F18736E5900969AD3 /* Debug */, 505 | ABD2251018736E5900969AD3 /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | ABD2251118736E5900969AD3 /* Build configuration list for PBXNativeTarget "XHFriendlyLoadingViewTests" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | ABD2251218736E5900969AD3 /* Debug */, 514 | ABD2251318736E5900969AD3 /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | /* End XCConfigurationList section */ 520 | }; 521 | rootObject = ABD224D118736E5800969AD3 /* Project object */; 522 | } 523 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // XHFriendlyLoadingView 4 | // 5 | // Created by 曾 宪华 on 13-12-31. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // XHFriendlyLoadingView 4 | // 5 | // Created by 曾 宪华 on 13-12-31. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Base.lproj/Main_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Base.lproj/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 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 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/AppIcon.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Project/XHFriendlyLoadingView/Images.xcassets/AppIcon.appiconset/114.png -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Project/XHFriendlyLoadingView/Images.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/AppIcon.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Project/XHFriendlyLoadingView/Images.xcassets/AppIcon.appiconset/152.png -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Project/XHFriendlyLoadingView/Images.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "size" : "40x40", 10 | "idiom" : "iphone", 11 | "filename" : "114.png", 12 | "scale" : "2x" 13 | }, 14 | { 15 | "size" : "60x60", 16 | "idiom" : "iphone", 17 | "filename" : "120.png", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "idiom" : "ipad", 22 | "size" : "29x29", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "idiom" : "ipad", 27 | "size" : "29x29", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "idiom" : "ipad", 32 | "size" : "40x40", 33 | "scale" : "1x" 34 | }, 35 | { 36 | "idiom" : "ipad", 37 | "size" : "40x40", 38 | "scale" : "2x" 39 | }, 40 | { 41 | "size" : "76x76", 42 | "idiom" : "ipad", 43 | "filename" : "76.png", 44 | "scale" : "1x" 45 | }, 46 | { 47 | "size" : "76x76", 48 | "idiom" : "ipad", 49 | "filename" : "152.png", 50 | "scale" : "2x" 51 | } 52 | ], 53 | "info" : { 54 | "version" : 1, 55 | "author" : "xcode" 56 | } 57 | } -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "filename" : "Default@2x.png", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "extent" : "full-screen", 13 | "idiom" : "iphone", 14 | "subtype" : "retina4", 15 | "filename" : "Default-568h@2x.png", 16 | "minimum-system-version" : "7.0", 17 | "orientation" : "portrait", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "orientation" : "portrait", 22 | "idiom" : "ipad", 23 | "extent" : "full-screen", 24 | "minimum-system-version" : "7.0", 25 | "filename" : "Default-Portrait.png", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "orientation" : "landscape", 30 | "idiom" : "ipad", 31 | "extent" : "full-screen", 32 | "minimum-system-version" : "7.0", 33 | "scale" : "1x" 34 | }, 35 | { 36 | "orientation" : "portrait", 37 | "idiom" : "ipad", 38 | "extent" : "full-screen", 39 | "minimum-system-version" : "7.0", 40 | "filename" : "Default-Portrait@2x.png", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "orientation" : "landscape", 45 | "idiom" : "ipad", 46 | "extent" : "full-screen", 47 | "minimum-system-version" : "7.0", 48 | "scale" : "2x" 49 | } 50 | ], 51 | "info" : { 52 | "version" : 1, 53 | "author" : "xcode" 54 | } 55 | } -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Project/XHFriendlyLoadingView/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Project/XHFriendlyLoadingView/Images.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Project/XHFriendlyLoadingView/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/Images.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Project/XHFriendlyLoadingView/Images.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // XHFriendlyLoadingView 4 | // 5 | // Created by 曾 宪华 on 13-12-31. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // XHFriendlyLoadingView 4 | // 5 | // Created by 曾 宪华 on 13-12-31. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "XHFriendlyLoadingView.h" 11 | 12 | @interface ViewController () { 13 | NSInteger selectedCount; // default is 1 14 | } 15 | 16 | @property (nonatomic, strong) XHFriendlyLoadingView *friendlyLoadingView; 17 | 18 | @end 19 | 20 | @implementation ViewController 21 | 22 | - (void)viewWillAppear:(BOOL)animated { 23 | [super viewWillAppear:animated]; 24 | } 25 | 26 | - (void)viewDidAppear:(BOOL)animated { 27 | [super viewDidAppear:animated]; 28 | [self showLoading]; 29 | } 30 | 31 | - (void)showLoading { 32 | [self.friendlyLoadingView showFriendlyLoadingViewWithText:@"正在加载..." loadingAnimated:YES]; 33 | 34 | double delayInSeconds = 3.0; 35 | __weak typeof(self) weakSelf = self; 36 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); 37 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { 38 | selectedCount ++; 39 | if (selectedCount == 3) { 40 | [weakSelf.friendlyLoadingView showFriendlyLoadingViewWithText:@"重新加载失败,请返回检查网络。" loadingAnimated:NO]; 41 | } else { 42 | [weakSelf.friendlyLoadingView showReloadViewWithText:@"加载失败,请点击刷新按钮重新加载。"]; 43 | } 44 | }); 45 | } 46 | 47 | - (void)viewDidLoad 48 | { 49 | [super viewDidLoad]; 50 | // Do any additional setup after loading the view, typically from a nib. 51 | self.view.backgroundColor = [UIColor whiteColor]; 52 | 53 | _friendlyLoadingView = [[XHFriendlyLoadingView alloc] initWithFrame:self.view.bounds]; 54 | 55 | __weak typeof(self) weakSelf = self; 56 | self.friendlyLoadingView.reloadButtonClickedCompleted = ^(UIButton *sender) { 57 | // 这里可以做网络重新加载的地方 58 | 59 | [weakSelf showLoading]; 60 | }; 61 | [self.view addSubview:self.friendlyLoadingView]; 62 | } 63 | 64 | - (void)didReceiveMemoryWarning 65 | { 66 | [super didReceiveMemoryWarning]; 67 | // Dispose of any resources that can be recreated. 68 | } 69 | 70 | - (void)dealloc { 71 | self.friendlyLoadingView = nil; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/XHFriendlyLoadingView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.JackTeam.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/XHFriendlyLoadingView-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 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XHFriendlyLoadingView 4 | // 5 | // Created by 曾 宪华 on 13-12-31. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingViewTests/XHFriendlyLoadingViewTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.JackTeam.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingViewTests/XHFriendlyLoadingViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHFriendlyLoadingViewTests.m 3 | // XHFriendlyLoadingViewTests 4 | // 5 | // Created by 曾 宪华 on 13-12-31. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHFriendlyLoadingViewTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation XHFriendlyLoadingViewTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Project/XHFriendlyLoadingViewTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | XHFriendlyLoadingView 2 | ===================== 3 | 4 | 模仿网易新闻的主页TableView加载的过度提示LoadingView,比较友好的界面提示,有兴趣可以看看 5 | 6 | 7 | ## 如下图 8 | ![image](https://github.com/JackTeam/XHFriendlyLoadingView/raw/master/Screenshots/XHFriendlyLoadingView.gif) 9 | 10 | 11 | 12 | ## License 13 | 14 | 中文: XHFriendlyLoadingView 是在MIT协议下使用的,可以在LICENSE文件里面找到相关的使用协议信息. 15 | 16 | English: XHFriendlyLoadingView is acailable under the MIT license, see the LICENSE file for more information. 17 | 18 | 19 | 20 | ======================= 21 | ## 须知 22 | 中文:如果您在您的项目中使用开源组件,请给我们发[电子邮件](mailto:xhzengAIB@gmail.com?subject=From%20GitHub%20XHFriendlyLoadingView)告诉我们您的应用程序的名称。 23 | 24 | ## Instructions 25 | 26 | English:If you use open source components in your project, please [Email us](mailto:xhzengAIB@gmail.com?subject=From%20GitHub%20XHFriendlyLoadingView) to tell us the name of your application. 27 | -------------------------------------------------------------------------------- /Screenshots/XHFriendlyLoadingView.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Screenshots/XHFriendlyLoadingView.gif -------------------------------------------------------------------------------- /Source/Resources/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Source/Resources/refresh.png -------------------------------------------------------------------------------- /Source/Resources/refresh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHFriendlyLoadingView/4fc5387580c109b95d786ed3508858fe61c3ffe8/Source/Resources/refresh@2x.png -------------------------------------------------------------------------------- /Source/XHFriendlyLoadingView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHFriendlyLoadingView.h 3 | // XHFriendlyLoadingView 4 | // 5 | // Created by 曾 宪华 on 13-12-31. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^ReloadButtonClickedCompleted)(UIButton *sender); 12 | 13 | @interface XHFriendlyLoadingView : UIView 14 | @property (nonatomic, copy) ReloadButtonClickedCompleted reloadButtonClickedCompleted; 15 | 16 | + (instancetype)shareFriendlyLoadingView; 17 | 18 | - (void)showFriendlyLoadingViewWithText:(NSString *)text loadingAnimated:(BOOL)animated; 19 | 20 | /** 21 | * 隐藏页面加载动画及信息提示 22 | */ 23 | - (void)hideLoadingView; 24 | 25 | /** 26 | * 重新加载提示 27 | * @param reloadString 要显示的提示字符串 28 | */ 29 | - (void)showReloadViewWithText:(NSString *)reloadString; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Source/XHFriendlyLoadingView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHFriendlyLoadingView.m 3 | // XHFriendlyLoadingView 4 | // 5 | // Created by 曾 宪华 on 13-12-31. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHFriendlyLoadingView.h" 10 | 11 | @interface XHFriendlyLoadingView () { 12 | 13 | } 14 | 15 | @property (nonatomic, strong) UIActivityIndicatorView *activityIndicatorView; 16 | @property (nonatomic, strong) UILabel *loadingLabel; 17 | 18 | @property (nonatomic, strong) UIButton *reloadButton; 19 | 20 | @end 21 | 22 | @implementation XHFriendlyLoadingView 23 | 24 | - (void)reloadButtonClicked:(UIButton *)sender { 25 | __weak typeof(self) weakSelf = self; 26 | if (self.reloadButtonClickedCompleted) { 27 | self.reloadButtonClickedCompleted(weakSelf.reloadButton); 28 | } 29 | } 30 | 31 | - (void)_setup { 32 | self.backgroundColor = [UIColor colorWithRed:(244 / 255.f) green:(246 / 255.f) blue:(252 / 255.f) alpha:1.f]; 33 | 34 | _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 35 | _activityIndicatorView.alpha = 0.; 36 | 37 | _loadingLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.frame), 44)]; 38 | self.loadingLabel.alpha = 0.; 39 | self.loadingLabel.textColor = [UIColor grayColor]; 40 | 41 | _reloadButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; 42 | self.reloadButton.alpha = 0.; 43 | [self.reloadButton setBackgroundImage:[UIImage imageNamed:@"refresh"] forState:UIControlStateNormal]; 44 | [self.reloadButton addTarget:self action:@selector(reloadButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; 45 | 46 | 47 | [self addSubview:self.activityIndicatorView]; 48 | [self addSubview:self.loadingLabel]; 49 | [self addSubview:self.reloadButton]; 50 | } 51 | 52 | + (instancetype)shareFriendlyLoadingView { 53 | static XHFriendlyLoadingView *instance; 54 | static dispatch_once_t onceToken; 55 | dispatch_once(&onceToken, ^{ 56 | instance = [[XHFriendlyLoadingView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 57 | }); 58 | return instance; 59 | } 60 | 61 | - (id)initWithFrame:(CGRect)frame 62 | { 63 | self = [super initWithFrame:frame]; 64 | if (self) { 65 | // Initialization code 66 | [self _setup]; 67 | } 68 | return self; 69 | } 70 | 71 | - (void)dealloc { 72 | self.reloadButtonClickedCompleted = nil; 73 | 74 | [self _stopActivityIndicatorView]; 75 | self.activityIndicatorView = nil; 76 | self.loadingLabel = nil; 77 | self.reloadButton = nil; 78 | } 79 | 80 | - (CGRect)_setpLoadingLabelForWidth:(CGFloat)width { 81 | CGRect loadingLabelFrame = self.loadingLabel.frame; 82 | loadingLabelFrame.size.width = width; 83 | loadingLabelFrame.origin.x = 0; 84 | loadingLabelFrame.origin.y = CGRectGetHeight(self.bounds) / 2.0 - CGRectGetHeight(loadingLabelFrame) / 2.0; 85 | return loadingLabelFrame; 86 | } 87 | 88 | - (void)_stopActivityIndicatorView { 89 | if ([self.activityIndicatorView isAnimating]) { 90 | [self.activityIndicatorView stopAnimating]; 91 | } 92 | } 93 | 94 | - (void)_setupAllUIWithAlpha { 95 | self.loadingLabel.alpha = 0.; 96 | self.reloadButton.alpha = 0.; 97 | self.activityIndicatorView.alpha = 0.; 98 | } 99 | 100 | - (void)showFriendlyLoadingViewWithText:(NSString *)text loadingAnimated:(BOOL)animated { 101 | [self _setupAllUIWithAlpha]; 102 | if (animated) { 103 | [self showLoadingAnimationWithText:text]; 104 | } else { 105 | [self showPromptViewWithText:text]; 106 | } 107 | } 108 | 109 | /** 110 | * 纯文字提示 111 | * @param promptString 要显示的提示字符串 112 | */ 113 | - (void)showPromptViewWithText:(NSString *)promptString { 114 | [self _stopActivityIndicatorView]; 115 | 116 | // 只是显示一行文本 117 | self.loadingLabel.frame = [self _setpLoadingLabelForWidth:CGRectGetWidth(self.bounds)]; 118 | self.loadingLabel.textAlignment = NSTextAlignmentCenter; 119 | self.loadingLabel.text = promptString; 120 | 121 | [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 122 | self.activityIndicatorView.alpha = 0.; 123 | self.reloadButton.alpha = 0.; 124 | self.loadingLabel.alpha = 1.; 125 | } completion:^(BOOL finished) { 126 | 127 | }]; 128 | } 129 | 130 | /** 131 | * 页面加载动画及信息提示 132 | * @param loadingString 要显示的提示字符串 133 | */ 134 | - (void)showLoadingAnimationWithText:(NSString *)loadingString { 135 | CGPoint activityIndicatorViewCentet = CGPointMake(CGRectGetWidth(self.bounds) / 2.0 * 2 / 2.8, CGRectGetHeight(self.bounds) / 2.0); 136 | self.activityIndicatorView.center = activityIndicatorViewCentet; 137 | [self.activityIndicatorView startAnimating]; 138 | 139 | CGRect loadingLabelFrmae = [self _setpLoadingLabelForWidth:CGRectGetWidth(self.bounds) / 3]; 140 | self.loadingLabel.textAlignment = NSTextAlignmentLeft; 141 | loadingLabelFrmae.origin.x = CGRectGetWidth(self.activityIndicatorView.frame) + self.activityIndicatorView.frame.origin.x + 8; 142 | loadingLabelFrmae.origin.y = CGRectGetHeight(self.bounds) / 2.0 - CGRectGetHeight(loadingLabelFrmae) / 2.0; 143 | self.loadingLabel.frame = loadingLabelFrmae; 144 | self.loadingLabel.text = loadingString; 145 | 146 | [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 147 | self.reloadButton.alpha = 0.; 148 | self.loadingLabel.alpha = 1.; 149 | self.activityIndicatorView.alpha = 1.; 150 | } completion:^(BOOL finished) { 151 | 152 | }]; 153 | } 154 | 155 | /** 156 | * 隐藏页面加载动画及信息提示 157 | */ 158 | - (void)hideLoadingView { 159 | [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 160 | self.alpha = 0.; 161 | } completion:^(BOOL finished) { 162 | [self removeFromSuperview]; 163 | }]; 164 | } 165 | 166 | /** 167 | * 重新加载提示 168 | * @param reloadString 要显示的提示字符串 169 | */ 170 | - (void)showReloadViewWithText:(NSString *)reloadString { 171 | [self _setupAllUIWithAlpha]; 172 | [self _stopActivityIndicatorView]; 173 | 174 | CGRect loadingLabelFrame = [self _setpLoadingLabelForWidth:CGRectGetWidth(self.bounds)]; 175 | self.loadingLabel.textAlignment = NSTextAlignmentCenter; 176 | self.loadingLabel.frame = loadingLabelFrame; 177 | self.loadingLabel.text = reloadString; 178 | 179 | // 按钮和提示 180 | CGPoint reloadButtonCenter = CGPointMake(CGRectGetWidth(self.bounds) / 2.0, self.loadingLabel.center.y - (CGRectGetHeight(self.loadingLabel.frame) / 2.0 + CGRectGetHeight(self.reloadButton.frame) / 2.0)); 181 | self.reloadButton.center = reloadButtonCenter; 182 | 183 | [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 184 | self.activityIndicatorView.alpha = 0.; 185 | self.reloadButton.alpha = 1.; 186 | self.loadingLabel.alpha = 1.; 187 | } completion:^(BOOL finished) { 188 | 189 | }]; 190 | } 191 | 192 | /* 193 | // Only override drawRect: if you perform custom drawing. 194 | // An empty implementation adversely affects performance during animation. 195 | - (void)drawRect:(CGRect)rect 196 | { 197 | // Drawing code 198 | } 199 | */ 200 | 201 | @end 202 | --------------------------------------------------------------------------------