├── .gitignore ├── AuroraAnimation.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── AuroraAnimation ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── AuroraAnimation.entitlements ├── AuroraAnimationApp.swift ├── AuroraView.swift ├── ContentView.swift └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── LICENSE ├── README.md ├── preview.mov └── screenshot.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | 28 | ## App packaging 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | # Package.resolved 43 | # *.xcodeproj 44 | # 45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 46 | # hence it is not needed unless you have added a package configuration file to your project 47 | # .swiftpm 48 | 49 | .build/ 50 | 51 | # CocoaPods 52 | # 53 | # We recommend against adding the Pods directory to your .gitignore. However 54 | # you should judge for yourself, the pros and cons are mentioned at: 55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 56 | # 57 | # Pods/ 58 | # 59 | # Add this line if you want to avoid checking in source code from the Xcode workspace 60 | # *.xcworkspace 61 | 62 | # Carthage 63 | # 64 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 65 | # Carthage/Checkouts 66 | 67 | Carthage/Build/ 68 | 69 | # Accio dependency management 70 | Dependencies/ 71 | .accio/ 72 | 73 | # fastlane 74 | # 75 | # It is recommended to not store the screenshots in the git repo. 76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 77 | # For more information about the recommended setup visit: 78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 79 | 80 | fastlane/report.xml 81 | fastlane/Preview.html 82 | fastlane/screenshots/**/*.png 83 | fastlane/test_output 84 | 85 | # Code Injection 86 | # 87 | # After new code Injection tools there's a generated folder /iOSInjectionProject 88 | # https://github.com/johnno1962/injectionforxcode 89 | 90 | iOSInjectionProject/ 91 | .DS_Store 92 | -------------------------------------------------------------------------------- /AuroraAnimation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 423CCD5129CC27B600BC6210 /* AuroraAnimationApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 423CCD5029CC27B600BC6210 /* AuroraAnimationApp.swift */; }; 11 | 423CCD5329CC27B600BC6210 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 423CCD5229CC27B600BC6210 /* ContentView.swift */; }; 12 | 423CCD5529CC27B700BC6210 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 423CCD5429CC27B700BC6210 /* Assets.xcassets */; }; 13 | 423CCD5929CC27B700BC6210 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 423CCD5829CC27B700BC6210 /* Preview Assets.xcassets */; }; 14 | 423CCD6029CC281100BC6210 /* AuroraView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 423CCD5F29CC281100BC6210 /* AuroraView.swift */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 423CCD4D29CC27B600BC6210 /* AuroraAnimation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AuroraAnimation.app; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | 423CCD5029CC27B600BC6210 /* AuroraAnimationApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuroraAnimationApp.swift; sourceTree = ""; }; 20 | 423CCD5229CC27B600BC6210 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 21 | 423CCD5429CC27B700BC6210 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 22 | 423CCD5629CC27B700BC6210 /* AuroraAnimation.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AuroraAnimation.entitlements; sourceTree = ""; }; 23 | 423CCD5829CC27B700BC6210 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 24 | 423CCD5F29CC281100BC6210 /* AuroraView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuroraView.swift; sourceTree = ""; }; 25 | /* End PBXFileReference section */ 26 | 27 | /* Begin PBXFrameworksBuildPhase section */ 28 | 423CCD4A29CC27B600BC6210 /* Frameworks */ = { 29 | isa = PBXFrameworksBuildPhase; 30 | buildActionMask = 2147483647; 31 | files = ( 32 | ); 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXFrameworksBuildPhase section */ 36 | 37 | /* Begin PBXGroup section */ 38 | 423CCD4429CC27B600BC6210 = { 39 | isa = PBXGroup; 40 | children = ( 41 | 423CCD4F29CC27B600BC6210 /* AuroraAnimation */, 42 | 423CCD4E29CC27B600BC6210 /* Products */, 43 | ); 44 | sourceTree = ""; 45 | }; 46 | 423CCD4E29CC27B600BC6210 /* Products */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 423CCD4D29CC27B600BC6210 /* AuroraAnimation.app */, 50 | ); 51 | name = Products; 52 | sourceTree = ""; 53 | }; 54 | 423CCD4F29CC27B600BC6210 /* AuroraAnimation */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 423CCD5029CC27B600BC6210 /* AuroraAnimationApp.swift */, 58 | 423CCD5229CC27B600BC6210 /* ContentView.swift */, 59 | 423CCD5F29CC281100BC6210 /* AuroraView.swift */, 60 | 423CCD5429CC27B700BC6210 /* Assets.xcassets */, 61 | 423CCD5629CC27B700BC6210 /* AuroraAnimation.entitlements */, 62 | 423CCD5729CC27B700BC6210 /* Preview Content */, 63 | ); 64 | path = AuroraAnimation; 65 | sourceTree = ""; 66 | }; 67 | 423CCD5729CC27B700BC6210 /* Preview Content */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 423CCD5829CC27B700BC6210 /* Preview Assets.xcassets */, 71 | ); 72 | path = "Preview Content"; 73 | sourceTree = ""; 74 | }; 75 | /* End PBXGroup section */ 76 | 77 | /* Begin PBXNativeTarget section */ 78 | 423CCD4C29CC27B600BC6210 /* AuroraAnimation */ = { 79 | isa = PBXNativeTarget; 80 | buildConfigurationList = 423CCD5C29CC27B700BC6210 /* Build configuration list for PBXNativeTarget "AuroraAnimation" */; 81 | buildPhases = ( 82 | 423CCD4929CC27B600BC6210 /* Sources */, 83 | 423CCD4A29CC27B600BC6210 /* Frameworks */, 84 | 423CCD4B29CC27B600BC6210 /* Resources */, 85 | ); 86 | buildRules = ( 87 | ); 88 | dependencies = ( 89 | ); 90 | name = AuroraAnimation; 91 | productName = AuroraAnimation; 92 | productReference = 423CCD4D29CC27B600BC6210 /* AuroraAnimation.app */; 93 | productType = "com.apple.product-type.application"; 94 | }; 95 | /* End PBXNativeTarget section */ 96 | 97 | /* Begin PBXProject section */ 98 | 423CCD4529CC27B600BC6210 /* Project object */ = { 99 | isa = PBXProject; 100 | attributes = { 101 | BuildIndependentTargetsInParallel = 1; 102 | LastSwiftUpdateCheck = 1420; 103 | LastUpgradeCheck = 1420; 104 | TargetAttributes = { 105 | 423CCD4C29CC27B600BC6210 = { 106 | CreatedOnToolsVersion = 14.2; 107 | }; 108 | }; 109 | }; 110 | buildConfigurationList = 423CCD4829CC27B600BC6210 /* Build configuration list for PBXProject "AuroraAnimation" */; 111 | compatibilityVersion = "Xcode 14.0"; 112 | developmentRegion = en; 113 | hasScannedForEncodings = 0; 114 | knownRegions = ( 115 | en, 116 | Base, 117 | ); 118 | mainGroup = 423CCD4429CC27B600BC6210; 119 | productRefGroup = 423CCD4E29CC27B600BC6210 /* Products */; 120 | projectDirPath = ""; 121 | projectRoot = ""; 122 | targets = ( 123 | 423CCD4C29CC27B600BC6210 /* AuroraAnimation */, 124 | ); 125 | }; 126 | /* End PBXProject section */ 127 | 128 | /* Begin PBXResourcesBuildPhase section */ 129 | 423CCD4B29CC27B600BC6210 /* Resources */ = { 130 | isa = PBXResourcesBuildPhase; 131 | buildActionMask = 2147483647; 132 | files = ( 133 | 423CCD5929CC27B700BC6210 /* Preview Assets.xcassets in Resources */, 134 | 423CCD5529CC27B700BC6210 /* Assets.xcassets in Resources */, 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | /* End PBXResourcesBuildPhase section */ 139 | 140 | /* Begin PBXSourcesBuildPhase section */ 141 | 423CCD4929CC27B600BC6210 /* Sources */ = { 142 | isa = PBXSourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | 423CCD5329CC27B600BC6210 /* ContentView.swift in Sources */, 146 | 423CCD6029CC281100BC6210 /* AuroraView.swift in Sources */, 147 | 423CCD5129CC27B600BC6210 /* AuroraAnimationApp.swift in Sources */, 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | /* End PBXSourcesBuildPhase section */ 152 | 153 | /* Begin XCBuildConfiguration section */ 154 | 423CCD5A29CC27B700BC6210 /* Debug */ = { 155 | isa = XCBuildConfiguration; 156 | buildSettings = { 157 | ALWAYS_SEARCH_USER_PATHS = NO; 158 | CLANG_ANALYZER_NONNULL = YES; 159 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 160 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 161 | CLANG_ENABLE_MODULES = YES; 162 | CLANG_ENABLE_OBJC_ARC = YES; 163 | CLANG_ENABLE_OBJC_WEAK = YES; 164 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 165 | CLANG_WARN_BOOL_CONVERSION = YES; 166 | CLANG_WARN_COMMA = YES; 167 | CLANG_WARN_CONSTANT_CONVERSION = YES; 168 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 169 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 170 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 171 | CLANG_WARN_EMPTY_BODY = YES; 172 | CLANG_WARN_ENUM_CONVERSION = YES; 173 | CLANG_WARN_INFINITE_RECURSION = YES; 174 | CLANG_WARN_INT_CONVERSION = YES; 175 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 176 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 177 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 178 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 179 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 180 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 181 | CLANG_WARN_STRICT_PROTOTYPES = YES; 182 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 183 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 184 | CLANG_WARN_UNREACHABLE_CODE = YES; 185 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 186 | COPY_PHASE_STRIP = NO; 187 | DEBUG_INFORMATION_FORMAT = dwarf; 188 | ENABLE_STRICT_OBJC_MSGSEND = YES; 189 | ENABLE_TESTABILITY = YES; 190 | GCC_C_LANGUAGE_STANDARD = gnu11; 191 | GCC_DYNAMIC_NO_PIC = NO; 192 | GCC_NO_COMMON_BLOCKS = YES; 193 | GCC_OPTIMIZATION_LEVEL = 0; 194 | GCC_PREPROCESSOR_DEFINITIONS = ( 195 | "DEBUG=1", 196 | "$(inherited)", 197 | ); 198 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 199 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 200 | GCC_WARN_UNDECLARED_SELECTOR = YES; 201 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 202 | GCC_WARN_UNUSED_FUNCTION = YES; 203 | GCC_WARN_UNUSED_VARIABLE = YES; 204 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 205 | MTL_FAST_MATH = YES; 206 | ONLY_ACTIVE_ARCH = YES; 207 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 208 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 209 | }; 210 | name = Debug; 211 | }; 212 | 423CCD5B29CC27B700BC6210 /* Release */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | ALWAYS_SEARCH_USER_PATHS = NO; 216 | CLANG_ANALYZER_NONNULL = YES; 217 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 219 | CLANG_ENABLE_MODULES = YES; 220 | CLANG_ENABLE_OBJC_ARC = YES; 221 | CLANG_ENABLE_OBJC_WEAK = YES; 222 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 223 | CLANG_WARN_BOOL_CONVERSION = YES; 224 | CLANG_WARN_COMMA = YES; 225 | CLANG_WARN_CONSTANT_CONVERSION = YES; 226 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 227 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 228 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 229 | CLANG_WARN_EMPTY_BODY = YES; 230 | CLANG_WARN_ENUM_CONVERSION = YES; 231 | CLANG_WARN_INFINITE_RECURSION = YES; 232 | CLANG_WARN_INT_CONVERSION = YES; 233 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 234 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 235 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 236 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 237 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 238 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 239 | CLANG_WARN_STRICT_PROTOTYPES = YES; 240 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 241 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 242 | CLANG_WARN_UNREACHABLE_CODE = YES; 243 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 244 | COPY_PHASE_STRIP = NO; 245 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 246 | ENABLE_NS_ASSERTIONS = NO; 247 | ENABLE_STRICT_OBJC_MSGSEND = YES; 248 | GCC_C_LANGUAGE_STANDARD = gnu11; 249 | GCC_NO_COMMON_BLOCKS = YES; 250 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 251 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 252 | GCC_WARN_UNDECLARED_SELECTOR = YES; 253 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 254 | GCC_WARN_UNUSED_FUNCTION = YES; 255 | GCC_WARN_UNUSED_VARIABLE = YES; 256 | MTL_ENABLE_DEBUG_INFO = NO; 257 | MTL_FAST_MATH = YES; 258 | SWIFT_COMPILATION_MODE = wholemodule; 259 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 260 | }; 261 | name = Release; 262 | }; 263 | 423CCD5D29CC27B700BC6210 /* Debug */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 267 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 268 | CODE_SIGN_ENTITLEMENTS = AuroraAnimation/AuroraAnimation.entitlements; 269 | CODE_SIGN_STYLE = Automatic; 270 | CURRENT_PROJECT_VERSION = 1; 271 | DEVELOPMENT_ASSET_PATHS = "\"AuroraAnimation/Preview Content\""; 272 | ENABLE_PREVIEWS = YES; 273 | GENERATE_INFOPLIST_FILE = YES; 274 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; 275 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; 276 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; 277 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; 278 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; 279 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; 280 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; 281 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; 282 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 283 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 284 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 285 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; 286 | "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; 287 | MACOSX_DEPLOYMENT_TARGET = 13.1; 288 | MARKETING_VERSION = 1.0; 289 | PRODUCT_BUNDLE_IDENTIFIER = com.galasko.demos.AuroraAnimation; 290 | PRODUCT_NAME = "$(TARGET_NAME)"; 291 | SDKROOT = auto; 292 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; 293 | SWIFT_EMIT_LOC_STRINGS = YES; 294 | SWIFT_VERSION = 5.0; 295 | TARGETED_DEVICE_FAMILY = "1,2"; 296 | }; 297 | name = Debug; 298 | }; 299 | 423CCD5E29CC27B700BC6210 /* Release */ = { 300 | isa = XCBuildConfiguration; 301 | buildSettings = { 302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 303 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 304 | CODE_SIGN_ENTITLEMENTS = AuroraAnimation/AuroraAnimation.entitlements; 305 | CODE_SIGN_STYLE = Automatic; 306 | CURRENT_PROJECT_VERSION = 1; 307 | DEVELOPMENT_ASSET_PATHS = "\"AuroraAnimation/Preview Content\""; 308 | ENABLE_PREVIEWS = YES; 309 | GENERATE_INFOPLIST_FILE = YES; 310 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; 311 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; 312 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; 313 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; 314 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; 315 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; 316 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; 317 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; 318 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 319 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 320 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 321 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; 322 | "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; 323 | MACOSX_DEPLOYMENT_TARGET = 13.1; 324 | MARKETING_VERSION = 1.0; 325 | PRODUCT_BUNDLE_IDENTIFIER = com.galasko.demos.AuroraAnimation; 326 | PRODUCT_NAME = "$(TARGET_NAME)"; 327 | SDKROOT = auto; 328 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; 329 | SWIFT_EMIT_LOC_STRINGS = YES; 330 | SWIFT_VERSION = 5.0; 331 | TARGETED_DEVICE_FAMILY = "1,2"; 332 | }; 333 | name = Release; 334 | }; 335 | /* End XCBuildConfiguration section */ 336 | 337 | /* Begin XCConfigurationList section */ 338 | 423CCD4829CC27B600BC6210 /* Build configuration list for PBXProject "AuroraAnimation" */ = { 339 | isa = XCConfigurationList; 340 | buildConfigurations = ( 341 | 423CCD5A29CC27B700BC6210 /* Debug */, 342 | 423CCD5B29CC27B700BC6210 /* Release */, 343 | ); 344 | defaultConfigurationIsVisible = 0; 345 | defaultConfigurationName = Release; 346 | }; 347 | 423CCD5C29CC27B700BC6210 /* Build configuration list for PBXNativeTarget "AuroraAnimation" */ = { 348 | isa = XCConfigurationList; 349 | buildConfigurations = ( 350 | 423CCD5D29CC27B700BC6210 /* Debug */, 351 | 423CCD5E29CC27B700BC6210 /* Release */, 352 | ); 353 | defaultConfigurationIsVisible = 0; 354 | defaultConfigurationName = Release; 355 | }; 356 | /* End XCConfigurationList section */ 357 | }; 358 | rootObject = 423CCD4529CC27B600BC6210 /* Project object */; 359 | } 360 | -------------------------------------------------------------------------------- /AuroraAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AuroraAnimation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AuroraAnimation/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /AuroraAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "1x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "2x", 16 | "size" : "16x16" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "1x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "2x", 26 | "size" : "32x32" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "2x", 36 | "size" : "128x128" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "1x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "2x", 46 | "size" : "256x256" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "1x", 51 | "size" : "512x512" 52 | }, 53 | { 54 | "idiom" : "mac", 55 | "scale" : "2x", 56 | "size" : "512x512" 57 | } 58 | ], 59 | "info" : { 60 | "author" : "xcode", 61 | "version" : 1 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /AuroraAnimation/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /AuroraAnimation/AuroraAnimation.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /AuroraAnimation/AuroraAnimationApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AuroraAnimationApp.swift 3 | // AuroraAnimation 4 | // 5 | // Created by Daniel Galasko on 2023/03/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct AuroraAnimationApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /AuroraAnimation/AuroraView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AuroraView.swift 3 | // AuroraAnimation 4 | // 5 | // Created by Daniel Galasko on 2023/03/21. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct AuroraView: View { 11 | 12 | private enum AnimationProperties { 13 | static let animationSpeed: Double = 4 14 | static let timerDuration: TimeInterval = 3 15 | static let blurRadius: CGFloat = 130 16 | } 17 | 18 | @State private var timer = Timer.publish(every: AnimationProperties.timerDuration, on: .main, in: .common).autoconnect() 19 | @ObservedObject private var animator = CircleAnimator(colors: AuroraColors.all) 20 | 21 | var body: some View { 22 | ZStack { 23 | ZStack { 24 | ForEach(animator.circles) { circle in 25 | MovingCircle(originOffset: circle.position) 26 | .foregroundColor(circle.color) 27 | } 28 | }.blur(radius: AnimationProperties.blurRadius) 29 | } 30 | .background(AuroraColors.backgroundColor) 31 | .onDisappear { 32 | timer.upstream.connect().cancel() 33 | } 34 | .onAppear { 35 | animateCircles() 36 | timer = Timer.publish(every: AnimationProperties.timerDuration, on: .main, in: .common).autoconnect() 37 | } 38 | .onReceive(timer) { _ in 39 | animateCircles() 40 | } 41 | } 42 | 43 | private func animateCircles() { 44 | withAnimation(.easeInOut(duration: AnimationProperties.animationSpeed)) { 45 | animator.animate() 46 | } 47 | } 48 | 49 | } 50 | 51 | private enum AuroraColors { 52 | static var all: [Color] { 53 | [ 54 | Color(red: 11/255, green: 36/255, blue: 40/255, opacity: 0.6), 55 | Color(red: 24/255, green: 99/255, blue: 110/255), 56 | Color(red: 185/255, green: 249/255, blue: 137/255, opacity: 0.7), 57 | Color(red: 63/255, green: 140/255, blue: 78/255), 58 | Color(red: 185/255, green: 249/255, blue: 137/255), 59 | ] 60 | } 61 | 62 | static var backgroundColor: Color { 63 | Color(red: 23/255, green: 81/255, blue: 104/255) 64 | } 65 | } 66 | 67 | private struct MovingCircle: Shape { 68 | 69 | var originOffset: CGPoint 70 | 71 | var animatableData: CGPoint.AnimatableData { 72 | get { 73 | originOffset.animatableData 74 | } 75 | set { 76 | originOffset.animatableData = newValue 77 | } 78 | } 79 | 80 | func path(in rect: CGRect) -> Path { 81 | var path = Path() 82 | 83 | let adjustedX = rect.width * originOffset.x 84 | let adjustedY = rect.height * originOffset.y 85 | let smallestDimension = min(rect.width, rect.height) 86 | path.addArc(center: CGPoint(x: adjustedX, y: adjustedY), radius: smallestDimension/2, startAngle: .zero, endAngle: .degrees(360), clockwise: true) 87 | return path 88 | } 89 | } 90 | 91 | private class CircleAnimator: ObservableObject { 92 | class Circle: Identifiable { 93 | internal init(position: CGPoint, color: Color) { 94 | self.position = position 95 | self.color = color 96 | } 97 | var position: CGPoint 98 | let id = UUID().uuidString 99 | let color: Color 100 | } 101 | 102 | @Published private(set) var circles: [Circle] = [] 103 | 104 | 105 | init(colors: [Color]) { 106 | circles = colors.map({ color in 107 | Circle(position: CircleAnimator.generateRandomPosition(), color: color) 108 | }) 109 | } 110 | 111 | func animate() { 112 | objectWillChange.send() 113 | for circle in circles { 114 | circle.position = CircleAnimator.generateRandomPosition() 115 | } 116 | } 117 | 118 | static func generateRandomPosition() -> CGPoint { 119 | CGPoint(x: CGFloat.random(in: 0 ... 1), y: CGFloat.random(in: 0 ... 1)) 120 | } 121 | } 122 | 123 | struct AuroraView_Previews: PreviewProvider { 124 | static var previews: some View { 125 | AuroraView() 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /AuroraAnimation/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // AuroraAnimation 4 | // 5 | // Created by Daniel Galasko on 2023/03/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | var body: some View { 12 | ZStack { 13 | AuroraView() 14 | VStack { 15 | Spacer() 16 | VStack(spacing: 16) { 17 | Text("Aurora") 18 | .font(.largeTitle) 19 | Text(""" 20 | The word "aurora" is derived from the name of the Roman goddess of the dawn, Aurora, who travelled from east to west announcing the coming of the sun. 21 | 22 | Ancient Greek poets used the corresponding name Eos metaphorically to refer to dawn, often mentioning its play of colors across the otherwise dark sky. 23 | """) 24 | .font(.body) 25 | HStack { 26 | Spacer() 27 | Text("Source: Wikipedia") 28 | .font(.caption) 29 | } 30 | } 31 | .padding() 32 | .background(Material.thin, in: RoundedRectangle(cornerRadius: 8)) 33 | Spacer() 34 | Button("Let's Build This", action: {}) 35 | .buttonStyle(.borderedProminent) 36 | } 37 | .padding() 38 | .fontDesign(.rounded) 39 | .foregroundColor(.white) 40 | } 41 | } 42 | } 43 | 44 | struct ContentView_Previews: PreviewProvider { 45 | static var previews: some View { 46 | ContentView() 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /AuroraAnimation/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Daniel Galasko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aurora-animation-swiftui 2 | 3 | The Aurora Effect in SwiftUI. 4 | 5 | Open the `.xcodeproj` to learn more. 6 | 7 | 8 | 9 | > Note: There is a video of the project but GitHub is not rendering it. 10 | 11 | -------------------------------------------------------------------------------- /preview.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielgalasko/aurora-animation-swiftui/054e4997b8bec102148bbd14e5c18a3edb8213f1/preview.mov -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielgalasko/aurora-animation-swiftui/054e4997b8bec102148bbd14e5c18a3edb8213f1/screenshot.png --------------------------------------------------------------------------------