├── .gitignore ├── .travis.yml ├── Example ├── Podfile ├── Podfile.lock ├── SSSwiftUILoader.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── SSSwiftUILoader-Example.xcscheme ├── SSSwiftUILoader.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── SSSwiftUILoader │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── img1.imageset │ │ │ ├── Contents.json │ │ │ └── ley638mmfk194u71n_thumbnail.png │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── ContentView.swift │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── SceneDelegate.swift │ └── ViewController.swift └── Tests │ ├── Info.plist │ └── Tests.swift ├── LICENSE ├── README.md ├── SSSwiftUILoader.png ├── SSSwiftUILoader.podspec ├── SSSwiftUILoader ├── Assets │ └── .gitkeep └── Classes │ └── .gitkeep ├── SSSwiftUiLoader.gif ├── Source └── LoaderView.swift └── _Pods.xcodeproj /.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 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | # Pods/ 38 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 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 -enableCodeCoverage YES -workspace Example/SSSwiftUILoader.xcworkspace -scheme SSSwiftUILoader-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '13.0' 2 | 3 | use_frameworks! 4 | 5 | target 'SSSwiftUILoader_Example' do 6 | pod 'SSSwiftUILoader', :path => '../' 7 | target 'SSSwiftUILoader_Tests' do 8 | inherit! :search_paths 9 | 10 | 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SSSwiftUILoader (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - SSSwiftUILoader (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | SSSwiftUILoader: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | SSSwiftUILoader: 94fac2e456372d353b2e3f867d80d4bdda09500c 13 | 14 | PODFILE CHECKSUM: 93a0a6c3cf1d224b7d88192bc03ba18c3ddcc131 15 | 16 | COCOAPODS: 1.8.4 17 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 31096661CC7B864BDF159256 /* Pods_SSSwiftUILoader_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AEB7A81518E68F5426E704DE /* Pods_SSSwiftUILoader_Tests.framework */; }; 11 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 12 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 13 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 14 | 844BD62123D74C9900453C7A /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 844BD61923D74C9900453C7A /* Preview Assets.xcassets */; }; 15 | 844BD62223D74C9900453C7A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 844BD61A23D74C9900453C7A /* Assets.xcassets */; }; 16 | 844BD62323D74C9900453C7A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 844BD61C23D74C9900453C7A /* LaunchScreen.storyboard */; }; 17 | 844BD62423D74C9900453C7A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844BD61E23D74C9900453C7A /* SceneDelegate.swift */; }; 18 | 844BD62523D74C9900453C7A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844BD61F23D74C9900453C7A /* ContentView.swift */; }; 19 | BCE653CB24B6824670C7D08E /* Pods_SSSwiftUILoader_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB916A5CA9C83707D22C503 /* Pods_SSSwiftUILoader_Example.framework */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 28 | remoteInfo = SSSwiftUILoader; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 06D674CA372108B14CB481EE /* Pods-SSSwiftUILoader_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SSSwiftUILoader_Tests.release.xcconfig"; path = "Target Support Files/Pods-SSSwiftUILoader_Tests/Pods-SSSwiftUILoader_Tests.release.xcconfig"; sourceTree = ""; }; 34 | 0AEF945106F65DF610AFC85D /* Pods-SSSwiftUILoader_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SSSwiftUILoader_Tests.debug.xcconfig"; path = "Target Support Files/Pods-SSSwiftUILoader_Tests/Pods-SSSwiftUILoader_Tests.debug.xcconfig"; sourceTree = ""; }; 35 | 1C4F94A3D82637755553DEF5 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 36 | 31A312C6D7D0B01CD58E2C73 /* Pods-SSSwiftUILoader_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SSSwiftUILoader_Example.debug.xcconfig"; path = "Target Support Files/Pods-SSSwiftUILoader_Example/Pods-SSSwiftUILoader_Example.debug.xcconfig"; sourceTree = ""; }; 37 | 5B585DC73FD05A2490E9EF7A /* SSSwiftUILoader.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SSSwiftUILoader.podspec; path = ../SSSwiftUILoader.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 38 | 607FACD01AFB9204008FA782 /* SSSwiftUILoader_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SSSwiftUILoader_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 42 | 607FACE51AFB9204008FA782 /* SSSwiftUILoader_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SSSwiftUILoader_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 45 | 62149745D7EF45E8FD916C35 /* Pods-SSSwiftUILoader_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SSSwiftUILoader_Example.release.xcconfig"; path = "Target Support Files/Pods-SSSwiftUILoader_Example/Pods-SSSwiftUILoader_Example.release.xcconfig"; sourceTree = ""; }; 46 | 844BD61923D74C9900453C7A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 47 | 844BD61A23D74C9900453C7A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 48 | 844BD61D23D74C9900453C7A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = LaunchScreen.storyboard; sourceTree = ""; }; 49 | 844BD61E23D74C9900453C7A /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 50 | 844BD61F23D74C9900453C7A /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 51 | 9856889B907D7FABD6832EAC /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 52 | AEB7A81518E68F5426E704DE /* Pods_SSSwiftUILoader_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SSSwiftUILoader_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | CBB916A5CA9C83707D22C503 /* Pods_SSSwiftUILoader_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SSSwiftUILoader_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | BCE653CB24B6824670C7D08E /* Pods_SSSwiftUILoader_Example.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | 31096661CC7B864BDF159256 /* Pods_SSSwiftUILoader_Tests.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 607FACC71AFB9204008FA782 = { 77 | isa = PBXGroup; 78 | children = ( 79 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 80 | 607FACD21AFB9204008FA782 /* Example for SSSwiftUILoader */, 81 | 607FACE81AFB9204008FA782 /* Tests */, 82 | 607FACD11AFB9204008FA782 /* Products */, 83 | FFAFA0C9A2952BD229F7116D /* Pods */, 84 | BCA70F79395586DF6827CEC2 /* Frameworks */, 85 | ); 86 | sourceTree = ""; 87 | }; 88 | 607FACD11AFB9204008FA782 /* Products */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 607FACD01AFB9204008FA782 /* SSSwiftUILoader_Example.app */, 92 | 607FACE51AFB9204008FA782 /* SSSwiftUILoader_Tests.xctest */, 93 | ); 94 | name = Products; 95 | sourceTree = ""; 96 | }; 97 | 607FACD21AFB9204008FA782 /* Example for SSSwiftUILoader */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 844BD61A23D74C9900453C7A /* Assets.xcassets */, 101 | 844BD61B23D74C9900453C7A /* Base.lproj */, 102 | 844BD61F23D74C9900453C7A /* ContentView.swift */, 103 | 844BD61823D74C9900453C7A /* Preview Content */, 104 | 844BD61E23D74C9900453C7A /* SceneDelegate.swift */, 105 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 106 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 107 | 607FACD31AFB9204008FA782 /* Supporting Files */, 108 | ); 109 | name = "Example for SSSwiftUILoader"; 110 | path = SSSwiftUILoader; 111 | sourceTree = ""; 112 | }; 113 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 607FACD41AFB9204008FA782 /* Info.plist */, 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | 607FACE81AFB9204008FA782 /* Tests */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 125 | 607FACE91AFB9204008FA782 /* Supporting Files */, 126 | ); 127 | path = Tests; 128 | sourceTree = ""; 129 | }; 130 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 607FACEA1AFB9204008FA782 /* Info.plist */, 134 | ); 135 | name = "Supporting Files"; 136 | sourceTree = ""; 137 | }; 138 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 5B585DC73FD05A2490E9EF7A /* SSSwiftUILoader.podspec */, 142 | 1C4F94A3D82637755553DEF5 /* README.md */, 143 | 9856889B907D7FABD6832EAC /* LICENSE */, 144 | ); 145 | name = "Podspec Metadata"; 146 | sourceTree = ""; 147 | }; 148 | 844BD61823D74C9900453C7A /* Preview Content */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 844BD61923D74C9900453C7A /* Preview Assets.xcassets */, 152 | ); 153 | path = "Preview Content"; 154 | sourceTree = ""; 155 | }; 156 | 844BD61B23D74C9900453C7A /* Base.lproj */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 844BD61C23D74C9900453C7A /* LaunchScreen.storyboard */, 160 | ); 161 | path = Base.lproj; 162 | sourceTree = ""; 163 | }; 164 | BCA70F79395586DF6827CEC2 /* Frameworks */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | CBB916A5CA9C83707D22C503 /* Pods_SSSwiftUILoader_Example.framework */, 168 | AEB7A81518E68F5426E704DE /* Pods_SSSwiftUILoader_Tests.framework */, 169 | ); 170 | name = Frameworks; 171 | sourceTree = ""; 172 | }; 173 | FFAFA0C9A2952BD229F7116D /* Pods */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 31A312C6D7D0B01CD58E2C73 /* Pods-SSSwiftUILoader_Example.debug.xcconfig */, 177 | 62149745D7EF45E8FD916C35 /* Pods-SSSwiftUILoader_Example.release.xcconfig */, 178 | 0AEF945106F65DF610AFC85D /* Pods-SSSwiftUILoader_Tests.debug.xcconfig */, 179 | 06D674CA372108B14CB481EE /* Pods-SSSwiftUILoader_Tests.release.xcconfig */, 180 | ); 181 | path = Pods; 182 | sourceTree = ""; 183 | }; 184 | /* End PBXGroup section */ 185 | 186 | /* Begin PBXNativeTarget section */ 187 | 607FACCF1AFB9204008FA782 /* SSSwiftUILoader_Example */ = { 188 | isa = PBXNativeTarget; 189 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SSSwiftUILoader_Example" */; 190 | buildPhases = ( 191 | 3E1FD04458275FE50056A338 /* [CP] Check Pods Manifest.lock */, 192 | 607FACCC1AFB9204008FA782 /* Sources */, 193 | 607FACCD1AFB9204008FA782 /* Frameworks */, 194 | 607FACCE1AFB9204008FA782 /* Resources */, 195 | 9040996712741C57B422183B /* [CP] Embed Pods Frameworks */, 196 | ); 197 | buildRules = ( 198 | ); 199 | dependencies = ( 200 | ); 201 | name = SSSwiftUILoader_Example; 202 | productName = SSSwiftUILoader; 203 | productReference = 607FACD01AFB9204008FA782 /* SSSwiftUILoader_Example.app */; 204 | productType = "com.apple.product-type.application"; 205 | }; 206 | 607FACE41AFB9204008FA782 /* SSSwiftUILoader_Tests */ = { 207 | isa = PBXNativeTarget; 208 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SSSwiftUILoader_Tests" */; 209 | buildPhases = ( 210 | 00FCCF1388EFA4DE83C96BE7 /* [CP] Check Pods Manifest.lock */, 211 | 607FACE11AFB9204008FA782 /* Sources */, 212 | 607FACE21AFB9204008FA782 /* Frameworks */, 213 | 607FACE31AFB9204008FA782 /* Resources */, 214 | ); 215 | buildRules = ( 216 | ); 217 | dependencies = ( 218 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 219 | ); 220 | name = SSSwiftUILoader_Tests; 221 | productName = Tests; 222 | productReference = 607FACE51AFB9204008FA782 /* SSSwiftUILoader_Tests.xctest */; 223 | productType = "com.apple.product-type.bundle.unit-test"; 224 | }; 225 | /* End PBXNativeTarget section */ 226 | 227 | /* Begin PBXProject section */ 228 | 607FACC81AFB9204008FA782 /* Project object */ = { 229 | isa = PBXProject; 230 | attributes = { 231 | LastSwiftUpdateCheck = 0830; 232 | LastUpgradeCheck = 0830; 233 | ORGANIZATIONNAME = CocoaPods; 234 | TargetAttributes = { 235 | 607FACCF1AFB9204008FA782 = { 236 | CreatedOnToolsVersion = 6.3.1; 237 | LastSwiftMigration = 1130; 238 | }; 239 | 607FACE41AFB9204008FA782 = { 240 | CreatedOnToolsVersion = 6.3.1; 241 | LastSwiftMigration = 1130; 242 | TestTargetID = 607FACCF1AFB9204008FA782; 243 | }; 244 | }; 245 | }; 246 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SSSwiftUILoader" */; 247 | compatibilityVersion = "Xcode 3.2"; 248 | developmentRegion = English; 249 | hasScannedForEncodings = 0; 250 | knownRegions = ( 251 | English, 252 | en, 253 | Base, 254 | ); 255 | mainGroup = 607FACC71AFB9204008FA782; 256 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 257 | projectDirPath = ""; 258 | projectRoot = ""; 259 | targets = ( 260 | 607FACCF1AFB9204008FA782 /* SSSwiftUILoader_Example */, 261 | 607FACE41AFB9204008FA782 /* SSSwiftUILoader_Tests */, 262 | ); 263 | }; 264 | /* End PBXProject section */ 265 | 266 | /* Begin PBXResourcesBuildPhase section */ 267 | 607FACCE1AFB9204008FA782 /* Resources */ = { 268 | isa = PBXResourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | 844BD62123D74C9900453C7A /* Preview Assets.xcassets in Resources */, 272 | 844BD62323D74C9900453C7A /* LaunchScreen.storyboard in Resources */, 273 | 844BD62223D74C9900453C7A /* Assets.xcassets in Resources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | 607FACE31AFB9204008FA782 /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | /* End PBXResourcesBuildPhase section */ 285 | 286 | /* Begin PBXShellScriptBuildPhase section */ 287 | 00FCCF1388EFA4DE83C96BE7 /* [CP] Check Pods Manifest.lock */ = { 288 | isa = PBXShellScriptBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | ); 292 | inputFileListPaths = ( 293 | ); 294 | inputPaths = ( 295 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 296 | "${PODS_ROOT}/Manifest.lock", 297 | ); 298 | name = "[CP] Check Pods Manifest.lock"; 299 | outputFileListPaths = ( 300 | ); 301 | outputPaths = ( 302 | "$(DERIVED_FILE_DIR)/Pods-SSSwiftUILoader_Tests-checkManifestLockResult.txt", 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | shellPath = /bin/sh; 306 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 307 | showEnvVarsInLog = 0; 308 | }; 309 | 3E1FD04458275FE50056A338 /* [CP] Check Pods Manifest.lock */ = { 310 | isa = PBXShellScriptBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | ); 314 | inputFileListPaths = ( 315 | ); 316 | inputPaths = ( 317 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 318 | "${PODS_ROOT}/Manifest.lock", 319 | ); 320 | name = "[CP] Check Pods Manifest.lock"; 321 | outputFileListPaths = ( 322 | ); 323 | outputPaths = ( 324 | "$(DERIVED_FILE_DIR)/Pods-SSSwiftUILoader_Example-checkManifestLockResult.txt", 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | shellPath = /bin/sh; 328 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 329 | showEnvVarsInLog = 0; 330 | }; 331 | 9040996712741C57B422183B /* [CP] Embed Pods Frameworks */ = { 332 | isa = PBXShellScriptBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | ); 336 | inputPaths = ( 337 | "${PODS_ROOT}/Target Support Files/Pods-SSSwiftUILoader_Example/Pods-SSSwiftUILoader_Example-frameworks.sh", 338 | "${BUILT_PRODUCTS_DIR}/SSSwiftUILoader/SSSwiftUILoader.framework", 339 | ); 340 | name = "[CP] Embed Pods Frameworks"; 341 | outputPaths = ( 342 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSSwiftUILoader.framework", 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | shellPath = /bin/sh; 346 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SSSwiftUILoader_Example/Pods-SSSwiftUILoader_Example-frameworks.sh\"\n"; 347 | showEnvVarsInLog = 0; 348 | }; 349 | /* End PBXShellScriptBuildPhase section */ 350 | 351 | /* Begin PBXSourcesBuildPhase section */ 352 | 607FACCC1AFB9204008FA782 /* Sources */ = { 353 | isa = PBXSourcesBuildPhase; 354 | buildActionMask = 2147483647; 355 | files = ( 356 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 357 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 358 | 844BD62523D74C9900453C7A /* ContentView.swift in Sources */, 359 | 844BD62423D74C9900453C7A /* SceneDelegate.swift in Sources */, 360 | ); 361 | runOnlyForDeploymentPostprocessing = 0; 362 | }; 363 | 607FACE11AFB9204008FA782 /* Sources */ = { 364 | isa = PBXSourcesBuildPhase; 365 | buildActionMask = 2147483647; 366 | files = ( 367 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 368 | ); 369 | runOnlyForDeploymentPostprocessing = 0; 370 | }; 371 | /* End PBXSourcesBuildPhase section */ 372 | 373 | /* Begin PBXTargetDependency section */ 374 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 375 | isa = PBXTargetDependency; 376 | target = 607FACCF1AFB9204008FA782 /* SSSwiftUILoader_Example */; 377 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 378 | }; 379 | /* End PBXTargetDependency section */ 380 | 381 | /* Begin PBXVariantGroup section */ 382 | 844BD61C23D74C9900453C7A /* LaunchScreen.storyboard */ = { 383 | isa = PBXVariantGroup; 384 | children = ( 385 | 844BD61D23D74C9900453C7A /* Base */, 386 | ); 387 | name = LaunchScreen.storyboard; 388 | sourceTree = ""; 389 | }; 390 | /* End PBXVariantGroup section */ 391 | 392 | /* Begin XCBuildConfiguration section */ 393 | 607FACED1AFB9204008FA782 /* Debug */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | ALWAYS_SEARCH_USER_PATHS = NO; 397 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 398 | CLANG_CXX_LIBRARY = "libc++"; 399 | CLANG_ENABLE_MODULES = YES; 400 | CLANG_ENABLE_OBJC_ARC = YES; 401 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 402 | CLANG_WARN_BOOL_CONVERSION = YES; 403 | CLANG_WARN_COMMA = YES; 404 | CLANG_WARN_CONSTANT_CONVERSION = YES; 405 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 406 | CLANG_WARN_EMPTY_BODY = YES; 407 | CLANG_WARN_ENUM_CONVERSION = YES; 408 | CLANG_WARN_INFINITE_RECURSION = YES; 409 | CLANG_WARN_INT_CONVERSION = YES; 410 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 412 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 413 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 414 | CLANG_WARN_STRICT_PROTOTYPES = YES; 415 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 416 | CLANG_WARN_UNREACHABLE_CODE = YES; 417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 418 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 419 | COPY_PHASE_STRIP = NO; 420 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | ENABLE_TESTABILITY = YES; 423 | GCC_C_LANGUAGE_STANDARD = gnu99; 424 | GCC_DYNAMIC_NO_PIC = NO; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | GCC_OPTIMIZATION_LEVEL = 0; 427 | GCC_PREPROCESSOR_DEFINITIONS = ( 428 | "DEBUG=1", 429 | "$(inherited)", 430 | ); 431 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 432 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 433 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 434 | GCC_WARN_UNDECLARED_SELECTOR = YES; 435 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 436 | GCC_WARN_UNUSED_FUNCTION = YES; 437 | GCC_WARN_UNUSED_VARIABLE = YES; 438 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 439 | MTL_ENABLE_DEBUG_INFO = YES; 440 | ONLY_ACTIVE_ARCH = YES; 441 | SDKROOT = iphoneos; 442 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 443 | SWIFT_VERSION = 5.0; 444 | }; 445 | name = Debug; 446 | }; 447 | 607FACEE1AFB9204008FA782 /* Release */ = { 448 | isa = XCBuildConfiguration; 449 | buildSettings = { 450 | ALWAYS_SEARCH_USER_PATHS = NO; 451 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 452 | CLANG_CXX_LIBRARY = "libc++"; 453 | CLANG_ENABLE_MODULES = YES; 454 | CLANG_ENABLE_OBJC_ARC = YES; 455 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 456 | CLANG_WARN_BOOL_CONVERSION = YES; 457 | CLANG_WARN_COMMA = YES; 458 | CLANG_WARN_CONSTANT_CONVERSION = YES; 459 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 460 | CLANG_WARN_EMPTY_BODY = YES; 461 | CLANG_WARN_ENUM_CONVERSION = YES; 462 | CLANG_WARN_INFINITE_RECURSION = YES; 463 | CLANG_WARN_INT_CONVERSION = YES; 464 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 465 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 466 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 467 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 468 | CLANG_WARN_STRICT_PROTOTYPES = YES; 469 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 470 | CLANG_WARN_UNREACHABLE_CODE = YES; 471 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 472 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 473 | COPY_PHASE_STRIP = NO; 474 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 475 | ENABLE_NS_ASSERTIONS = NO; 476 | ENABLE_STRICT_OBJC_MSGSEND = YES; 477 | GCC_C_LANGUAGE_STANDARD = gnu99; 478 | GCC_NO_COMMON_BLOCKS = YES; 479 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 480 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 481 | GCC_WARN_UNDECLARED_SELECTOR = YES; 482 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 483 | GCC_WARN_UNUSED_FUNCTION = YES; 484 | GCC_WARN_UNUSED_VARIABLE = YES; 485 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 486 | MTL_ENABLE_DEBUG_INFO = NO; 487 | SDKROOT = iphoneos; 488 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 489 | SWIFT_VERSION = 5.0; 490 | VALIDATE_PRODUCT = YES; 491 | }; 492 | name = Release; 493 | }; 494 | 607FACF01AFB9204008FA782 /* Debug */ = { 495 | isa = XCBuildConfiguration; 496 | baseConfigurationReference = 31A312C6D7D0B01CD58E2C73 /* Pods-SSSwiftUILoader_Example.debug.xcconfig */; 497 | buildSettings = { 498 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 499 | INFOPLIST_FILE = SSSwiftUILoader/Info.plist; 500 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 502 | MODULE_NAME = ExampleApp; 503 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 504 | PRODUCT_NAME = "$(TARGET_NAME)"; 505 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 506 | SWIFT_VERSION = 5.0; 507 | }; 508 | name = Debug; 509 | }; 510 | 607FACF11AFB9204008FA782 /* Release */ = { 511 | isa = XCBuildConfiguration; 512 | baseConfigurationReference = 62149745D7EF45E8FD916C35 /* Pods-SSSwiftUILoader_Example.release.xcconfig */; 513 | buildSettings = { 514 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 515 | INFOPLIST_FILE = SSSwiftUILoader/Info.plist; 516 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 517 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 518 | MODULE_NAME = ExampleApp; 519 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 520 | PRODUCT_NAME = "$(TARGET_NAME)"; 521 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 522 | SWIFT_VERSION = 5.0; 523 | }; 524 | name = Release; 525 | }; 526 | 607FACF31AFB9204008FA782 /* Debug */ = { 527 | isa = XCBuildConfiguration; 528 | baseConfigurationReference = 0AEF945106F65DF610AFC85D /* Pods-SSSwiftUILoader_Tests.debug.xcconfig */; 529 | buildSettings = { 530 | FRAMEWORK_SEARCH_PATHS = ( 531 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 532 | "$(inherited)", 533 | ); 534 | GCC_PREPROCESSOR_DEFINITIONS = ( 535 | "DEBUG=1", 536 | "$(inherited)", 537 | ); 538 | INFOPLIST_FILE = Tests/Info.plist; 539 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 540 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 541 | PRODUCT_NAME = "$(TARGET_NAME)"; 542 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 543 | SWIFT_VERSION = 5.0; 544 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SSSwiftUILoader_Example.app/SSSwiftUILoader_Example"; 545 | }; 546 | name = Debug; 547 | }; 548 | 607FACF41AFB9204008FA782 /* Release */ = { 549 | isa = XCBuildConfiguration; 550 | baseConfigurationReference = 06D674CA372108B14CB481EE /* Pods-SSSwiftUILoader_Tests.release.xcconfig */; 551 | buildSettings = { 552 | FRAMEWORK_SEARCH_PATHS = ( 553 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 554 | "$(inherited)", 555 | ); 556 | INFOPLIST_FILE = Tests/Info.plist; 557 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 558 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 559 | PRODUCT_NAME = "$(TARGET_NAME)"; 560 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 561 | SWIFT_VERSION = 5.0; 562 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SSSwiftUILoader_Example.app/SSSwiftUILoader_Example"; 563 | }; 564 | name = Release; 565 | }; 566 | /* End XCBuildConfiguration section */ 567 | 568 | /* Begin XCConfigurationList section */ 569 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SSSwiftUILoader" */ = { 570 | isa = XCConfigurationList; 571 | buildConfigurations = ( 572 | 607FACED1AFB9204008FA782 /* Debug */, 573 | 607FACEE1AFB9204008FA782 /* Release */, 574 | ); 575 | defaultConfigurationIsVisible = 0; 576 | defaultConfigurationName = Release; 577 | }; 578 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SSSwiftUILoader_Example" */ = { 579 | isa = XCConfigurationList; 580 | buildConfigurations = ( 581 | 607FACF01AFB9204008FA782 /* Debug */, 582 | 607FACF11AFB9204008FA782 /* Release */, 583 | ); 584 | defaultConfigurationIsVisible = 0; 585 | defaultConfigurationName = Release; 586 | }; 587 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SSSwiftUILoader_Tests" */ = { 588 | isa = XCConfigurationList; 589 | buildConfigurations = ( 590 | 607FACF31AFB9204008FA782 /* Debug */, 591 | 607FACF41AFB9204008FA782 /* Release */, 592 | ); 593 | defaultConfigurationIsVisible = 0; 594 | defaultConfigurationName = Release; 595 | }; 596 | /* End XCConfigurationList section */ 597 | }; 598 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 599 | } 600 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader.xcodeproj/xcshareddata/xcschemes/SSSwiftUILoader-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 80 | 82 | 88 | 89 | 90 | 91 | 92 | 93 | 99 | 101 | 107 | 108 | 109 | 110 | 112 | 113 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SSSwiftUILoader 4 | // 5 | // Created by Jasmine Chaniara on 21/01/20. 6 | // Copyright © 2020 Jasmine Chaniara. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | // MARK: UISceneSession Lifecycle 22 | 23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 24 | // Called when a new scene session is being created. 25 | // Use this method to select a configuration to create the new scene with. 26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 27 | } 28 | 29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 30 | // Called when the user discards a scene session. 31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 33 | } 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/Assets.xcassets/img1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ley638mmfk194u71n_thumbnail.png" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/Assets.xcassets/img1.imageset/ley638mmfk194u71n_thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/SSSwiftUILoader/a5bde9a0a9b7fe9a1a61c7254edca2563a1cd0fc/Example/SSSwiftUILoader/Assets.xcassets/img1.imageset/ley638mmfk194u71n_thumbnail.png -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SSSwiftUILoader 4 | // 5 | // Created by Jasmine Chaniara on 21/01/20. 6 | // Copyright © 2020 Jasmine Chaniara. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | import SSSwiftUILoader 11 | 12 | struct ContentView: View { 13 | @State var isLoaderShowing = true 14 | let disciplines = [1, 2, 3, 4, 5, 6, 7, 8, 9] 15 | var body: some View { 16 | HomeList(disciplines: self.disciplines) 17 | } 18 | } 19 | 20 | struct HomeList: View { 21 | let timer = Timer.publish(every: 10, on: .main, in: RunLoop.Mode.common).autoconnect() 22 | var disciplines: [Int] 23 | var body: some View { 24 | NavigationView { 25 | ZStack { 26 | List(self.disciplines, id: \.self) { item in 27 | NavigationLink(destination: DetailView(discipline: "\(item)")) { 28 | Image("img1") 29 | .resizable() 30 | .cornerRadius(10) 31 | .frame(width: 80, height: 80) 32 | VStack(alignment: .leading) { 33 | Text("\(item)") 34 | .font(.headline) 35 | Text("No of rooms") 36 | .font(.subheadline) 37 | } 38 | } 39 | } 40 | VStack { 41 | Spacer() 42 | Button(action: { 43 | /* loader text is optinal*/ 44 | SSLoader.shared.startloader("SSLoader...", config: .defaultSettings) 45 | /* 46 | For custom cunfiguration:- 47 | SSLoader.shared.startloader(config: .customSettings(config: CustomConfig())) 48 | */ 49 | }, label: { 50 | Text("Show Loader") 51 | .frame(width: UIScreen.main.bounds.width - 80, height: 40, alignment: .center) 52 | .foregroundColor(Color.white) 53 | .background(Color.black) 54 | .cornerRadius(20) 55 | }) 56 | Spacer().frame(width: UIScreen.main.bounds.width - 80, height: 20, alignment: .center) 57 | } 58 | } 59 | .navigationBarTitle("Rooms") 60 | } 61 | .onReceive(timer) { _ in 62 | SSLoader.shared.stopLoader() 63 | } 64 | } 65 | } 66 | 67 | /* Demo of custom configuration structure 68 | struct CustomConfig: LoaderConfiguration { 69 | var loaderTextColor: Color = .blue 70 | var loaderBackground: Color = .red 71 | var loaderCornerRadius: CGFloat = 10.0 72 | var loaderWindowColor = UIColor(red: 0.96, green: 0.96, blue: 0.96, alpha: 0.5) 73 | var activityIndicatorColor: UIColor = .blue 74 | var activityIndicatorStyle: UIActivityIndicatorView.Style = .large 75 | } 76 | */ 77 | 78 | struct DetailView: View { 79 | let discipline: String 80 | var body: some View { 81 | NavigationView { 82 | Text(discipline) 83 | } 84 | } 85 | } 86 | 87 | struct ContentView_Previews: PreviewProvider { 88 | static var previews: some View { 89 | ContentView() 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | 37 | 38 | 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UISupportedInterfaceOrientations~ipad 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationPortraitUpsideDown 56 | UIInterfaceOrientationLandscapeLeft 57 | UIInterfaceOrientationLandscapeRight 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // SSSwiftUILoader 4 | // 5 | // Created by Jasmine Chaniara on 21/01/20. 6 | // Copyright © 2020 Jasmine Chaniara. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 17 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 18 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 19 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 20 | 21 | // Create the SwiftUI view that provides the window contents. 22 | let contentView = ContentView() 23 | 24 | // Use a UIHostingController as window root view controller. 25 | if let windowScene = scene as? UIWindowScene { 26 | let window = UIWindow(windowScene: windowScene) 27 | window.rootViewController = UIHostingController(rootView: contentView) 28 | self.window = window 29 | window.makeKeyAndVisible() 30 | } 31 | } 32 | 33 | func sceneDidDisconnect(_ scene: UIScene) { 34 | // Called as the scene is being released by the system. 35 | // This occurs shortly after the scene enters the background, or when its session is discarded. 36 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 37 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 38 | } 39 | 40 | func sceneDidBecomeActive(_ scene: UIScene) { 41 | // Called when the scene has moved from an inactive state to an active state. 42 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 43 | } 44 | 45 | func sceneWillResignActive(_ scene: UIScene) { 46 | // Called when the scene will move from an active state to an inactive state. 47 | // This may occur due to temporary interruptions (ex. an incoming phone call). 48 | } 49 | 50 | func sceneWillEnterForeground(_ scene: UIScene) { 51 | // Called as the scene transitions from the background to the foreground. 52 | // Use this method to undo the changes made on entering the background. 53 | } 54 | 55 | func sceneDidEnterBackground(_ scene: UIScene) { 56 | // Called as the scene transitions from the foreground to the background. 57 | // Use this method to save data, release shared resources, and store enough scene-specific state information 58 | // to restore the scene back to its current state. 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /Example/SSSwiftUILoader/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SSSwiftUILoader 4 | // 5 | // Created by simformsolutions on 01/21/2020. 6 | // Copyright (c) 2020 simformsolutions. 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 | -------------------------------------------------------------------------------- /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 XCTest 2 | import SSSwiftUILoader 3 | 4 | class Tests: XCTestCase { 5 | 6 | override func setUp() { 7 | super.setUp() 8 | // Put setup code here. This method is called before the invocation of each test method in the class. 9 | } 10 | 11 | override func tearDown() { 12 | // Put teardown code here. This method is called after the invocation of each test method in the class. 13 | super.tearDown() 14 | } 15 | 16 | func testExample() { 17 | // This is an example of a functional test case. 18 | XCTAssert(true, "Pass") 19 | } 20 | 21 | func testPerformanceExample() { 22 | // This is an example of a performance test case. 23 | self.measure() { 24 | // Put the code you want to measure the time of here. 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 simformsolutions 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SSSwiftUILoader 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/SSSwiftUILoader.svg?style=flat)](https://cocoapods.org/pods/SSSwiftUILoader) 4 | [![License](https://img.shields.io/cocoapods/l/SSSwiftUILoader.svg?style=flat)](https://cocoapods.org/pods/SSSwiftUILoader) 5 | [![Platform](https://img.shields.io/cocoapods/p/SSSwiftUILoader.svg?style=flat)](https://cocoapods.org/pods/SSSwiftUILoader) 6 | 7 | ![Alt text](https://github.com/simformsolutions/SSSwiftUILoader/blob/master/SSSwiftUiLoader.gif) 8 | 9 | ## Example 10 | 11 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 12 | 13 | ## Requirements 14 | - iOS 13.0+ 15 | - Xcode 11+ 16 | 17 | ## Installation 18 | 19 | SSSwiftUILoader is available through [CocoaPods](https://cocoapods.org). To install 20 | it, simply add the following line to your Podfile: 21 | 22 | ```ruby 23 | pod 'SSSwiftUILoader' 24 | ``` 25 | # Usage example 26 | - 27 | Import framework 28 | 29 | import SSSwiftUILoader 30 | 31 | - 32 | **To start the loader** 33 | 34 | - It has default settings but you can also use custon setting if you want. 35 | 36 | SSLoader.shared.startloader("SSLoader...", config: .defaultSettings) 37 | 38 | - For custom configuration below is the demo, you just need to confirm the LoaderConfiguration protocol as shown below. 39 | 40 | 41 | 42 | struct CustomConfig: LoaderConfiguration { 43 | var loaderTextColor: Color = .blue 44 | var loaderBackgroundColor: Color = .red 45 | var loaderCornerRadius: CGFloat = 10.0 46 | var loaderWindowColor = UIColor(red: 0.96, green: 0.96, blue: 0.96, alpha: 0.5) 47 | var activityIndicatorColor: UIColor = .blue 48 | var activityIndicatorStyle: UIActivityIndicatorView.Style = .large 49 | } 50 | 51 | SSLoader.shared.startloader(config: .customSettings(config: CustomConfig())) 52 | - 53 | **To stop the loader** 54 | 55 | SSLoader.shared.stopLoader() 56 | 57 | ## Author 58 | 59 | simformsolutions.com 60 | 61 | ## License 62 | 63 | SSSwiftUILoader is available under the MIT license. See the LICENSE file for more info. 64 | 65 | -------------------------------------------------------------------------------- /SSSwiftUILoader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/SSSwiftUILoader/a5bde9a0a9b7fe9a1a61c7254edca2563a1cd0fc/SSSwiftUILoader.png -------------------------------------------------------------------------------- /SSSwiftUILoader.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint SSSwiftUILoader.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 https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'SSSwiftUILoader' 11 | s.version = '0.1.1' 12 | s.summary = 'SSSwiftUILoader is a full screen loader' 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/simformsolutions/SSSwiftUILoader' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'Jasmine chaniara' => 'developer@simformsolutions.com' } 28 | s.source = { :git => 'https://github.com/simformsolutions/SSSwiftUILoader.git', :tag => s.version.to_s } 29 | # s.social_media_url = 'https://twitter.com/' 30 | 31 | s.ios.deployment_target = '13.0' 32 | s.swift_version = '5.0' 33 | s.platforms = { 34 | "ios": "13.0" 35 | } 36 | s.source_files = 'Source/**/*.swift' 37 | 38 | # s.resource_bundles = { 39 | # 'SSSwiftUILoader' => ['SSSwiftUILoader/Assets/*.png'] 40 | # } 41 | 42 | # s.public_header_files = 'Pod/Classes/**/*.h' 43 | # s.frameworks = 'UIKit', 'MapKit' 44 | # s.dependency 'AFNetworking', '~> 2.3' 45 | end 46 | -------------------------------------------------------------------------------- /SSSwiftUILoader/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/SSSwiftUILoader/a5bde9a0a9b7fe9a1a61c7254edca2563a1cd0fc/SSSwiftUILoader/Assets/.gitkeep -------------------------------------------------------------------------------- /SSSwiftUILoader/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/SSSwiftUILoader/a5bde9a0a9b7fe9a1a61c7254edca2563a1cd0fc/SSSwiftUILoader/Classes/.gitkeep -------------------------------------------------------------------------------- /SSSwiftUiLoader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/SSSwiftUILoader/a5bde9a0a9b7fe9a1a61c7254edca2563a1cd0fc/SSSwiftUiLoader.gif -------------------------------------------------------------------------------- /Source/LoaderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoaderView.swift 3 | // SwiftUIFullScreenLoader 4 | // 5 | // Created by Jasmine Chaniara on 01/01/20. 6 | // Copyright © 2020 Jasmine Chaniara. All rights reserved. 7 | // 8 | import SwiftUI 9 | /// Description Here 10 | public protocol LoaderConfiguration { 11 | /// To set loader background color. 12 | var loaderBackgroundColor: Color { get set} 13 | /// To set loading text color. 14 | var loaderTextColor: Color { get set} 15 | /// It will set corner radius. 16 | var loaderCornerRadius: CGFloat { get set} 17 | /// It will set the background color of whole screen. 18 | var loaderWindowColor: UIColor { get set} 19 | /// Set activity indicator color. 20 | var activityIndicatorColor: UIColor { get set} 21 | /// set activityindicator style : .medium, .large etc. 22 | var activityIndicatorStyle: UIActivityIndicatorView.Style { get set} 23 | } 24 | 25 | /// Enum to set custom and default configuration. 26 | public enum ConfigSettings { 27 | case defaultSettings 28 | case customSettings(config: LoaderConfiguration) 29 | /// Return default and custom configuration which confirm LoaderConfiguration protocol 30 | func configuration() -> LoaderConfiguration { 31 | switch self { 32 | case .defaultSettings: 33 | return DefaultConfig() 34 | case .customSettings( let configSetting): 35 | return configSetting 36 | } 37 | } 38 | } 39 | 40 | /// LoadingView create the loader view 41 | private struct LoadingView: View { 42 | /// parameter to hide and show loader 43 | @Binding var isShowing: Bool 44 | let config: LoaderConfiguration 45 | let loaderText: String 46 | var body: some View { 47 | GeometryReader { geomerty in 48 | ZStack(alignment: .center) { 49 | VStack { 50 | Text(self.loaderText).foregroundColor(self.config.loaderTextColor).multilineTextAlignment(.center) 51 | ActivityIndicator(isAnimating: .constant(self.isShowing), style: self.config.activityIndicatorStyle, color: self.config.activityIndicatorColor) 52 | } 53 | .frame(width: geomerty.size.width / 2, height: geomerty.size.width / 2) 54 | .background(self.config.loaderBackgroundColor) 55 | .cornerRadius(self.config.loaderCornerRadius) 56 | .opacity(self.isShowing ? 1 : 0) 57 | } 58 | } 59 | } 60 | } 61 | 62 | /// Activity Indicator Of UIkit 63 | struct ActivityIndicator: UIViewRepresentable { 64 | /// property to start stop animation 65 | @Binding var isAnimating: Bool 66 | /// property set the style of activitty indicator 67 | let style: UIActivityIndicatorView.Style 68 | let color: UIColor 69 | 70 | func makeUIView(context: UIViewRepresentableContext) -> UIActivityIndicatorView { 71 | let activityIndicator = UIActivityIndicatorView(style: style) 72 | activityIndicator.color = color 73 | return activityIndicator 74 | } 75 | 76 | func updateUIView(_ uiView: UIActivityIndicatorView, context: UIViewRepresentableContext) { 77 | isAnimating ? uiView.startAnimating() : uiView.stopAnimating() 78 | } 79 | 80 | } 81 | 82 | public class SSLoader { 83 | /// shared object of SSLoader 84 | public static var shared = SSLoader() 85 | private init() { } 86 | /// popupWindow is a subclass of window to add loader on existing window 87 | private var popupWindow: LoaderWindow? 88 | /// - Parameters: 89 | /// - loaderText: Text to be shown in loader 90 | /// - config: configuration of loader define in protocol 91 | 92 | public func startloader(_ loaderText: String = "", config: ConfigSettings = .defaultSettings) { 93 | setLoader(loaderText: loaderText, and: config) 94 | } 95 | 96 | /// function to remove loader from screen. 97 | public func stopLoader() { 98 | removeLoader() 99 | } 100 | 101 | } 102 | 103 | // MARK: - LoaderWindow 104 | private class LoaderWindow: UIWindow { 105 | } 106 | 107 | /// Default loader settings 108 | struct DefaultConfig: LoaderConfiguration { 109 | var loaderTextColor: Color = .white 110 | var loaderBackgroundColor: Color = .secondary 111 | var loaderCornerRadius: CGFloat = 10.0 112 | var loaderWindowColor = UIColor(red: 0.96, green: 0.96, blue: 0.96, alpha: 0.5) 113 | var activityIndicatorColor: UIColor = .white 114 | var activityIndicatorStyle: UIActivityIndicatorView.Style = .large 115 | } 116 | 117 | private extension SSLoader { 118 | /// - Parameters: 119 | /// - loaderText: loaderText 120 | /// - config: loader UI configuration 121 | func setLoader(loaderText: String, and config: ConfigSettings) { 122 | let configuration = config.configuration() 123 | let windowScene = UIApplication.shared 124 | .connectedScenes 125 | .filter { $0.activationState == .foregroundActive } 126 | .first 127 | if let windowScene = windowScene as? UIWindowScene { 128 | popupWindow = LoaderWindow(windowScene: windowScene) 129 | popupWindow?.frame = UIScreen.main.bounds 130 | popupWindow?.backgroundColor = .clear 131 | popupWindow?.rootViewController = UIHostingController(rootView: LoadingView(isShowing: .constant(true), config: configuration, loaderText: loaderText)) 132 | popupWindow?.rootViewController?.view.backgroundColor = configuration.loaderWindowColor 133 | popupWindow?.makeKeyAndVisible() 134 | } 135 | } 136 | /// Remove loader from screen 137 | func removeLoader() { 138 | let alertwindows = UIApplication.shared.windows.filter { $0 is LoaderWindow } 139 | alertwindows.forEach { (window) in 140 | window.removeFromSuperview() 141 | } 142 | popupWindow = nil 143 | } 144 | 145 | } 146 | 147 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------