diff --git a/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.pbxproj b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2a2e1f0 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.pbxproj @@ -0,0 +1,604 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 266EA27B289CDAFE004D7EBF /* AirDropAnimation_ExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 266EA27A289CDAFE004D7EBF /* AirDropAnimation_ExampleApp.swift */; }; + 266EA27D289CDAFE004D7EBF /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 266EA27C289CDAFE004D7EBF /* ContentView.swift */; }; + 266EA27F289CDB00004D7EBF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 266EA27E289CDB00004D7EBF /* Assets.xcassets */; }; + 266EA282289CDB00004D7EBF /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 266EA281289CDB00004D7EBF /* Preview Assets.xcassets */; }; + 266EA28C289CDB00004D7EBF /* AirDropAnimation_ExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 266EA28B289CDB00004D7EBF /* AirDropAnimation_ExampleTests.swift */; }; + 266EA296289CDB00004D7EBF /* AirDropAnimation_ExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 266EA295289CDB00004D7EBF /* AirDropAnimation_ExampleUITests.swift */; }; + 266EA298289CDB00004D7EBF /* AirDropAnimation_ExampleUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 266EA297289CDB00004D7EBF /* AirDropAnimation_ExampleUITestsLaunchTests.swift */; }; + 266EA2A5289CDB46004D7EBF /* AirDropView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 266EA2A4289CDB46004D7EBF /* AirDropView.swift */; }; + 26A01DF928A159A000C178B5 /* person.png in Resources */ = {isa = PBXBuildFile; fileRef = 26A01DF828A159A000C178B5 /* person.png */; }; + 26A01DFB28A26E0E00C178B5 /* Constant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A01DFA28A26E0E00C178B5 /* Constant.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 266EA288289CDB00004D7EBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 266EA26F289CDAFE004D7EBF /* Project object */; + proxyType = 1; + remoteGlobalIDString = 266EA276289CDAFE004D7EBF; + remoteInfo = AirDropAnimation_Example; + }; + 266EA292289CDB00004D7EBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 266EA26F289CDAFE004D7EBF /* Project object */; + proxyType = 1; + remoteGlobalIDString = 266EA276289CDAFE004D7EBF; + remoteInfo = AirDropAnimation_Example; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 266EA277289CDAFE004D7EBF /* AirDropAnimation_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AirDropAnimation_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 266EA27A289CDAFE004D7EBF /* AirDropAnimation_ExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDropAnimation_ExampleApp.swift; sourceTree = ""; }; + 266EA27C289CDAFE004D7EBF /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 266EA27E289CDB00004D7EBF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 266EA281289CDB00004D7EBF /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 266EA287289CDB00004D7EBF /* AirDropAnimation_ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AirDropAnimation_ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 266EA28B289CDB00004D7EBF /* AirDropAnimation_ExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDropAnimation_ExampleTests.swift; sourceTree = ""; }; + 266EA291289CDB00004D7EBF /* AirDropAnimation_ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AirDropAnimation_ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 266EA295289CDB00004D7EBF /* AirDropAnimation_ExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDropAnimation_ExampleUITests.swift; sourceTree = ""; }; + 266EA297289CDB00004D7EBF /* AirDropAnimation_ExampleUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDropAnimation_ExampleUITestsLaunchTests.swift; sourceTree = ""; }; + 266EA2A4289CDB46004D7EBF /* AirDropView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDropView.swift; sourceTree = ""; }; + 26A01DF828A159A000C178B5 /* person.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = person.png; sourceTree = ""; }; + 26A01DFA28A26E0E00C178B5 /* Constant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constant.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 266EA274289CDAFE004D7EBF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 266EA284289CDB00004D7EBF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 266EA28E289CDB00004D7EBF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 266EA26E289CDAFE004D7EBF = { + isa = PBXGroup; + children = ( + 266EA279289CDAFE004D7EBF /* AirDropAnimation_Example */, + 266EA28A289CDB00004D7EBF /* AirDropAnimation_ExampleTests */, + 266EA294289CDB00004D7EBF /* AirDropAnimation_ExampleUITests */, + 266EA278289CDAFE004D7EBF /* Products */, + ); + sourceTree = ""; + }; + 266EA278289CDAFE004D7EBF /* Products */ = { + isa = PBXGroup; + children = ( + 266EA277289CDAFE004D7EBF /* AirDropAnimation_Example.app */, + 266EA287289CDB00004D7EBF /* AirDropAnimation_ExampleTests.xctest */, + 266EA291289CDB00004D7EBF /* AirDropAnimation_ExampleUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 266EA279289CDAFE004D7EBF /* AirDropAnimation_Example */ = { + isa = PBXGroup; + children = ( + 26A01DF728A159A000C178B5 /* Resources */, + 266EA27A289CDAFE004D7EBF /* AirDropAnimation_ExampleApp.swift */, + 266EA27C289CDAFE004D7EBF /* ContentView.swift */, + 266EA27E289CDB00004D7EBF /* Assets.xcassets */, + 266EA280289CDB00004D7EBF /* Preview Content */, + 266EA2A4289CDB46004D7EBF /* AirDropView.swift */, + 26A01DFA28A26E0E00C178B5 /* Constant.swift */, + ); + path = AirDropAnimation_Example; + sourceTree = ""; + }; + 266EA280289CDB00004D7EBF /* Preview Content */ = { + isa = PBXGroup; + children = ( + 266EA281289CDB00004D7EBF /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 266EA28A289CDB00004D7EBF /* AirDropAnimation_ExampleTests */ = { + isa = PBXGroup; + children = ( + 266EA28B289CDB00004D7EBF /* AirDropAnimation_ExampleTests.swift */, + ); + path = AirDropAnimation_ExampleTests; + sourceTree = ""; + }; + 266EA294289CDB00004D7EBF /* AirDropAnimation_ExampleUITests */ = { + isa = PBXGroup; + children = ( + 266EA295289CDB00004D7EBF /* AirDropAnimation_ExampleUITests.swift */, + 266EA297289CDB00004D7EBF /* AirDropAnimation_ExampleUITestsLaunchTests.swift */, + ); + path = AirDropAnimation_ExampleUITests; + sourceTree = ""; + }; + 26A01DF728A159A000C178B5 /* Resources */ = { + isa = PBXGroup; + children = ( + 26A01DF828A159A000C178B5 /* person.png */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 266EA276289CDAFE004D7EBF /* AirDropAnimation_Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 266EA29B289CDB00004D7EBF /* Build configuration list for PBXNativeTarget "AirDropAnimation_Example" */; + buildPhases = ( + 266EA273289CDAFE004D7EBF /* Sources */, + 266EA274289CDAFE004D7EBF /* Frameworks */, + 266EA275289CDAFE004D7EBF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AirDropAnimation_Example; + productName = AirDropAnimation_Example; + productReference = 266EA277289CDAFE004D7EBF /* AirDropAnimation_Example.app */; + productType = "com.apple.product-type.application"; + }; + 266EA286289CDB00004D7EBF /* AirDropAnimation_ExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 266EA29E289CDB00004D7EBF /* Build configuration list for PBXNativeTarget "AirDropAnimation_ExampleTests" */; + buildPhases = ( + 266EA283289CDB00004D7EBF /* Sources */, + 266EA284289CDB00004D7EBF /* Frameworks */, + 266EA285289CDB00004D7EBF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 266EA289289CDB00004D7EBF /* PBXTargetDependency */, + ); + name = AirDropAnimation_ExampleTests; + productName = AirDropAnimation_ExampleTests; + productReference = 266EA287289CDB00004D7EBF /* AirDropAnimation_ExampleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 266EA290289CDB00004D7EBF /* AirDropAnimation_ExampleUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 266EA2A1289CDB00004D7EBF /* Build configuration list for PBXNativeTarget "AirDropAnimation_ExampleUITests" */; + buildPhases = ( + 266EA28D289CDB00004D7EBF /* Sources */, + 266EA28E289CDB00004D7EBF /* Frameworks */, + 266EA28F289CDB00004D7EBF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 266EA293289CDB00004D7EBF /* PBXTargetDependency */, + ); + name = AirDropAnimation_ExampleUITests; + productName = AirDropAnimation_ExampleUITests; + productReference = 266EA291289CDB00004D7EBF /* AirDropAnimation_ExampleUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 266EA26F289CDAFE004D7EBF /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1320; + LastUpgradeCheck = 1320; + TargetAttributes = { + 266EA276289CDAFE004D7EBF = { + CreatedOnToolsVersion = 13.2.1; + }; + 266EA286289CDB00004D7EBF = { + CreatedOnToolsVersion = 13.2.1; + TestTargetID = 266EA276289CDAFE004D7EBF; + }; + 266EA290289CDB00004D7EBF = { + CreatedOnToolsVersion = 13.2.1; + TestTargetID = 266EA276289CDAFE004D7EBF; + }; + }; + }; + buildConfigurationList = 266EA272289CDAFE004D7EBF /* Build configuration list for PBXProject "AirDropAnimation_Example" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 266EA26E289CDAFE004D7EBF; + productRefGroup = 266EA278289CDAFE004D7EBF /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 266EA276289CDAFE004D7EBF /* AirDropAnimation_Example */, + 266EA286289CDB00004D7EBF /* AirDropAnimation_ExampleTests */, + 266EA290289CDB00004D7EBF /* AirDropAnimation_ExampleUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 266EA275289CDAFE004D7EBF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 26A01DF928A159A000C178B5 /* person.png in Resources */, + 266EA282289CDB00004D7EBF /* Preview Assets.xcassets in Resources */, + 266EA27F289CDB00004D7EBF /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 266EA285289CDB00004D7EBF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 266EA28F289CDB00004D7EBF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 266EA273289CDAFE004D7EBF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 266EA27D289CDAFE004D7EBF /* ContentView.swift in Sources */, + 266EA2A5289CDB46004D7EBF /* AirDropView.swift in Sources */, + 266EA27B289CDAFE004D7EBF /* AirDropAnimation_ExampleApp.swift in Sources */, + 26A01DFB28A26E0E00C178B5 /* Constant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 266EA283289CDB00004D7EBF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 266EA28C289CDB00004D7EBF /* AirDropAnimation_ExampleTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 266EA28D289CDB00004D7EBF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 266EA298289CDB00004D7EBF /* AirDropAnimation_ExampleUITestsLaunchTests.swift in Sources */, + 266EA296289CDB00004D7EBF /* AirDropAnimation_ExampleUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 266EA289289CDB00004D7EBF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 266EA276289CDAFE004D7EBF /* AirDropAnimation_Example */; + targetProxy = 266EA288289CDB00004D7EBF /* PBXContainerItemProxy */; + }; + 266EA293289CDB00004D7EBF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 266EA276289CDAFE004D7EBF /* AirDropAnimation_Example */; + targetProxy = 266EA292289CDB00004D7EBF /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 266EA299289CDB00004D7EBF /* 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_CXX_LIBRARY = "libc++"; + 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.2; + 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; + }; + 266EA29A289CDB00004D7EBF /* 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_CXX_LIBRARY = "libc++"; + 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.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 266EA29C289CDB00004D7EBF /* 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_Example/Preview Content\""; + 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.AirDropAnimation-Example"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 266EA29D289CDB00004D7EBF /* 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_Example/Preview Content\""; + 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.AirDropAnimation-Example"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 266EA29F289CDB00004D7EBF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.AirDropAnimation-ExampleTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AirDropAnimation_Example.app/AirDropAnimation_Example"; + }; + name = Debug; + }; + 266EA2A0289CDB00004D7EBF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.AirDropAnimation-ExampleTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AirDropAnimation_Example.app/AirDropAnimation_Example"; + }; + name = Release; + }; + 266EA2A2289CDB00004D7EBF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.AirDropAnimation-ExampleUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = AirDropAnimation_Example; + }; + name = Debug; + }; + 266EA2A3289CDB00004D7EBF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.AirDropAnimation-ExampleUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = AirDropAnimation_Example; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 266EA272289CDAFE004D7EBF /* Build configuration list for PBXProject "AirDropAnimation_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 266EA299289CDB00004D7EBF /* Debug */, + 266EA29A289CDB00004D7EBF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 266EA29B289CDB00004D7EBF /* Build configuration list for PBXNativeTarget "AirDropAnimation_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 266EA29C289CDB00004D7EBF /* Debug */, + 266EA29D289CDB00004D7EBF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 266EA29E289CDB00004D7EBF /* Build configuration list for PBXNativeTarget "AirDropAnimation_ExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 266EA29F289CDB00004D7EBF /* Debug */, + 266EA2A0289CDB00004D7EBF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 266EA2A1289CDB00004D7EBF /* Build configuration list for PBXNativeTarget "AirDropAnimation_ExampleUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 266EA2A2289CDB00004D7EBF /* Debug */, + 266EA2A3289CDB00004D7EBF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 266EA26F289CDAFE004D7EBF /* Project object */; +} diff --git a/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.xcworkspace/xcuserdata/shanmukh.xcuserdatad/UserInterfaceState.xcuserstate b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.xcworkspace/xcuserdata/shanmukh.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..010d3bb Binary files /dev/null and b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/project.xcworkspace/xcuserdata/shanmukh.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/xcuserdata/shanmukh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/xcuserdata/shanmukh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..a405739 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/xcuserdata/shanmukh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/xcuserdata/shanmukh.xcuserdatad/xcschemes/xcschememanagement.plist b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/xcuserdata/shanmukh.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..fde0442 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example.xcodeproj/xcuserdata/shanmukh.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + AirDropAnimation_Example.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/AirDropAnimation_Example/AirDropAnimation_Example/AirDropAnimation_ExampleApp.swift b/AirDropAnimation_Example/AirDropAnimation_Example/AirDropAnimation_ExampleApp.swift new file mode 100644 index 0000000..4a537d8 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example/AirDropAnimation_ExampleApp.swift @@ -0,0 +1,17 @@ +// +// AirDropAnimation_ExampleApp.swift +// AirDropAnimation_Example +// +// Created by Shanmukh Phulari on 05/08/22. +// + +import SwiftUI + +@main +struct AirDropAnimation_ExampleApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/AirDropAnimation_Example/AirDropAnimation_Example/AirDropView.swift b/AirDropAnimation_Example/AirDropAnimation_Example/AirDropView.swift new file mode 100644 index 0000000..59bf910 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example/AirDropView.swift @@ -0,0 +1,179 @@ +// +// AirDropView.swift +// AirDropAnimation_Example +// +// Created by Shanmukh Phulari on 05/08/22. +// + +import SwiftUI + +//Progress status Enum +enum ProgressStatus { + case none, notconnected, connecting, connected, started, completed +} + +struct AirDropView: View { + let size : CGSize + let personName : String + let personImage : UIImage + let deviceName : String + let progress : Double + let progressStatus : ProgressStatus; + + //State variable + @State var blinking = false; + @State private var progressStatusText : String = getProgressStatusText(progress: .notconnected) + @State private var progressStatusTextColor : Color = defaultProgressStatusTextColor + @State private var backgroundProgressStrokeColor = progressGrayColor + @State private var foregroundProgressStrokeColor = progressBlueColor + @State private var imageBorderStrokeColor = progressBlackColor + + //Timer to do animation + @State private var blinkTimer = Timer.publish(every: .infinity, tolerance: 0, on: .main, in: RunLoop.Mode.common, options: nil).autoconnect() + + var body: some View { + VStack { + ZStack{ + //default progress circle + Circle() + .stroke(backgroundProgressStrokeColor, lineWidth: size.width*stokeWidthRatio) + .background(Circle().fill(backgroundProgressColor)) + + //progress circle + Circle() + .trim(from: 0.0, to:progress) + .stroke(foregroundProgressStrokeColor, lineWidth: size.width*stokeWidthRatio) + .rotationEffect(.degrees(-90)) + .animation(.easeOut(duration:progress), value: progress) + + //person image border + Circle() + .inset(by: (size.width*stokeWidthRatio)/3) + .stroke(imageBorderStrokeColor, lineWidth: (size.width*stokeWidthRatio)/3) + + //persone image + Image(uiImage: personImage) + .resizable() + .scaledToFit() + + }.padding() + + //Device name + Text(deviceName) + .font(.headline) + .foregroundColor(defaultProgressStatusTextColor) + + //Progress status + Text(progressStatusText) + .font(.headline) + .foregroundColor(progressStatusTextColor) + .opacity(blinking ? 0 : 1) + .animation(blinking ? .easeIn(duration: blinkTimerValue ) : .easeOut(duration: blinkTimerValue), value: blinking) + .onReceive(blinkTimer, perform: { _ in + blinking = !blinking; + }) + } + .onChange(of: progressStatus, perform: { newValue in + + switch newValue { + case .notconnected: + onNotConnected(status: newValue) + case .connecting: + onConnecting(status: newValue) + case .connected: + break + case .started: + onStarted(status: newValue) + case .completed: + //Adding delay to complete animation + DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0) { + onFinish(status: newValue) + } + case .none: + break + } + }) + .frame(width: size.width, height: size.height, alignment: .center) + } + + private func onNotConnected(status:ProgressStatus) { + + //iphone connected + progressStatusText = AirDropView.getProgressStatusText(progress: status) + personName; + + progressStatusTextColor = defaultProgressStatusTextColor + + //reset stroke color + backgroundProgressStrokeColor = progressGrayColor + foregroundProgressStrokeColor = progressBlueColor + imageBorderStrokeColor = progressBlackColor + + //reset blinking + blinkTimer.upstream.connect().cancel() + blinkTimer = Timer.publish(every: .infinity, tolerance: 0, on: .main, in: RunLoop.Mode.common, options: nil).autoconnect() + + } + + private func onConnecting(status:ProgressStatus) { + + progressStatusText = AirDropView.getProgressStatusText(progress: status); + + progressStatusTextColor = defaultProgressStatusTextColor + + //reset blinking + blinkTimer.upstream.connect().cancel() + blinkTimer = Timer.publish(every: blinkTimerValue, tolerance: 0, on: .main, in: RunLoop.Mode.common, options: nil).autoconnect() + } + + private func onStarted(status:ProgressStatus) { + + //Stop blinking + blinking = false; + blinkTimer.upstream.connect().cancel() + + //iphone started sending + progressStatusText = AirDropView.getProgressStatusText(progress: status); + + progressStatusTextColor = defaultProgressStatusTextColor + } + + private func onFinish(status:ProgressStatus) { + + //iphone completes sending + progressStatusText = AirDropView.getProgressStatusText(progress: status); + + progressStatusTextColor = completedProgressStatusTextColor + + withAnimation(Animation.easeOut(duration: 0.3).delay(1)) { + backgroundProgressStrokeColor = Color.clear + foregroundProgressStrokeColor = Color.clear + imageBorderStrokeColor = Color.clear + } + } + + static func getProgressStatusText(progress:ProgressStatus) -> String { + var returnValue = ""; + switch progress { + case .notconnected: + returnValue = "from "; + case .connecting: + returnValue = "Waiting..."; + case .connected: + returnValue = "Connected"; + case .started: + returnValue = "Sending..." + case .completed: + returnValue = "Sent" + case .none: + returnValue = "" + } + return returnValue; + } + +} + +struct AirDropView_Previews: PreviewProvider { + static var previews: some View { + AirDropView(size: CGSize.zero, personName: "Amos", personImage: UIImage(named: "person")!, deviceName: "iPhone", progress: 0, progressStatus: .notconnected) + } +} diff --git a/AirDropAnimation_Example/AirDropAnimation_Example/Assets.xcassets/AccentColor.colorset/Contents.json b/AirDropAnimation_Example/AirDropAnimation_Example/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AirDropAnimation_Example/AirDropAnimation_Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/AirDropAnimation_Example/AirDropAnimation_Example/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "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" : "1x", + "size" : "76x76" + }, + { + "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/AirDropAnimation_Example/AirDropAnimation_Example/Assets.xcassets/Contents.json b/AirDropAnimation_Example/AirDropAnimation_Example/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AirDropAnimation_Example/AirDropAnimation_Example/Constant.swift b/AirDropAnimation_Example/AirDropAnimation_Example/Constant.swift new file mode 100644 index 0000000..ff5e328 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example/Constant.swift @@ -0,0 +1,22 @@ +// +// Constant.swift +// AirDropAnimation_Example +// +// Created by Shanmukh Phulari on 09/08/22. +// + +import Foundation +import SwiftUI + + +let stokeWidthRatio = 0.05; +let blinkTimerValue : Double = 0.6 +let waitingTimerValue : Double = 4.0 +let progressTimerValue : Double = 0.1 + +let backgroundProgressColor = Color.init(red: 153.0/255.0, green: 154.0/255.0, blue: 154.0/255.0) +let defaultProgressStatusTextColor : Color = Color.init(red: 222.0/255.0, green: 222.0/255.0, blue: 222.0/255.0) +let completedProgressStatusTextColor : Color = Color.init(red: 53.0/255.0, green: 134.0/255.0, blue: 247.0/255.0) +let progressGrayColor : Color = Color.init(red: 104.0/255.0, green: 104.0/255.0, blue: 108.0/255.0) +let progressBlueColor : Color = Color.init(red: 53.0/255.0, green: 134.0/255.0, blue: 247.0/255.0) +let progressBlackColor : Color = Color.init(red: 32.0/255.0, green: 32.0/255.0, blue: 32.0/255.0) diff --git a/AirDropAnimation_Example/AirDropAnimation_Example/ContentView.swift b/AirDropAnimation_Example/AirDropAnimation_Example/ContentView.swift new file mode 100644 index 0000000..17e27a2 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example/ContentView.swift @@ -0,0 +1,83 @@ +// +// ContentView.swift +// AirDropAnimation_Example +// +// Created by Shanmukh Phulari on 05/08/22. +// + +import SwiftUI + +struct ContentView: View { + + //State variable + @State var startAirDropAnimation : Bool = false + @State var progress : Double = 0.0 + @State private var progressStatus : ProgressStatus = .none; //Default: iphone not connected + + //Timer to do animation + @State private var progressTimer = Timer.publish(every: 1, tolerance: 0, on: .main, in: RunLoop.Mode.common, options: nil).autoconnect() + + var body: some View { + ZStack { + progressBlackColor.ignoresSafeArea() + VStack { + Text("Tap on icon to start animation").padding().foregroundColor(defaultProgressStatusTextColor) + + //AirDrop View + AirDropView(size: CGSize.init(width: 200, height: 200), + personName: "Amos", + personImage: UIImage(named: "person")!, + deviceName: "iPhone", + progress: progress, + progressStatus: progressStatus) + .onReceive(progressTimer) { _ in + if(startAirDropAnimation) { + if(progressStatus == .started) { + if (progress <= 1) { + progress += 0.05; + }else { + //completes sending + progressStatus = .completed; + + //Cancel progress timer + progressTimer.upstream.connect().cancel(); + + startAirDropAnimation = false + } + }else if(progressStatus == .notconnected) { + //connecting + progressStatus = .connecting; + + //start waiting timer + progressTimer.upstream.connect().cancel() + progressTimer = Timer.publish(every: waitingTimerValue, tolerance: 0, on: .main, in: RunLoop.Mode.common, options: nil).autoconnect() + + }else if(progressStatus == .connecting) { + //started sending data + progressStatus = .started; + + //start progress timer + progressTimer = Timer.publish(every: progressTimerValue, tolerance: 0, on: .main, in: RunLoop.Mode.common, options: nil).autoconnect() + } + } + } + .padding() + .onTapGesture { + + startAirDropAnimation = !startAirDropAnimation + + //reset values + progress = 0.0 + progressStatus = .notconnected + progressTimer = Timer.publish(every: 1, tolerance: 0, on: .main, in: RunLoop.Mode.common, options: nil).autoconnect() + } + } + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/AirDropAnimation_Example/AirDropAnimation_Example/Preview Content/Preview Assets.xcassets/Contents.json b/AirDropAnimation_Example/AirDropAnimation_Example/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_Example/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AirDropAnimation_Example/AirDropAnimation_Example/Resources/person.png b/AirDropAnimation_Example/AirDropAnimation_Example/Resources/person.png new file mode 100644 index 0000000..edee1da Binary files /dev/null and b/AirDropAnimation_Example/AirDropAnimation_Example/Resources/person.png differ diff --git a/AirDropAnimation_Example/AirDropAnimation_ExampleTests/AirDropAnimation_ExampleTests.swift b/AirDropAnimation_Example/AirDropAnimation_ExampleTests/AirDropAnimation_ExampleTests.swift new file mode 100644 index 0000000..afa9347 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_ExampleTests/AirDropAnimation_ExampleTests.swift @@ -0,0 +1,36 @@ +// +// AirDropAnimation_ExampleTests.swift +// AirDropAnimation_ExampleTests +// +// Created by Shanmukh Phulari on 05/08/22. +// + +import XCTest +@testable import AirDropAnimation_Example + +class AirDropAnimation_ExampleTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + // Any test you write for XCTest can be annotated as throws and async. + // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. + // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/AirDropAnimation_Example/AirDropAnimation_ExampleUITests/AirDropAnimation_ExampleUITests.swift b/AirDropAnimation_Example/AirDropAnimation_ExampleUITests/AirDropAnimation_ExampleUITests.swift new file mode 100644 index 0000000..32d1c0e --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_ExampleUITests/AirDropAnimation_ExampleUITests.swift @@ -0,0 +1,42 @@ +// +// AirDropAnimation_ExampleUITests.swift +// AirDropAnimation_ExampleUITests +// +// Created by Shanmukh Phulari on 05/08/22. +// + +import XCTest + +class AirDropAnimation_ExampleUITests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testLaunchPerformance() throws { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { + // This measures how long it takes to launch your application. + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } + } +} diff --git a/AirDropAnimation_Example/AirDropAnimation_ExampleUITests/AirDropAnimation_ExampleUITestsLaunchTests.swift b/AirDropAnimation_Example/AirDropAnimation_ExampleUITests/AirDropAnimation_ExampleUITestsLaunchTests.swift new file mode 100644 index 0000000..5ed68f3 --- /dev/null +++ b/AirDropAnimation_Example/AirDropAnimation_ExampleUITests/AirDropAnimation_ExampleUITestsLaunchTests.swift @@ -0,0 +1,32 @@ +// +// AirDropAnimation_ExampleUITestsLaunchTests.swift +// AirDropAnimation_ExampleUITests +// +// Created by Shanmukh Phulari on 05/08/22. +// + +import XCTest + +class AirDropAnimation_ExampleUITestsLaunchTests: XCTestCase { + + override class var runsForEachTargetApplicationUIConfiguration: Bool { + true + } + + override func setUpWithError() throws { + continueAfterFailure = false + } + + func testLaunch() throws { + let app = XCUIApplication() + app.launch() + + // Insert steps here to perform after app launch but before taking a screenshot, + // such as logging into a test account or navigating somewhere in the app + + let attachment = XCTAttachment(screenshot: app.screenshot()) + attachment.name = "Launch Screen" + attachment.lifetime = .keepAlways + add(attachment) + } +}