diff --git a/chrisharper22/AirDrop/AirDrop.xcodeproj/project.pbxproj b/chrisharper22/AirDrop/AirDrop.xcodeproj/project.pbxproj new file mode 100644 index 0000000..66c2d9a --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop.xcodeproj/project.pbxproj @@ -0,0 +1,411 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 1ECE48BE2895BBA600003C83 /* AirDropApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECE48BD2895BBA600003C83 /* AirDropApp.swift */; }; + 1ECE48C02895BBA600003C83 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECE48BF2895BBA600003C83 /* ContentView.swift */; }; + 1ECE48C22895BBA900003C83 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1ECE48C12895BBA900003C83 /* Assets.xcassets */; }; + 1ECE48C62895BBA900003C83 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1ECE48C52895BBA900003C83 /* Preview Assets.xcassets */; }; + 1ECE48CF2895D10B00003C83 /* AirDropAvatarViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECE48CE2895D10B00003C83 /* AirDropAvatarViewModel.swift */; }; + 1ECE48D52895F10D00003C83 /* Task+sleep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECE48D42895F10D00003C83 /* Task+sleep.swift */; }; + 1ECE48DB2895FCE000003C83 /* RingProgressViewStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECE48DA2895FCE000003C83 /* RingProgressViewStyle.swift */; }; + 1ECE48DD2896049700003C83 /* AirDropAvatar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECE48DC2896049700003C83 /* AirDropAvatar.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1ECE48BA2895BBA600003C83 /* AirDrop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AirDrop.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1ECE48BD2895BBA600003C83 /* AirDropApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDropApp.swift; sourceTree = ""; }; + 1ECE48BF2895BBA600003C83 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 1ECE48C12895BBA900003C83 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 1ECE48C32895BBA900003C83 /* AirDrop.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AirDrop.entitlements; sourceTree = ""; }; + 1ECE48C52895BBA900003C83 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 1ECE48CE2895D10B00003C83 /* AirDropAvatarViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDropAvatarViewModel.swift; sourceTree = ""; }; + 1ECE48D42895F10D00003C83 /* Task+sleep.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Task+sleep.swift"; sourceTree = ""; }; + 1ECE48DA2895FCE000003C83 /* RingProgressViewStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RingProgressViewStyle.swift; sourceTree = ""; }; + 1ECE48DC2896049700003C83 /* AirDropAvatar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDropAvatar.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1ECE48B72895BBA600003C83 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1E09BFAF28979FAB00C4F88B /* Styles */ = { + isa = PBXGroup; + children = ( + 1ECE48DA2895FCE000003C83 /* RingProgressViewStyle.swift */, + ); + path = Styles; + sourceTree = ""; + }; + 1ECE48B12895BBA600003C83 = { + isa = PBXGroup; + children = ( + 1ECE48BC2895BBA600003C83 /* AirDrop */, + 1ECE48BB2895BBA600003C83 /* Products */, + ); + sourceTree = ""; + }; + 1ECE48BB2895BBA600003C83 /* Products */ = { + isa = PBXGroup; + children = ( + 1ECE48BA2895BBA600003C83 /* AirDrop.app */, + ); + name = Products; + sourceTree = ""; + }; + 1ECE48BC2895BBA600003C83 /* AirDrop */ = { + isa = PBXGroup; + children = ( + 1ECE48C32895BBA900003C83 /* AirDrop.entitlements */, + 1ECE48BD2895BBA600003C83 /* AirDropApp.swift */, + 1ECE48C12895BBA900003C83 /* Assets.xcassets */, + 1ECE48BF2895BBA600003C83 /* ContentView.swift */, + 1ECE48C42895BBA900003C83 /* Preview Content */, + 1ECE48D22895F0ED00003C83 /* Utilities */, + ); + path = AirDrop; + sourceTree = ""; + }; + 1ECE48C42895BBA900003C83 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 1ECE48C52895BBA900003C83 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 1ECE48D22895F0ED00003C83 /* Utilities */ = { + isa = PBXGroup; + children = ( + 1ECE48D32895F0F400003C83 /* Extensions */, + 1ECE48D72895F7E500003C83 /* Models */, + 1E09BFAF28979FAB00C4F88B /* Styles */, + 1ECE48D62895F3FE00003C83 /* Views */, + ); + path = Utilities; + sourceTree = ""; + }; + 1ECE48D32895F0F400003C83 /* Extensions */ = { + isa = PBXGroup; + children = ( + 1ECE48D42895F10D00003C83 /* Task+sleep.swift */, + ); + path = Extensions; + sourceTree = ""; + }; + 1ECE48D62895F3FE00003C83 /* Views */ = { + isa = PBXGroup; + children = ( + 1ECE48DC2896049700003C83 /* AirDropAvatar.swift */, + ); + path = Views; + sourceTree = ""; + }; + 1ECE48D72895F7E500003C83 /* Models */ = { + isa = PBXGroup; + children = ( + 1ECE48CE2895D10B00003C83 /* AirDropAvatarViewModel.swift */, + ); + path = Models; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1ECE48B92895BBA600003C83 /* AirDrop */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1ECE48C92895BBA900003C83 /* Build configuration list for PBXNativeTarget "AirDrop" */; + buildPhases = ( + 1ECE48B62895BBA600003C83 /* Sources */, + 1ECE48B72895BBA600003C83 /* Frameworks */, + 1ECE48B82895BBA600003C83 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AirDrop; + productName = AirDrop; + productReference = 1ECE48BA2895BBA600003C83 /* AirDrop.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 1ECE48B22895BBA600003C83 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1400; + LastUpgradeCheck = 1400; + TargetAttributes = { + 1ECE48B92895BBA600003C83 = { + CreatedOnToolsVersion = 14.0; + }; + }; + }; + buildConfigurationList = 1ECE48B52895BBA600003C83 /* Build configuration list for PBXProject "AirDrop" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 1ECE48B12895BBA600003C83; + productRefGroup = 1ECE48BB2895BBA600003C83 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1ECE48B92895BBA600003C83 /* AirDrop */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1ECE48B82895BBA600003C83 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1ECE48C62895BBA900003C83 /* Preview Assets.xcassets in Resources */, + 1ECE48C22895BBA900003C83 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1ECE48B62895BBA600003C83 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1ECE48DD2896049700003C83 /* AirDropAvatar.swift in Sources */, + 1ECE48D52895F10D00003C83 /* Task+sleep.swift in Sources */, + 1ECE48C02895BBA600003C83 /* ContentView.swift in Sources */, + 1ECE48BE2895BBA600003C83 /* AirDropApp.swift in Sources */, + 1ECE48DB2895FCE000003C83 /* RingProgressViewStyle.swift in Sources */, + 1ECE48CF2895D10B00003C83 /* AirDropAvatarViewModel.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1ECE48C72895BBA900003C83 /* 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++20"; + 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; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 1ECE48C82895BBA900003C83 /* 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++20"; + 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; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 1ECE48CA2895BBA900003C83 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = AirDrop/AirDrop.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"AirDrop/Preview Content\""; + DEVELOPMENT_TEAM = P2XQ53GW66; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 13.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.simalary.AirDrop; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 1ECE48CB2895BBA900003C83 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = AirDrop/AirDrop.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"AirDrop/Preview Content\""; + DEVELOPMENT_TEAM = P2XQ53GW66; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 13.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.simalary.AirDrop; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1ECE48B52895BBA600003C83 /* Build configuration list for PBXProject "AirDrop" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1ECE48C72895BBA900003C83 /* Debug */, + 1ECE48C82895BBA900003C83 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1ECE48C92895BBA900003C83 /* Build configuration list for PBXNativeTarget "AirDrop" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1ECE48CA2895BBA900003C83 /* Debug */, + 1ECE48CB2895BBA900003C83 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 1ECE48B22895BBA600003C83 /* Project object */; +} diff --git a/chrisharper22/AirDrop/AirDrop.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/chrisharper22/AirDrop/AirDrop.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/chrisharper22/AirDrop/AirDrop.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/chrisharper22/AirDrop/AirDrop.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/chrisharper22/AirDrop/AirDrop/AirDrop.entitlements b/chrisharper22/AirDrop/AirDrop/AirDrop.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/AirDrop.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/chrisharper22/AirDrop/AirDrop/AirDropApp.swift b/chrisharper22/AirDrop/AirDrop/AirDropApp.swift new file mode 100644 index 0000000..b9dbe31 --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/AirDropApp.swift @@ -0,0 +1,17 @@ +// +// AirDropApp.swift +// AirDrop +// +// Created by Chris Harper on 7/30/22. +// + +import SwiftUI + +@main +struct AirDropApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/chrisharper22/AirDrop/AirDrop/Assets.xcassets/AccentColor.colorset/Contents.json b/chrisharper22/AirDrop/AirDrop/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/chrisharper22/AirDrop/AirDrop/Assets.xcassets/AppIcon.appiconset/Contents.json b/chrisharper22/AirDrop/AirDrop/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..532cd72 --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,63 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/chrisharper22/AirDrop/AirDrop/Assets.xcassets/Contents.json b/chrisharper22/AirDrop/AirDrop/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/chrisharper22/AirDrop/AirDrop/ContentView.swift b/chrisharper22/AirDrop/AirDrop/ContentView.swift new file mode 100644 index 0000000..133d2e2 --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/ContentView.swift @@ -0,0 +1,69 @@ +// +// ContentView.swift +// AirDrop +// +// Created by Chris Harper on 7/30/22. +// + +import SwiftUI + +struct ContentView: View { + @ObservedObject var viewModel = AirDropAvatarViewModel() + + var body: some View { + VStack(spacing: 20) { + Spacer() + AirDropAvatar(model: viewModel) + .frame(width: 225, height: 225) + textStack + Spacer() + actionButton + } + .padding() + .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) + .background { + Color(uiColor: .secondarySystemGroupedBackground) + .edgesIgnoringSafeArea(.all) + } + } + + var textStack: some View { + VStack { + Text("Colton Westfield") // some random name just because + Group { + if viewModel.state != .waiting { + Text(viewModel.stateText) + .opacity(viewModel.stateOpacity) + } else { + Text(viewModel.stateText) + .opacity(viewModel.stateOpacity) + .animation(viewModel.state == .waiting ? .easeInOut(duration: 0.75) : .none, value: viewModel.stateOpacity) + } + } + .onReceive(viewModel.timer) { _ in + viewModel.updateStateOpacity() + } + .foregroundColor(viewModel.stateColor) + } + .font(.title2) + } + + var actionButton: some View { + Button(role: viewModel.buttonRole) { + viewModel.buttonAction() + } label: { + Text(viewModel.buttonText) + .frame(width: 250) + } + .controlSize(.large) + .buttonStyle(.borderedProminent) + .disabled(viewModel.running) + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + .preferredColorScheme(.dark) + } +} diff --git a/chrisharper22/AirDrop/AirDrop/Preview Content/Preview Assets.xcassets/Contents.json b/chrisharper22/AirDrop/AirDrop/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/chrisharper22/AirDrop/AirDrop/Utilities/Extensions/Task+sleep.swift b/chrisharper22/AirDrop/AirDrop/Utilities/Extensions/Task+sleep.swift new file mode 100644 index 0000000..4b584bd --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/Utilities/Extensions/Task+sleep.swift @@ -0,0 +1,16 @@ +// +// Task+sleep.swift +// AirDrop +// +// Created by Chris Harper on 7/30/22. +// + +import Foundation + +public extension Task where Success == Never, Failure == Never { + ///Suspends the current task for at least the given duration in seconds. + static func sleep(seconds duration: Double) async throws { + let duration = UInt64(duration * 1_000_000_000) + try await Task.sleep(nanoseconds: duration) + } +} diff --git a/chrisharper22/AirDrop/AirDrop/Utilities/Models/AirDropAvatarViewModel.swift b/chrisharper22/AirDrop/AirDrop/Utilities/Models/AirDropAvatarViewModel.swift new file mode 100644 index 0000000..7a9c99a --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/Utilities/Models/AirDropAvatarViewModel.swift @@ -0,0 +1,148 @@ +// +// AirDropAvatarViewModel.swift +// AirDrop +// +// Created by Chris Harper on 7/30/22. +// + +import Combine +import SwiftUI + +/// The view model for a `AirDropAvatar`, +@MainActor class AirDropAvatarViewModel: ObservableObject { + /// The current state of AirDrop, as an ``AirDropState``. + @Published var state: AirDropState = .idle + /// The progress of AirDrop. + @Published var progress: Double = 0.0 + /// The opacity of the AirDrop progress indicator. + @Published var progressOpacity: Double = 0.0 + /// The opacity of the AirDrop state text. + @Published var stateOpacity: Double = 1.0 + /// The timer responsible for the flashing of the AirDrop state text when waiting. + @Published var timer = Timer.publish(every: 0.75, on: .main, in: .common).autoconnect() + + /// The possible states of AirDrop. + enum AirDropState { + /// An idle state. + case idle + /// A waiting state. + case waiting + /// A sending state in which data is being transferred. + case sending + /// A completed state where data transfer is complete. + case complete + } + + /// The text of an ``AirDropState``. + var stateText: String { + switch state { + case .idle: + return " " + case .waiting: + return "Waiting..." + case .sending: + return "Sending..." + case .complete: + return "Sent" + } + } + + /// A `Bool` indicating whether or not AirDrop is running. + var running: Bool { + switch state { + case .idle, .complete: + return false + case .waiting, .sending: + return true + } + } + + /// The text of the button as a result of the current ``AirDropState``. + var buttonText: String { + switch state { + case .idle: + return "Start" + case .waiting, .sending: + return "Running" + case .complete: + return "Reset" + } + } + + /// Set the state opacity according to the current A``AirDropState``. + func updateStateOpacity() { + switch state { + case .idle: + stateOpacity = 0 + case .waiting: + stateOpacity == 0 ? (stateOpacity = 1.0) : (stateOpacity = 0.0) + default: + stateOpacity = 1.0 + } + } + + /// The action of the button as a result of the current ``AirDropState``. + func buttonAction() { + switch state { + case .idle: + Task { await prepareAirDrop() } + case .complete: + resetAirDrop() + default: + fatalError("AvatarViewModel.buttonAction(): really, this shouldn't have happened.") + } + } + + /// The role of the button as a result of the current ``AirDropState``. + var buttonRole: ButtonRole? { + switch state { + case .idle, .waiting, .sending: + return .none + case .complete: + return .destructive + } + } + + /// The color of an ``AirDropState``. + var stateColor: Color { + switch state { + case .idle: + return .primary + case .waiting, .sending: + return .secondary + case .complete: + return .accentColor + } + } + + /// Resets properties to their defaults. + private func resetAirDrop() { + state = .idle + progressOpacity = 0.0 + progress = 0.0 + stateOpacity = 1.0 + } + + /// The first stage of the AirDrop animation. + private func prepareAirDrop() async { + state = .waiting + progressOpacity = 1.0 + await commenceAirDrop() + } + + /// The second stage of the AirDrop animation. + private func commenceAirDrop() async { + try? await Task.sleep(seconds: 5) + state = .sending + progress = 1.0 + await finishAirDrop() + } + + /// The third stage of the AirDrop animation. + private func finishAirDrop() async { + try? await Task.sleep(seconds: 3.25) + state = .complete + try? await Task.sleep(seconds: 1.25) + progressOpacity = 0.0 + } +} diff --git a/chrisharper22/AirDrop/AirDrop/Utilities/Styles/RingProgressViewStyle.swift b/chrisharper22/AirDrop/AirDrop/Utilities/Styles/RingProgressViewStyle.swift new file mode 100644 index 0000000..1486d03 --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/Utilities/Styles/RingProgressViewStyle.swift @@ -0,0 +1,70 @@ +// +// RingProgressViewStyle.swift +// AirDrop +// +// Created by Chris Harper on 7/30/22. +// + +import SwiftUI + +/// A progress view that visually indicates its progress using a ring shape. +/// +/// You can also use `ProgressViewStyle/ring` to construct this style. +public struct RingProgressViewStyle: ProgressViewStyle { + private let lineWidth: CGFloat? + private let strokeStyle: StrokeStyle? + + /// Creates a view representing the body of a progress view. + public func makeBody(configuration: Configuration) -> some View { + if lineWidth != nil { + ZStack { + Circle() + .stroke(Color(uiColor: .tertiaryLabel), lineWidth: lineWidth!) + configuration.label + Circle() + .trim(from: 0, to: configuration.fractionCompleted ?? 0) + .stroke(Color.accentColor, lineWidth: lineWidth!) + } + .rotationEffect(.degrees(-90)) + } + if strokeStyle != nil { + ZStack { + Circle() + .stroke(Color(uiColor: .tertiaryLabel), style: strokeStyle!) + configuration.label + Circle() + .trim(from: 0, to: configuration.fractionCompleted ?? 0) + .stroke(Color.accentColor, style: strokeStyle!) + + } + .rotationEffect(.degrees(-90)) + } + } + + /// Creates a ring-shaped rogress view style. + init(lineWidth: CGFloat = 10) { + self.lineWidth = lineWidth + self.strokeStyle = nil + } + + /// Creates a ring-shaped rogress view style + /// with the given stroke style. + init(_ strokeStyle: StrokeStyle) { + self.lineWidth = nil + self.strokeStyle = strokeStyle + } +} + +public extension ProgressViewStyle where Self == RingProgressViewStyle { + /// A progress view that visually indicates its progress using a ring + /// shape. + static func ring(lineWidth: CGFloat = 10) -> Self { + .init(lineWidth: lineWidth) + } + + /// A progress view that visually indicates its progress using a ring + /// shape using the given stroke style. + static func ring(_ strokeStyle: StrokeStyle) -> Self { + .init(strokeStyle) + } +} diff --git a/chrisharper22/AirDrop/AirDrop/Utilities/Views/AirDropAvatar.swift b/chrisharper22/AirDrop/AirDrop/Utilities/Views/AirDropAvatar.swift new file mode 100644 index 0000000..0a68434 --- /dev/null +++ b/chrisharper22/AirDrop/AirDrop/Utilities/Views/AirDropAvatar.swift @@ -0,0 +1,32 @@ +// +// AirDropAvatar.swift +// AirDrop +// +// Created by Chris Harper on 7/30/22. +// + +import SwiftUI + +struct AirDropAvatar: View { + @ObservedObject var viewModel: AirDropAvatarViewModel + let spacing: CGFloat? + var body: some View { + ZStack(alignment: .center) { + Image(systemName: "person.crop.circle.fill") + .resizable() + .aspectRatio(contentMode: .fit) + .foregroundColor(.secondary) + .padding(spacing ?? 10) + ProgressView(value: viewModel.progress) + .progressViewStyle(.ring()) + .opacity(viewModel.progressOpacity) + .animation(viewModel.state == .idle ? nil : .easeOut(duration: 3), value: viewModel.progress) + .animation(.easeOut, value: viewModel.progressOpacity) + } + } + + init(model: AirDropAvatarViewModel, spacing: CGFloat? = 10) { + self.viewModel = model + self.spacing = spacing + } +}