diff --git a/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation.xcodeproj/project.pbxproj b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f0002b4 --- /dev/null +++ b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation.xcodeproj/project.pbxproj @@ -0,0 +1,344 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + B2EF14962894FD2D00E240BE /* AirdropAnimationApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2EF14952894FD2D00E240BE /* AirdropAnimationApp.swift */; }; + B2EF14982894FD2D00E240BE /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2EF14972894FD2D00E240BE /* ContentView.swift */; }; + B2EF149A2894FD2E00E240BE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2EF14992894FD2E00E240BE /* Assets.xcassets */; }; + B2EF149D2894FD2E00E240BE /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2EF149C2894FD2E00E240BE /* Preview Assets.xcassets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + B2EF14922894FD2D00E240BE /* AirdropAnimation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AirdropAnimation.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B2EF14952894FD2D00E240BE /* AirdropAnimationApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirdropAnimationApp.swift; sourceTree = ""; }; + B2EF14972894FD2D00E240BE /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + B2EF14992894FD2E00E240BE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B2EF149C2894FD2E00E240BE /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B2EF148F2894FD2D00E240BE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + B2EF14892894FD2D00E240BE = { + isa = PBXGroup; + children = ( + B2EF14942894FD2D00E240BE /* AirdropAnimation */, + B2EF14932894FD2D00E240BE /* Products */, + ); + sourceTree = ""; + }; + B2EF14932894FD2D00E240BE /* Products */ = { + isa = PBXGroup; + children = ( + B2EF14922894FD2D00E240BE /* AirdropAnimation.app */, + ); + name = Products; + sourceTree = ""; + }; + B2EF14942894FD2D00E240BE /* AirdropAnimation */ = { + isa = PBXGroup; + children = ( + B2EF14952894FD2D00E240BE /* AirdropAnimationApp.swift */, + B2EF14972894FD2D00E240BE /* ContentView.swift */, + B2EF14992894FD2E00E240BE /* Assets.xcassets */, + B2EF149B2894FD2E00E240BE /* Preview Content */, + ); + path = AirdropAnimation; + sourceTree = ""; + }; + B2EF149B2894FD2E00E240BE /* Preview Content */ = { + isa = PBXGroup; + children = ( + B2EF149C2894FD2E00E240BE /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B2EF14912894FD2D00E240BE /* AirdropAnimation */ = { + isa = PBXNativeTarget; + buildConfigurationList = B2EF14A02894FD2E00E240BE /* Build configuration list for PBXNativeTarget "AirdropAnimation" */; + buildPhases = ( + B2EF148E2894FD2D00E240BE /* Sources */, + B2EF148F2894FD2D00E240BE /* Frameworks */, + B2EF14902894FD2D00E240BE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AirdropAnimation; + productName = AirdropAnimation; + productReference = B2EF14922894FD2D00E240BE /* AirdropAnimation.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B2EF148A2894FD2D00E240BE /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1340; + LastUpgradeCheck = 1340; + TargetAttributes = { + B2EF14912894FD2D00E240BE = { + CreatedOnToolsVersion = 13.4.1; + }; + }; + }; + buildConfigurationList = B2EF148D2894FD2D00E240BE /* Build configuration list for PBXProject "AirdropAnimation" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B2EF14892894FD2D00E240BE; + productRefGroup = B2EF14932894FD2D00E240BE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B2EF14912894FD2D00E240BE /* AirdropAnimation */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B2EF14902894FD2D00E240BE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B2EF149D2894FD2E00E240BE /* Preview Assets.xcassets in Resources */, + B2EF149A2894FD2E00E240BE /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B2EF148E2894FD2D00E240BE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B2EF14982894FD2D00E240BE /* ContentView.swift in Sources */, + B2EF14962894FD2D00E240BE /* AirdropAnimationApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + B2EF149E2894FD2E00E240BE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B2EF149F2894FD2E00E240BE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B2EF14A12894FD2E00E240BE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"AirdropAnimation/Preview Content\""; + DEVELOPMENT_TEAM = YLHT46ZLDT; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sahilsahucode.AirdropAnimation; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B2EF14A22894FD2E00E240BE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"AirdropAnimation/Preview Content\""; + DEVELOPMENT_TEAM = YLHT46ZLDT; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sahilsahucode.AirdropAnimation; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B2EF148D2894FD2D00E240BE /* Build configuration list for PBXProject "AirdropAnimation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B2EF149E2894FD2E00E240BE /* Debug */, + B2EF149F2894FD2E00E240BE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B2EF14A02894FD2E00E240BE /* Build configuration list for PBXNativeTarget "AirdropAnimation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B2EF14A12894FD2E00E240BE /* Debug */, + B2EF14A22894FD2E00E240BE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B2EF148A2894FD2D00E240BE /* Project object */; +} diff --git a/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/AirdropAnimationApp.swift b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/AirdropAnimationApp.swift new file mode 100644 index 0000000..14edcb4 --- /dev/null +++ b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/AirdropAnimationApp.swift @@ -0,0 +1,17 @@ +// +// AirdropAnimationApp.swift +// AirdropAnimation +// +// Created by Sahil Sahu on 30/07/22. +// + +import SwiftUI + +@main +struct AirdropAnimationApp: App { + var body: some Scene { + WindowGroup { + ContentView(vm: ContentViewModel()) + } + } +} diff --git a/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Assets.xcassets/AccentColor.colorset/Contents.json b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..5a3257a --- /dev/null +++ b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Assets.xcassets/Contents.json b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/ContentView.swift b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/ContentView.swift new file mode 100644 index 0000000..f2d1814 --- /dev/null +++ b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/ContentView.swift @@ -0,0 +1,164 @@ +// +// ContentView.swift +// AirdropAnimation +// +// Created by Sahil Sahu on 30/07/22. +// + +import SwiftUI + +struct ContentView: View { + + + @StateObject var vm: ContentViewModel + + var body: some View { + ZStack(alignment: .center) { + + Color.black.edgesIgnoringSafeArea(.all) + + Circle() + .stroke(lineWidth: 6) + .frame(width: 160, height: 160) + .opacity(vm.progressBarOpacity) + .foregroundColor(vm.textState == .sent ? .blue : .gray) + + Circle() + .trim(from: 0, to: vm.strokeEnd) + .stroke(lineWidth: 5) + .frame(width: 160, height: 160) + .foregroundColor(.blue) + .rotationEffect(Angle(degrees: -90)) + + Image(systemName: "person.crop.circle.fill") + .resizable() + .renderingMode(.template) + .aspectRatio(contentMode: .fill) + .foregroundColor(.gray) + .frame(width: 150, height: 150) + .onTapGesture { + vm.startAnimation() + } + + VStack(alignment: .center){ + + Text("iPhone") + .foregroundColor(.white) + .font(Font.headline) + + Text(vm.textState == .none ? "from Sahil" : vm.textState == .waiting ? "Waiting..." : vm.textState == .sending ? "Sending" : "Sent") + .foregroundColor(vm.textState == .sent ? .blue : .gray) + .opacity(vm.textState == .waiting ? self.vm.waitingOpactiy : 1) + .font(Font.headline) + + } + .offset(y: 110) + + } + + } + +} + + +enum TextState { + case none + case waiting + case sending + case sent +} + +class ContentViewModel: ObservableObject { + + @Published var textState: TextState = .none + @Published var waitingOpactiy: CGFloat = 1 + @Published var strokeEnd: CGFloat = 0 + + @Published var progressBarOpacity: CGFloat = 1 + + func startAnimation() { + + self.textState = .waiting + self.waitingOpactiy = 1 + self.strokeEnd = 0 + + progressBarOpacity = 1 + + startWaiting { + self.startSending { + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { + + self.strokeEnd = 0 + self.textState = .sent + + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { + + withAnimation(.easeOut(duration: 1)) { + self.progressBarOpacity = 0 + } + } + + } + } + } + + } + + func startWaiting(completion: @escaping () -> ()) { + + var total_time = 6 + + Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { timer in + if total_time > 0 { + if self.waitingOpactiy == 1 { + withAnimation(.easeOut(duration: 1.2)){ + self.waitingOpactiy = 0 + } + } + + else { + withAnimation(.easeIn(duration: 0.35)){ + self.waitingOpactiy = 1 + } + } + + + total_time -= 1 + } + else { + timer.invalidate() + completion() + } + + } + + } + + + + func startSending(completion: @escaping () -> ()) { + + self.textState = .sending + + Timer.scheduledTimer(withTimeInterval: 0.35, repeats: true) { timer in + + if self.strokeEnd < 1 { + withAnimation(.linear(duration: 0.35)) { + self.strokeEnd += 0.1 + } + + } + else { + timer.invalidate() + completion() + } + } + } + +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView(vm: ContentViewModel()) + } +} diff --git a/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Preview Content/Preview Assets.xcassets/Contents.json b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Sahil Sahu Submission/AirdropAnimation/AirdropAnimation/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sahil Sahu Submission/demo.mp4 b/Sahil Sahu Submission/demo.mp4 new file mode 100644 index 0000000..44e717a Binary files /dev/null and b/Sahil Sahu Submission/demo.mp4 differ