├── .gitignore ├── .travis.yml ├── Example ├── Podfile ├── SAILoadingView.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── SAILoadingView-Example.xcscheme ├── SAILoadingView.xcworkspace │ └── contents.xcworkspacedata ├── SAILoadingView │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── BasicTableViewController.swift │ ├── ErrorTableViewController.swift │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── RetryTableViewController.swift │ └── ViewController.swift └── Tests │ ├── Info.plist │ └── Tests.swift ├── LICENSE ├── Preview ├── error.png ├── loading.png ├── loadingView.gif ├── loadingView.mov └── retry.png ├── README.md ├── SAILoadingView.podspec └── SAILoadingView ├── Assets └── .gitkeep └── Classes ├── .gitkeep ├── SAILoadingView.swift └── SAILoadingView.xib /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -workspace Example/SAILoadingView.xcworkspace -scheme SAILoadingView-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'SAILoadingView_Example' do 4 | pod 'SAILoadingView', :path => '../' 5 | 6 | target 'SAILoadingView_Tests' do 7 | inherit! :search_paths 8 | 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Example/SAILoadingView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 097261E51D4BEC3900AB9CEB /* RetryTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 097261E41D4BEC3900AB9CEB /* RetryTableViewController.swift */; }; 11 | 097261E71D4BEEB300AB9CEB /* ErrorTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 097261E61D4BEEB300AB9CEB /* ErrorTableViewController.swift */; }; 12 | 097261E91D4BEED600AB9CEB /* BasicTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 097261E81D4BEED600AB9CEB /* BasicTableViewController.swift */; }; 13 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 14 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 15 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 16 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 17 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 18 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 19 | 610D5E346EA8BAB99293B358 /* Pods_SAILoadingView_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4432F3B7F48FB6337C68EDE0 /* Pods_SAILoadingView_Tests.framework */; }; 20 | 7E50D21706DB7D6FC4F4F828 /* Pods_SAILoadingView_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0D70CFF8BF6A643FD8F9D34 /* Pods_SAILoadingView_Example.framework */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 29 | remoteInfo = SAILoadingView; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 097261E41D4BEC3900AB9CEB /* RetryTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RetryTableViewController.swift; sourceTree = ""; }; 35 | 097261E61D4BEEB300AB9CEB /* ErrorTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ErrorTableViewController.swift; sourceTree = ""; }; 36 | 097261E81D4BEED600AB9CEB /* BasicTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicTableViewController.swift; sourceTree = ""; }; 37 | 17232E1808CC7B242895DF94 /* Pods-SAILoadingView_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SAILoadingView_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SAILoadingView_Example/Pods-SAILoadingView_Example.release.xcconfig"; sourceTree = ""; }; 38 | 1C77001862BAF77AB67B2CA3 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 39 | 4432F3B7F48FB6337C68EDE0 /* Pods_SAILoadingView_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SAILoadingView_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 607FACD01AFB9204008FA782 /* SAILoadingView_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SAILoadingView_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 43 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 44 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 46 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 47 | 607FACE51AFB9204008FA782 /* SAILoadingView_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SAILoadingView_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 50 | 67C892437FA1868294ABE021 /* Pods-SAILoadingView_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SAILoadingView_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SAILoadingView_Tests/Pods-SAILoadingView_Tests.debug.xcconfig"; sourceTree = ""; }; 51 | A0D70CFF8BF6A643FD8F9D34 /* Pods_SAILoadingView_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SAILoadingView_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | C52980BFA394BB00B55B3F14 /* Pods-SAILoadingView_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SAILoadingView_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SAILoadingView_Example/Pods-SAILoadingView_Example.debug.xcconfig"; sourceTree = ""; }; 53 | D5EAE59FB5FFC2C5017F221C /* Pods-SAILoadingView_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SAILoadingView_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SAILoadingView_Tests/Pods-SAILoadingView_Tests.release.xcconfig"; sourceTree = ""; }; 54 | E8AF55E11AEABF36EE2F0C3A /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 55 | EA5D9B805FF406BC670362D9 /* SAILoadingView.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SAILoadingView.podspec; path = ../SAILoadingView.podspec; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 7E50D21706DB7D6FC4F4F828 /* Pods_SAILoadingView_Example.framework in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | 610D5E346EA8BAB99293B358 /* Pods_SAILoadingView_Tests.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | 2B92220BDDB623C7028A0942 /* Frameworks */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | A0D70CFF8BF6A643FD8F9D34 /* Pods_SAILoadingView_Example.framework */, 82 | 4432F3B7F48FB6337C68EDE0 /* Pods_SAILoadingView_Tests.framework */, 83 | ); 84 | name = Frameworks; 85 | sourceTree = ""; 86 | }; 87 | 607FACC71AFB9204008FA782 = { 88 | isa = PBXGroup; 89 | children = ( 90 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 91 | 607FACD21AFB9204008FA782 /* Example for SAILoadingView */, 92 | 607FACE81AFB9204008FA782 /* Tests */, 93 | 607FACD11AFB9204008FA782 /* Products */, 94 | CAE06BF76335995A2CF9CBFF /* Pods */, 95 | 2B92220BDDB623C7028A0942 /* Frameworks */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | 607FACD11AFB9204008FA782 /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 607FACD01AFB9204008FA782 /* SAILoadingView_Example.app */, 103 | 607FACE51AFB9204008FA782 /* SAILoadingView_Tests.xctest */, 104 | ); 105 | name = Products; 106 | sourceTree = ""; 107 | }; 108 | 607FACD21AFB9204008FA782 /* Example for SAILoadingView */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 112 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 113 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 114 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 115 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 116 | 607FACD31AFB9204008FA782 /* Supporting Files */, 117 | 097261E41D4BEC3900AB9CEB /* RetryTableViewController.swift */, 118 | 097261E81D4BEED600AB9CEB /* BasicTableViewController.swift */, 119 | 097261E61D4BEEB300AB9CEB /* ErrorTableViewController.swift */, 120 | ); 121 | name = "Example for SAILoadingView"; 122 | path = SAILoadingView; 123 | sourceTree = ""; 124 | }; 125 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 607FACD41AFB9204008FA782 /* Info.plist */, 129 | ); 130 | name = "Supporting Files"; 131 | sourceTree = ""; 132 | }; 133 | 607FACE81AFB9204008FA782 /* Tests */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 137 | 607FACE91AFB9204008FA782 /* Supporting Files */, 138 | ); 139 | path = Tests; 140 | sourceTree = ""; 141 | }; 142 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 607FACEA1AFB9204008FA782 /* Info.plist */, 146 | ); 147 | name = "Supporting Files"; 148 | sourceTree = ""; 149 | }; 150 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | EA5D9B805FF406BC670362D9 /* SAILoadingView.podspec */, 154 | E8AF55E11AEABF36EE2F0C3A /* README.md */, 155 | 1C77001862BAF77AB67B2CA3 /* LICENSE */, 156 | ); 157 | name = "Podspec Metadata"; 158 | sourceTree = ""; 159 | }; 160 | CAE06BF76335995A2CF9CBFF /* Pods */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | C52980BFA394BB00B55B3F14 /* Pods-SAILoadingView_Example.debug.xcconfig */, 164 | 17232E1808CC7B242895DF94 /* Pods-SAILoadingView_Example.release.xcconfig */, 165 | 67C892437FA1868294ABE021 /* Pods-SAILoadingView_Tests.debug.xcconfig */, 166 | D5EAE59FB5FFC2C5017F221C /* Pods-SAILoadingView_Tests.release.xcconfig */, 167 | ); 168 | name = Pods; 169 | sourceTree = ""; 170 | }; 171 | /* End PBXGroup section */ 172 | 173 | /* Begin PBXNativeTarget section */ 174 | 607FACCF1AFB9204008FA782 /* SAILoadingView_Example */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SAILoadingView_Example" */; 177 | buildPhases = ( 178 | DD2648A26CE92CBCECAF63D5 /* [CP] Check Pods Manifest.lock */, 179 | 607FACCC1AFB9204008FA782 /* Sources */, 180 | 607FACCD1AFB9204008FA782 /* Frameworks */, 181 | 607FACCE1AFB9204008FA782 /* Resources */, 182 | 7A25F329E558731DD4104445 /* [CP] Embed Pods Frameworks */, 183 | F2D4D90D807A7487C35B3E2B /* [CP] Copy Pods Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | ); 189 | name = SAILoadingView_Example; 190 | productName = SAILoadingView; 191 | productReference = 607FACD01AFB9204008FA782 /* SAILoadingView_Example.app */; 192 | productType = "com.apple.product-type.application"; 193 | }; 194 | 607FACE41AFB9204008FA782 /* SAILoadingView_Tests */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SAILoadingView_Tests" */; 197 | buildPhases = ( 198 | C1BB04766405D03A2F5BAD85 /* [CP] Check Pods Manifest.lock */, 199 | 607FACE11AFB9204008FA782 /* Sources */, 200 | 607FACE21AFB9204008FA782 /* Frameworks */, 201 | 607FACE31AFB9204008FA782 /* Resources */, 202 | FD857AB5C278CEBC50CC6C7D /* [CP] Embed Pods Frameworks */, 203 | C73E738101CC5DD93791846F /* [CP] Copy Pods Resources */, 204 | ); 205 | buildRules = ( 206 | ); 207 | dependencies = ( 208 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 209 | ); 210 | name = SAILoadingView_Tests; 211 | productName = Tests; 212 | productReference = 607FACE51AFB9204008FA782 /* SAILoadingView_Tests.xctest */; 213 | productType = "com.apple.product-type.bundle.unit-test"; 214 | }; 215 | /* End PBXNativeTarget section */ 216 | 217 | /* Begin PBXProject section */ 218 | 607FACC81AFB9204008FA782 /* Project object */ = { 219 | isa = PBXProject; 220 | attributes = { 221 | LastSwiftUpdateCheck = 0720; 222 | LastUpgradeCheck = 0720; 223 | ORGANIZATIONNAME = CocoaPods; 224 | TargetAttributes = { 225 | 607FACCF1AFB9204008FA782 = { 226 | CreatedOnToolsVersion = 6.3.1; 227 | }; 228 | 607FACE41AFB9204008FA782 = { 229 | CreatedOnToolsVersion = 6.3.1; 230 | TestTargetID = 607FACCF1AFB9204008FA782; 231 | }; 232 | }; 233 | }; 234 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SAILoadingView" */; 235 | compatibilityVersion = "Xcode 3.2"; 236 | developmentRegion = English; 237 | hasScannedForEncodings = 0; 238 | knownRegions = ( 239 | en, 240 | Base, 241 | ); 242 | mainGroup = 607FACC71AFB9204008FA782; 243 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 244 | projectDirPath = ""; 245 | projectRoot = ""; 246 | targets = ( 247 | 607FACCF1AFB9204008FA782 /* SAILoadingView_Example */, 248 | 607FACE41AFB9204008FA782 /* SAILoadingView_Tests */, 249 | ); 250 | }; 251 | /* End PBXProject section */ 252 | 253 | /* Begin PBXResourcesBuildPhase section */ 254 | 607FACCE1AFB9204008FA782 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 259 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 260 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | 607FACE31AFB9204008FA782 /* Resources */ = { 265 | isa = PBXResourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | /* End PBXResourcesBuildPhase section */ 272 | 273 | /* Begin PBXShellScriptBuildPhase section */ 274 | 7A25F329E558731DD4104445 /* [CP] Embed Pods Frameworks */ = { 275 | isa = PBXShellScriptBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | ); 279 | inputPaths = ( 280 | ); 281 | name = "[CP] Embed Pods Frameworks"; 282 | outputPaths = ( 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | shellPath = /bin/sh; 286 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SAILoadingView_Example/Pods-SAILoadingView_Example-frameworks.sh\"\n"; 287 | showEnvVarsInLog = 0; 288 | }; 289 | C1BB04766405D03A2F5BAD85 /* [CP] Check Pods Manifest.lock */ = { 290 | isa = PBXShellScriptBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | ); 294 | inputPaths = ( 295 | ); 296 | name = "[CP] Check Pods Manifest.lock"; 297 | outputPaths = ( 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | shellPath = /bin/sh; 301 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 302 | showEnvVarsInLog = 0; 303 | }; 304 | C73E738101CC5DD93791846F /* [CP] Copy Pods Resources */ = { 305 | isa = PBXShellScriptBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | ); 309 | inputPaths = ( 310 | ); 311 | name = "[CP] Copy Pods Resources"; 312 | outputPaths = ( 313 | ); 314 | runOnlyForDeploymentPostprocessing = 0; 315 | shellPath = /bin/sh; 316 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SAILoadingView_Tests/Pods-SAILoadingView_Tests-resources.sh\"\n"; 317 | showEnvVarsInLog = 0; 318 | }; 319 | DD2648A26CE92CBCECAF63D5 /* [CP] Check Pods Manifest.lock */ = { 320 | isa = PBXShellScriptBuildPhase; 321 | buildActionMask = 2147483647; 322 | files = ( 323 | ); 324 | inputPaths = ( 325 | ); 326 | name = "[CP] Check Pods Manifest.lock"; 327 | outputPaths = ( 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | shellPath = /bin/sh; 331 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 332 | showEnvVarsInLog = 0; 333 | }; 334 | F2D4D90D807A7487C35B3E2B /* [CP] Copy Pods Resources */ = { 335 | isa = PBXShellScriptBuildPhase; 336 | buildActionMask = 2147483647; 337 | files = ( 338 | ); 339 | inputPaths = ( 340 | ); 341 | name = "[CP] Copy Pods Resources"; 342 | outputPaths = ( 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | shellPath = /bin/sh; 346 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SAILoadingView_Example/Pods-SAILoadingView_Example-resources.sh\"\n"; 347 | showEnvVarsInLog = 0; 348 | }; 349 | FD857AB5C278CEBC50CC6C7D /* [CP] Embed Pods Frameworks */ = { 350 | isa = PBXShellScriptBuildPhase; 351 | buildActionMask = 2147483647; 352 | files = ( 353 | ); 354 | inputPaths = ( 355 | ); 356 | name = "[CP] Embed Pods Frameworks"; 357 | outputPaths = ( 358 | ); 359 | runOnlyForDeploymentPostprocessing = 0; 360 | shellPath = /bin/sh; 361 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SAILoadingView_Tests/Pods-SAILoadingView_Tests-frameworks.sh\"\n"; 362 | showEnvVarsInLog = 0; 363 | }; 364 | /* End PBXShellScriptBuildPhase section */ 365 | 366 | /* Begin PBXSourcesBuildPhase section */ 367 | 607FACCC1AFB9204008FA782 /* Sources */ = { 368 | isa = PBXSourcesBuildPhase; 369 | buildActionMask = 2147483647; 370 | files = ( 371 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 372 | 097261E51D4BEC3900AB9CEB /* RetryTableViewController.swift in Sources */, 373 | 097261E71D4BEEB300AB9CEB /* ErrorTableViewController.swift in Sources */, 374 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 375 | 097261E91D4BEED600AB9CEB /* BasicTableViewController.swift in Sources */, 376 | ); 377 | runOnlyForDeploymentPostprocessing = 0; 378 | }; 379 | 607FACE11AFB9204008FA782 /* Sources */ = { 380 | isa = PBXSourcesBuildPhase; 381 | buildActionMask = 2147483647; 382 | files = ( 383 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | }; 387 | /* End PBXSourcesBuildPhase section */ 388 | 389 | /* Begin PBXTargetDependency section */ 390 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 391 | isa = PBXTargetDependency; 392 | target = 607FACCF1AFB9204008FA782 /* SAILoadingView_Example */; 393 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 394 | }; 395 | /* End PBXTargetDependency section */ 396 | 397 | /* Begin PBXVariantGroup section */ 398 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 399 | isa = PBXVariantGroup; 400 | children = ( 401 | 607FACDA1AFB9204008FA782 /* Base */, 402 | ); 403 | name = Main.storyboard; 404 | sourceTree = ""; 405 | }; 406 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 407 | isa = PBXVariantGroup; 408 | children = ( 409 | 607FACDF1AFB9204008FA782 /* Base */, 410 | ); 411 | name = LaunchScreen.xib; 412 | sourceTree = ""; 413 | }; 414 | /* End PBXVariantGroup section */ 415 | 416 | /* Begin XCBuildConfiguration section */ 417 | 607FACED1AFB9204008FA782 /* Debug */ = { 418 | isa = XCBuildConfiguration; 419 | buildSettings = { 420 | ALWAYS_SEARCH_USER_PATHS = NO; 421 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 422 | CLANG_CXX_LIBRARY = "libc++"; 423 | CLANG_ENABLE_MODULES = YES; 424 | CLANG_ENABLE_OBJC_ARC = YES; 425 | CLANG_WARN_BOOL_CONVERSION = YES; 426 | CLANG_WARN_CONSTANT_CONVERSION = YES; 427 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 428 | CLANG_WARN_EMPTY_BODY = YES; 429 | CLANG_WARN_ENUM_CONVERSION = YES; 430 | CLANG_WARN_INT_CONVERSION = YES; 431 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 432 | CLANG_WARN_UNREACHABLE_CODE = YES; 433 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 434 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 435 | COPY_PHASE_STRIP = NO; 436 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 437 | ENABLE_STRICT_OBJC_MSGSEND = YES; 438 | ENABLE_TESTABILITY = YES; 439 | GCC_C_LANGUAGE_STANDARD = gnu99; 440 | GCC_DYNAMIC_NO_PIC = NO; 441 | GCC_NO_COMMON_BLOCKS = YES; 442 | GCC_OPTIMIZATION_LEVEL = 0; 443 | GCC_PREPROCESSOR_DEFINITIONS = ( 444 | "DEBUG=1", 445 | "$(inherited)", 446 | ); 447 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 448 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 449 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 450 | GCC_WARN_UNDECLARED_SELECTOR = YES; 451 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 452 | GCC_WARN_UNUSED_FUNCTION = YES; 453 | GCC_WARN_UNUSED_VARIABLE = YES; 454 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 455 | MTL_ENABLE_DEBUG_INFO = YES; 456 | ONLY_ACTIVE_ARCH = YES; 457 | SDKROOT = iphoneos; 458 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 459 | }; 460 | name = Debug; 461 | }; 462 | 607FACEE1AFB9204008FA782 /* Release */ = { 463 | isa = XCBuildConfiguration; 464 | buildSettings = { 465 | ALWAYS_SEARCH_USER_PATHS = NO; 466 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 467 | CLANG_CXX_LIBRARY = "libc++"; 468 | CLANG_ENABLE_MODULES = YES; 469 | CLANG_ENABLE_OBJC_ARC = YES; 470 | CLANG_WARN_BOOL_CONVERSION = YES; 471 | CLANG_WARN_CONSTANT_CONVERSION = YES; 472 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 473 | CLANG_WARN_EMPTY_BODY = YES; 474 | CLANG_WARN_ENUM_CONVERSION = YES; 475 | CLANG_WARN_INT_CONVERSION = YES; 476 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 477 | CLANG_WARN_UNREACHABLE_CODE = YES; 478 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 479 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 480 | COPY_PHASE_STRIP = NO; 481 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 482 | ENABLE_NS_ASSERTIONS = NO; 483 | ENABLE_STRICT_OBJC_MSGSEND = YES; 484 | GCC_C_LANGUAGE_STANDARD = gnu99; 485 | GCC_NO_COMMON_BLOCKS = YES; 486 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 487 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 488 | GCC_WARN_UNDECLARED_SELECTOR = YES; 489 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 490 | GCC_WARN_UNUSED_FUNCTION = YES; 491 | GCC_WARN_UNUSED_VARIABLE = YES; 492 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 493 | MTL_ENABLE_DEBUG_INFO = NO; 494 | SDKROOT = iphoneos; 495 | VALIDATE_PRODUCT = YES; 496 | }; 497 | name = Release; 498 | }; 499 | 607FACF01AFB9204008FA782 /* Debug */ = { 500 | isa = XCBuildConfiguration; 501 | baseConfigurationReference = C52980BFA394BB00B55B3F14 /* Pods-SAILoadingView_Example.debug.xcconfig */; 502 | buildSettings = { 503 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 504 | INFOPLIST_FILE = SAILoadingView/Info.plist; 505 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 506 | MODULE_NAME = ExampleApp; 507 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 508 | PRODUCT_NAME = "$(TARGET_NAME)"; 509 | }; 510 | name = Debug; 511 | }; 512 | 607FACF11AFB9204008FA782 /* Release */ = { 513 | isa = XCBuildConfiguration; 514 | baseConfigurationReference = 17232E1808CC7B242895DF94 /* Pods-SAILoadingView_Example.release.xcconfig */; 515 | buildSettings = { 516 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 517 | INFOPLIST_FILE = SAILoadingView/Info.plist; 518 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 519 | MODULE_NAME = ExampleApp; 520 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 521 | PRODUCT_NAME = "$(TARGET_NAME)"; 522 | }; 523 | name = Release; 524 | }; 525 | 607FACF31AFB9204008FA782 /* Debug */ = { 526 | isa = XCBuildConfiguration; 527 | baseConfigurationReference = 67C892437FA1868294ABE021 /* Pods-SAILoadingView_Tests.debug.xcconfig */; 528 | buildSettings = { 529 | FRAMEWORK_SEARCH_PATHS = ( 530 | "$(SDKROOT)/Developer/Library/Frameworks", 531 | "$(inherited)", 532 | ); 533 | GCC_PREPROCESSOR_DEFINITIONS = ( 534 | "DEBUG=1", 535 | "$(inherited)", 536 | ); 537 | INFOPLIST_FILE = Tests/Info.plist; 538 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 539 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 540 | PRODUCT_NAME = "$(TARGET_NAME)"; 541 | }; 542 | name = Debug; 543 | }; 544 | 607FACF41AFB9204008FA782 /* Release */ = { 545 | isa = XCBuildConfiguration; 546 | baseConfigurationReference = D5EAE59FB5FFC2C5017F221C /* Pods-SAILoadingView_Tests.release.xcconfig */; 547 | buildSettings = { 548 | FRAMEWORK_SEARCH_PATHS = ( 549 | "$(SDKROOT)/Developer/Library/Frameworks", 550 | "$(inherited)", 551 | ); 552 | INFOPLIST_FILE = Tests/Info.plist; 553 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 554 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 555 | PRODUCT_NAME = "$(TARGET_NAME)"; 556 | }; 557 | name = Release; 558 | }; 559 | /* End XCBuildConfiguration section */ 560 | 561 | /* Begin XCConfigurationList section */ 562 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SAILoadingView" */ = { 563 | isa = XCConfigurationList; 564 | buildConfigurations = ( 565 | 607FACED1AFB9204008FA782 /* Debug */, 566 | 607FACEE1AFB9204008FA782 /* Release */, 567 | ); 568 | defaultConfigurationIsVisible = 0; 569 | defaultConfigurationName = Release; 570 | }; 571 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SAILoadingView_Example" */ = { 572 | isa = XCConfigurationList; 573 | buildConfigurations = ( 574 | 607FACF01AFB9204008FA782 /* Debug */, 575 | 607FACF11AFB9204008FA782 /* Release */, 576 | ); 577 | defaultConfigurationIsVisible = 0; 578 | defaultConfigurationName = Release; 579 | }; 580 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SAILoadingView_Tests" */ = { 581 | isa = XCConfigurationList; 582 | buildConfigurations = ( 583 | 607FACF31AFB9204008FA782 /* Debug */, 584 | 607FACF41AFB9204008FA782 /* Release */, 585 | ); 586 | defaultConfigurationIsVisible = 0; 587 | defaultConfigurationName = Release; 588 | }; 589 | /* End XCConfigurationList section */ 590 | }; 591 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 592 | } 593 | -------------------------------------------------------------------------------- /Example/SAILoadingView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/SAILoadingView.xcodeproj/xcshareddata/xcschemes/SAILoadingView-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Example/SAILoadingView.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/SAILoadingView/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SAILoadingView 4 | // 5 | // Created by Septiyan Andika on 07/30/2016. 6 | // Copyright (c) 2016 Septiyan Andika. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 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 | func applicationDidBecomeActive(application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/SAILoadingView/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/SAILoadingView/Base.lproj/Main.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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 47 | 58 | 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 | -------------------------------------------------------------------------------- /Example/SAILoadingView/BasicTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RetryTableViewController.swift 3 | // SAILoadingView 4 | // 5 | // Created by Septiyan Andika on 7/30/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SAILoadingView 11 | class BasicTableViewController: UITableViewController { 12 | var data_array:[String] = [] 13 | var loadingView:SAILoadingView? 14 | 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | 19 | let reload = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Refresh, target: self, action: #selector(self.loadData)) 20 | self.navigationItem.rightBarButtonItem = reload 21 | loadingView = SAILoadingView(parent: self.view) 22 | self.loadData() 23 | } 24 | 25 | func loadData(){ 26 | self.data_array = [] 27 | loadingView?.showLoading("Please Wait") 28 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(3 * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { 29 | self.data_array = ["iPhone 4s", "iPhone 5", "iPhone 5s", "iPhone 6", "iPhone 6 Plus", "iPhone 6s", "iPhone 6s Plus", "iPhone 7", "iPhone 7 Plus"] 30 | self.tableView.reloadData() 31 | self.loadingView?.dismissLoading() 32 | } 33 | } 34 | 35 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 36 | return data_array.count 37 | } 38 | 39 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 40 | let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) 41 | cell.textLabel?.text = data_array[indexPath.row] 42 | return cell 43 | } 44 | } 45 | 46 | 47 | -------------------------------------------------------------------------------- /Example/SAILoadingView/ErrorTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RetryTableViewController.swift 3 | // SAILoadingView 4 | // 5 | // Created by Septiyan Andika on 7/30/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SAILoadingView 11 | class ErrorTableViewController: UITableViewController { 12 | var data_array:[String] = [] 13 | var loadingView:SAILoadingView? 14 | 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | 19 | let reload = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Refresh, target: self, action: #selector(self.loadData)) 20 | self.navigationItem.rightBarButtonItem = reload 21 | loadingView = SAILoadingView(parent: self.view) 22 | self.loadData() 23 | } 24 | 25 | func loadData(){ 26 | self.data_array = [] 27 | loadingView?.showLoading("Please Wait") 28 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(3 * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { 29 | self.tableView.reloadData() 30 | self.loadingView?.showError("Error Getting Data..") 31 | } 32 | } 33 | 34 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 35 | return data_array.count 36 | } 37 | 38 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 39 | let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) 40 | cell.textLabel?.text = data_array[indexPath.row] 41 | return cell 42 | } 43 | } 44 | 45 | 46 | -------------------------------------------------------------------------------- /Example/SAILoadingView/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/SAILoadingView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/SAILoadingView/RetryTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RetryTableViewController.swift 3 | // SAILoadingView 4 | // 5 | // Created by Septiyan Andika on 7/30/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SAILoadingView 11 | class RetryTableViewController: UITableViewController { 12 | var data_array:[String] = [] 13 | var loadingView:SAILoadingView? 14 | var retry:Bool = true 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | 19 | let reload = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Refresh, target: self, action: #selector(self.loadData)) 20 | self.navigationItem.rightBarButtonItem = reload 21 | loadingView = SAILoadingView(parent: self.view) 22 | loadingView?.onClickRetry = { 23 | 24 | self.loadData() 25 | } 26 | self.loadData() 27 | 28 | } 29 | 30 | func loadData(){ 31 | self.data_array = [] 32 | loadingView?.showLoading("Please Wait") 33 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(3 * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { 34 | if self.retry == true { 35 | self.loadingView?.showError("Error getting data, Please try again") 36 | self.retry = false 37 | }else{ 38 | self.data_array = ["iPhone 4s", "iPhone 5", "iPhone 5s", "iPhone 6", "iPhone 6 Plus", "iPhone 6s", "iPhone 6s Plus", "iPhone 7", "iPhone 7 Plus"] 39 | self.tableView.reloadData() 40 | self.loadingView?.dismissLoading() 41 | self.retry = true 42 | } 43 | } 44 | } 45 | 46 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 47 | return data_array.count 48 | } 49 | 50 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 51 | let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) 52 | cell.textLabel?.text = data_array[indexPath.row] 53 | return cell 54 | } 55 | } 56 | 57 | 58 | -------------------------------------------------------------------------------- /Example/SAILoadingView/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SAILoadingView 4 | // 5 | // Created by Septiyan Andika on 07/30/2016. 6 | // Copyright (c) 2016 Septiyan Andika. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import XCTest 3 | import SAILoadingView 4 | 5 | class Tests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testExample() { 18 | // This is an example of a functional test case. 19 | XCTAssert(true, "Pass") 20 | } 21 | 22 | func testPerformanceExample() { 23 | // This is an example of a performance test case. 24 | self.measureBlock() { 25 | // Put the code you want to measure the time of here. 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Septiyan Andika 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Preview/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/c8eca666bbfad54b8a040092f3f02d39e58c21ac/Preview/error.png -------------------------------------------------------------------------------- /Preview/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/c8eca666bbfad54b8a040092f3f02d39e58c21ac/Preview/loading.png -------------------------------------------------------------------------------- /Preview/loadingView.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/c8eca666bbfad54b8a040092f3f02d39e58c21ac/Preview/loadingView.gif -------------------------------------------------------------------------------- /Preview/loadingView.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/c8eca666bbfad54b8a040092f3f02d39e58c21ac/Preview/loadingView.mov -------------------------------------------------------------------------------- /Preview/retry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/c8eca666bbfad54b8a040092f3f02d39e58c21ac/Preview/retry.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SAILoadingView 2 | 3 | [![CI Status](http://img.shields.io/travis/Septiyan Andika/SAILoadingView.svg?style=flat)](https://travis-ci.org/Septiyan Andika/SAILoadingView) 4 | [![Version](https://img.shields.io/cocoapods/v/SAILoadingView.svg?style=flat)](http://cocoapods.org/pods/SAILoadingView) 5 | [![License](https://img.shields.io/cocoapods/l/SAILoadingView.svg?style=flat)](http://cocoapods.org/pods/SAILoadingView) 6 | [![Platform](https://img.shields.io/cocoapods/p/SAILoadingView.svg?style=flat)](http://cocoapods.org/pods/SAILoadingView) 7 | 8 | ## Preview 9 | 10 | ![Loading View Preview](https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/master/Preview/loadingView.gif) 11 | ![Loading View](https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/master/Preview/loading.png) 12 | ![Error message](https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/master/Preview/error.png) 13 | ![Error message With Retry Button](https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/master/Preview/retry.png) 14 | 15 | ## Example 16 | 17 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 18 | 19 | 20 | ## Installation 21 | 1. Just add SAILoadingView.swift and SAILoadingView.xib file to your project, file are present inside SAILoadingView/Classes directory. 22 | 23 | 2. SAILoadingView is available through [CocoaPods](http://cocoapods.org). To install 24 | it, simply add the following line to your Podfile: 25 | 26 | ```ruby 27 | pod "SAILoadingView" 28 | ``` 29 | 30 | ## Function 31 | 32 | func showLoading(text:String) 33 | 34 | Function to show loading view and text progress 35 | 36 | func dismissLoading() 37 | 38 | Function to dismiss loading view 39 | 40 | 41 | func showError(text:String) 42 | 43 | Function to show error message, if Properties onClickRetry not nil or declarede will show button retry, if onClickRetry not declared or nil button retry will be hidden 44 | 45 | ## Properties 46 | ```swift 47 | public final var onClickRetry: (Void -> Void)? 48 | 49 | example : 50 | var loadingView = SAILoadingView(parent: self.view) 51 | 52 | 53 | loadingView?.onClickRetry = { 54 | 55 | self.loadData() 56 | } 57 | ``` 58 | * show retry button, and handle action when retry button clicked 59 | 60 | ## Author 61 | 62 | Septiyan Andika, septiyan.andika@gmail.com 63 | 64 | ## License 65 | 66 | SAILoadingView is available under the MIT license. See the LICENSE file for more info. 67 | -------------------------------------------------------------------------------- /SAILoadingView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint SAILoadingView.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'SAILoadingView' 11 | s.version = '0.1.0' 12 | s.summary = 'A short description of SAILoadingView.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | TODO: Add long description of the pod here. 22 | DESC 23 | 24 | s.homepage = 'https://github.com//SAILoadingView' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'Septiyan Andika' => 'septiyan.andika@gmail.com' } 28 | s.source = { :git => 'https://github.com//SAILoadingView.git', :tag => s.version.to_s } 29 | # s.social_media_url = 'https://twitter.com/' 30 | 31 | s.ios.deployment_target = '8.0' 32 | 33 | s.source_files = 'SAILoadingView/Classes/**/*' 34 | 35 | # s.resource_bundles = { 36 | # 'SAILoadingView' => ['SAILoadingView/Assets/*.png'] 37 | # } 38 | 39 | # s.public_header_files = 'Pod/Classes/**/*.h' 40 | # s.frameworks = 'UIKit', 'MapKit' 41 | # s.dependency 'AFNetworking', '~> 2.3' 42 | end 43 | -------------------------------------------------------------------------------- /SAILoadingView/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/c8eca666bbfad54b8a040092f3f02d39e58c21ac/SAILoadingView/Assets/.gitkeep -------------------------------------------------------------------------------- /SAILoadingView/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeptiyanAndika/SAILoadingView/c8eca666bbfad54b8a040092f3f02d39e58c21ac/SAILoadingView/Classes/.gitkeep -------------------------------------------------------------------------------- /SAILoadingView/Classes/SAILoadingView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoadingView.swift 3 | // Andika.me 4 | // 5 | // Created by Septiyan Andika on 7/14/16. 6 | // 7 | 8 | import UIKit 9 | 10 | public class SAILoadingView: UIView { 11 | 12 | @IBOutlet var loadingContainer: UIView! 13 | @IBOutlet var retryContainer: UIView! 14 | @IBOutlet var lblLoading: UILabel! 15 | @IBOutlet var lblError: UILabel! 16 | @IBOutlet var activityIndicator: UIActivityIndicatorView! 17 | 18 | @IBOutlet var butRetry: UIButton! 19 | 20 | private let centerView: UIView = UIView() 21 | private var parent: UIView? 22 | private let label = UILabel() 23 | 24 | public final var onClickRetry: (Void -> Void)? 25 | 26 | private override init(frame: CGRect) { 27 | super.init(frame: frame) 28 | xibSetup () 29 | 30 | } 31 | 32 | required public init?(coder aDecoder: NSCoder) { 33 | super.init(coder: aDecoder) 34 | 35 | } 36 | 37 | public convenience init(parent:UIView){ 38 | self.init(frame: parent.frame) 39 | xibSetup () 40 | label.font = UIFont.systemFontOfSize(28) 41 | self.parent = parent 42 | xibSetup () 43 | } 44 | 45 | public convenience init(parent:UIView,frame:CGRect){ 46 | self.init(frame: frame) 47 | xibSetup () 48 | label.font = UIFont.systemFontOfSize(28) 49 | self.parent = parent 50 | 51 | } 52 | 53 | 54 | public convenience init(parent:UIView, fontName:String){ 55 | self.init(frame: parent.frame) 56 | xibSetup () 57 | label.font = UIFont(name: fontName, size: 14) 58 | 59 | } 60 | 61 | private func setupView(){ 62 | if !self.isDescendantOfView(self.parent!) { 63 | self.parent!.addSubview(self) 64 | if onClickRetry == nil{ 65 | butRetry.hidden = true 66 | } 67 | } 68 | } 69 | 70 | public func showLoading(text:String){ 71 | setupView() 72 | retryContainer.hidden = true; 73 | loadingContainer.hidden = false; 74 | lblLoading.text = text 75 | 76 | } 77 | 78 | public func dismissLoading(){ 79 | self.removeFromSuperview() 80 | } 81 | 82 | public func showError(text:String){ 83 | setupView() 84 | retryContainer.hidden = false; 85 | loadingContainer.hidden = true; 86 | lblError.text = text 87 | } 88 | 89 | 90 | 91 | 92 | @IBAction func actionRetry(sender: AnyObject) { 93 | if onClickRetry?() != nil{ 94 | retryContainer.hidden = true; 95 | loadingContainer.hidden = false; 96 | } 97 | } 98 | 99 | var view: UIView! 100 | 101 | func xibSetup() { 102 | view = loadViewFromNib() 103 | 104 | view.frame = bounds 105 | 106 | view.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight] 107 | addSubview(view) 108 | } 109 | 110 | func loadViewFromNib() -> UIView { 111 | 112 | let bundle = NSBundle(forClass: self.dynamicType) 113 | let nib = UINib(nibName: "SAILoadingView", bundle: bundle) 114 | let view = nib.instantiateWithOwner(self, options: nil)[0] as! UIView 115 | 116 | return view 117 | } 118 | 119 | 120 | } 121 | -------------------------------------------------------------------------------- /SAILoadingView/Classes/SAILoadingView.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 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | --------------------------------------------------------------------------------