From 2b3a6fbbcae527ab9e4511276c0259bb03649cf5 Mon Sep 17 00:00:00 2001 From: insub Date: Mon, 2 Oct 2023 17:27:56 +0900 Subject: [PATCH] [Feat] Widget (#89) * [Feat] Widget * Merge branch 'develop' into Widget --- AsyncSwift.xcodeproj/project.pbxproj | 231 +++++++++++++++++- .../xcshareddata/swiftpm/Package.resolved | 27 ++ AsyncSwift/AsyncSwift.entitlements | 4 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 13 + .../Assets.xcassets/Contents.json | 6 + .../WidgetBackground.colorset/Contents.json | 11 + AsyncSwiftWidget/AsyncSwiftWidget.swift | 60 +++++ AsyncSwiftWidget/AsyncSwiftWidgetBundle.swift | 16 ++ .../AsyncSwiftWidgetEntryView.swift | 25 ++ AsyncSwiftWidget/Info.plist | 11 + AsyncSwiftWidgetExtension.entitlements | 10 + 12 files changed, 417 insertions(+), 8 deletions(-) create mode 100644 AsyncSwiftWidget/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 AsyncSwiftWidget/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 AsyncSwiftWidget/Assets.xcassets/Contents.json create mode 100644 AsyncSwiftWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json create mode 100644 AsyncSwiftWidget/AsyncSwiftWidget.swift create mode 100644 AsyncSwiftWidget/AsyncSwiftWidgetBundle.swift create mode 100644 AsyncSwiftWidget/AsyncSwiftWidgetEntryView.swift create mode 100644 AsyncSwiftWidget/Info.plist create mode 100644 AsyncSwiftWidgetExtension.entitlements diff --git a/AsyncSwift.xcodeproj/project.pbxproj b/AsyncSwift.xcodeproj/project.pbxproj index a893ce8..8cad136 100644 --- a/AsyncSwift.xcodeproj/project.pbxproj +++ b/AsyncSwift.xcodeproj/project.pbxproj @@ -55,9 +55,42 @@ E9171F0028D15426002FAF52 /* TicketingView+Observed.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9171EFF28D15426002FAF52 /* TicketingView+Observed.swift */; }; E94F92C728D2505100D9E759 /* Ticketing.swift in Sources */ = {isa = PBXBuildFile; fileRef = E94F92C628D2505100D9E759 /* Ticketing.swift */; }; E9E2A4D828CEC5680016AEFF /* WebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E2A4D728CEC5680016AEFF /* WebView.swift */; }; - FB1FB1A72ACA7B3A00FF62AC /* SDWebImageSwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = FB1FB1A62ACA7B3A00FF62AC /* SDWebImageSwiftUI */; }; + FBCCC4F32ACAB5BD00FFF26B /* SDWebImageSwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = FBCCC4F22ACAB5BD00FFF26B /* SDWebImageSwiftUI */; }; + FBF437072AC9562B00B22B05 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBF437062AC9562B00B22B05 /* WidgetKit.framework */; }; + FBF437092AC9562B00B22B05 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBF437082AC9562B00B22B05 /* SwiftUI.framework */; }; + FBF4370C2AC9562B00B22B05 /* AsyncSwiftWidgetBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBF4370B2AC9562B00B22B05 /* AsyncSwiftWidgetBundle.swift */; }; + FBF4370E2AC9562B00B22B05 /* AsyncSwiftWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBF4370D2AC9562B00B22B05 /* AsyncSwiftWidget.swift */; }; + FBF437102AC9562B00B22B05 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FBF4370F2AC9562B00B22B05 /* Assets.xcassets */; }; + FBF437142AC9562B00B22B05 /* AsyncSwiftWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = FBF437052AC9562B00B22B05 /* AsyncSwiftWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + FBF4371B2AC9588800B22B05 /* AsyncSwiftWidgetEntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBF437192AC9586700B22B05 /* AsyncSwiftWidgetEntryView.swift */; }; + FBF4371F2AC95C3200B22B05 /* SVGKit in Frameworks */ = {isa = PBXBuildFile; productRef = FBF4371E2AC95C3200B22B05 /* SVGKit */; }; + FBF437212AC95C5800B22B05 /* SVGKit in Frameworks */ = {isa = PBXBuildFile; productRef = FBF437202AC95C5800B22B05 /* SVGKit */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + FBF437122AC9562B00B22B05 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C68DE92A28C7685800CA4CC8 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FBF437042AC9562B00B22B05; + remoteInfo = AsyncSwiftWidgetExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + FBF437152AC9562C00B22B05 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + FBF437142AC9562B00B22B05 /* AsyncSwiftWidgetExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ B289943228CA69FF002B9F67 /* StampView+Observed.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StampView+Observed.swift"; sourceTree = ""; }; B2FC6F6228D309FF00D2ACBF /* Stamp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Stamp.swift; sourceTree = ""; }; @@ -105,6 +138,15 @@ E9171EFF28D15426002FAF52 /* TicketingView+Observed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TicketingView+Observed.swift"; sourceTree = ""; }; E94F92C628D2505100D9E759 /* Ticketing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Ticketing.swift; sourceTree = ""; }; E9E2A4D728CEC5680016AEFF /* WebView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebView.swift; sourceTree = ""; }; + FBF437052AC9562B00B22B05 /* AsyncSwiftWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = AsyncSwiftWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + FBF437062AC9562B00B22B05 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + FBF437082AC9562B00B22B05 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + FBF4370B2AC9562B00B22B05 /* AsyncSwiftWidgetBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncSwiftWidgetBundle.swift; sourceTree = ""; }; + FBF4370D2AC9562B00B22B05 /* AsyncSwiftWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncSwiftWidget.swift; sourceTree = ""; }; + FBF4370F2AC9562B00B22B05 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FBF437112AC9562B00B22B05 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FBF437192AC9586700B22B05 /* AsyncSwiftWidgetEntryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncSwiftWidgetEntryView.swift; sourceTree = ""; }; + FBF4371C2AC959A000B22B05 /* AsyncSwiftWidgetExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AsyncSwiftWidgetExtension.entitlements; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -112,7 +154,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - FB1FB1A72ACA7B3A00FF62AC /* SDWebImageSwiftUI in Frameworks */, + FBCCC4F32ACAB5BD00FFF26B /* SDWebImageSwiftUI in Frameworks */, + FBF4371F2AC95C3200B22B05 /* SVGKit in Frameworks */, C69C13B32913B08F00D9B47F /* FirebaseDatabase in Frameworks */, C69C13B52913B09500D9B47F /* FirebaseFirestore in Frameworks */, C68DE94728C76BC500CA4CC8 /* FirebaseMessaging in Frameworks */, @@ -121,13 +164,25 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FBF437022AC9562B00B22B05 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FBF437212AC95C5800B22B05 /* SVGKit in Frameworks */, + FBF437092AC9562B00B22B05 /* SwiftUI.framework in Frameworks */, + FBF437072AC9562B00B22B05 /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ C68DE92928C7685800CA4CC8 = { isa = PBXGroup; children = ( + FBF4371C2AC959A000B22B05 /* AsyncSwiftWidgetExtension.entitlements */, C68DE93428C7685800CA4CC8 /* AsyncSwift */, + FBF4370A2AC9562B00B22B05 /* AsyncSwiftWidget */, C68DE93328C7685800CA4CC8 /* Products */, C69C13B12913B08F00D9B47F /* Frameworks */, ); @@ -137,6 +192,7 @@ isa = PBXGroup; children = ( C68DE93228C7685800CA4CC8 /* AsyncSwift.app */, + FBF437052AC9562B00B22B05 /* AsyncSwiftWidgetExtension.appex */, ); name = Products; sourceTree = ""; @@ -206,6 +262,8 @@ C69C13B12913B08F00D9B47F /* Frameworks */ = { isa = PBXGroup; children = ( + FBF437062AC9562B00B22B05 /* WidgetKit.framework */, + FBF437082AC9562B00B22B05 /* SwiftUI.framework */, ); name = Frameworks; sourceTree = ""; @@ -264,6 +322,18 @@ path = Observed; sourceTree = ""; }; + FBF4370A2AC9562B00B22B05 /* AsyncSwiftWidget */ = { + isa = PBXGroup; + children = ( + FBF4370B2AC9562B00B22B05 /* AsyncSwiftWidgetBundle.swift */, + FBF4370D2AC9562B00B22B05 /* AsyncSwiftWidget.swift */, + FBF437192AC9586700B22B05 /* AsyncSwiftWidgetEntryView.swift */, + FBF4370F2AC9562B00B22B05 /* Assets.xcassets */, + FBF437112AC9562B00B22B05 /* Info.plist */, + ); + path = AsyncSwiftWidget; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -274,10 +344,12 @@ C68DE92E28C7685800CA4CC8 /* Sources */, C68DE92F28C7685800CA4CC8 /* Frameworks */, C68DE93028C7685800CA4CC8 /* Resources */, + FBF437152AC9562C00B22B05 /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + FBF437132AC9562B00B22B05 /* PBXTargetDependency */, ); name = AsyncSwift; packageProductDependencies = ( @@ -286,12 +358,33 @@ C69C13B22913B08F00D9B47F /* FirebaseDatabase */, C69C13B42913B09500D9B47F /* FirebaseFirestore */, C69C13C5291425F200D9B47F /* CodeScanner */, - FB1FB1A62ACA7B3A00FF62AC /* SDWebImageSwiftUI */, + FBF4371E2AC95C3200B22B05 /* SVGKit */, + FBCCC4F22ACAB5BD00FFF26B /* SDWebImageSwiftUI */, ); productName = AsyncSwift; productReference = C68DE93228C7685800CA4CC8 /* AsyncSwift.app */; productType = "com.apple.product-type.application"; }; + FBF437042AC9562B00B22B05 /* AsyncSwiftWidgetExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = FBF437182AC9562C00B22B05 /* Build configuration list for PBXNativeTarget "AsyncSwiftWidgetExtension" */; + buildPhases = ( + FBF437012AC9562B00B22B05 /* Sources */, + FBF437022AC9562B00B22B05 /* Frameworks */, + FBF437032AC9562B00B22B05 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AsyncSwiftWidgetExtension; + packageProductDependencies = ( + FBF437202AC95C5800B22B05 /* SVGKit */, + ); + productName = AsyncSwiftWidgetExtension; + productReference = FBF437052AC9562B00B22B05 /* AsyncSwiftWidgetExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -299,12 +392,15 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1340; + LastSwiftUpdateCheck = 1430; LastUpgradeCheck = 1340; TargetAttributes = { C68DE93128C7685800CA4CC8 = { CreatedOnToolsVersion = 13.4.1; }; + FBF437042AC9562B00B22B05 = { + CreatedOnToolsVersion = 14.3.1; + }; }; }; buildConfigurationList = C68DE92D28C7685800CA4CC8 /* Build configuration list for PBXProject "AsyncSwift" */; @@ -319,13 +415,15 @@ packageReferences = ( C68DE94328C76BC500CA4CC8 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, C69C13C4291425F200D9B47F /* XCRemoteSwiftPackageReference "CodeScanner" */, - FB1FB1A52ACA7B3A00FF62AC /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */, + FBF4371D2AC95C3200B22B05 /* XCRemoteSwiftPackageReference "SVGKit" */, + FBCCC4F12ACAB5BD00FFF26B /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */, ); productRefGroup = C68DE93328C7685800CA4CC8 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( C68DE93128C7685800CA4CC8 /* AsyncSwift */, + FBF437042AC9562B00B22B05 /* AsyncSwiftWidgetExtension */, ); }; /* End PBXProject section */ @@ -341,6 +439,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FBF437032AC9562B00B22B05 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FBF437102AC9562B00B22B05 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -391,8 +497,26 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FBF437012AC9562B00B22B05 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FBF4370E2AC9562B00B22B05 /* AsyncSwiftWidget.swift in Sources */, + FBF4370C2AC9562B00B22B05 /* AsyncSwiftWidgetBundle.swift in Sources */, + FBF4371B2AC9588800B22B05 /* AsyncSwiftWidgetEntryView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + FBF437132AC9562B00B22B05 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FBF437042AC9562B00B22B05 /* AsyncSwiftWidgetExtension */; + targetProxy = FBF437122AC9562B00B22B05 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ C68DE93E28C7685900CA4CC8 /* Debug */ = { isa = XCBuildConfiguration; @@ -511,6 +635,7 @@ C68DE94128C7685900CA4CC8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = AsyncSwift/AsyncSwift.entitlements; @@ -553,6 +678,7 @@ C68DE94228C7685900CA4CC8 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = AsyncSwift/AsyncSwift.entitlements; @@ -592,6 +718,68 @@ }; name = Release; }; + FBF437162AC9562C00B22B05 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_ENTITLEMENTS = AsyncSwiftWidgetExtension.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 76AJ433CP5; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AsyncSwiftWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AsyncSwiftWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kim.AsyncSwift.AsyncSwiftWidget; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Debug; + }; + FBF437172AC9562C00B22B05 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_ENTITLEMENTS = AsyncSwiftWidgetExtension.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 76AJ433CP5; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AsyncSwiftWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AsyncSwiftWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kim.AsyncSwift.AsyncSwiftWidget; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -613,6 +801,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + FBF437182AC9562C00B22B05 /* Build configuration list for PBXNativeTarget "AsyncSwiftWidgetExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FBF437162AC9562C00B22B05 /* Debug */, + FBF437172AC9562C00B22B05 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ @@ -632,7 +829,7 @@ minimumVersion = 2.0.0; }; }; - FB1FB1A52ACA7B3A00FF62AC /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */ = { + FBCCC4F12ACAB5BD00FFF26B /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SDWebImage/SDWebImageSwiftUI.git"; requirement = { @@ -640,6 +837,14 @@ minimumVersion = 2.0.0; }; }; + FBF4371D2AC95C3200B22B05 /* XCRemoteSwiftPackageReference "SVGKit" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SVGKit/SVGKit.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 3.0.0; + }; + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -668,11 +873,21 @@ package = C69C13C4291425F200D9B47F /* XCRemoteSwiftPackageReference "CodeScanner" */; productName = CodeScanner; }; - FB1FB1A62ACA7B3A00FF62AC /* SDWebImageSwiftUI */ = { + FBCCC4F22ACAB5BD00FFF26B /* SDWebImageSwiftUI */ = { isa = XCSwiftPackageProductDependency; - package = FB1FB1A52ACA7B3A00FF62AC /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */; + package = FBCCC4F12ACAB5BD00FFF26B /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */; productName = SDWebImageSwiftUI; }; + FBF4371E2AC95C3200B22B05 /* SVGKit */ = { + isa = XCSwiftPackageProductDependency; + package = FBF4371D2AC95C3200B22B05 /* XCRemoteSwiftPackageReference "SVGKit" */; + productName = SVGKit; + }; + FBF437202AC95C5800B22B05 /* SVGKit */ = { + isa = XCSwiftPackageProductDependency; + package = FBF4371D2AC95C3200B22B05 /* XCRemoteSwiftPackageReference "SVGKit" */; + productName = SVGKit; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = C68DE92A28C7685800CA4CC8 /* Project object */; diff --git a/AsyncSwift.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/AsyncSwift.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 00586fc..1ca5192 100644 --- a/AsyncSwift.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/AsyncSwift.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -18,6 +18,15 @@ "version" : "0.9.1" } }, + { + "identity" : "cocoalumberjack", + "kind" : "remoteSourceControl", + "location" : "https://github.com/CocoaLumberjack/CocoaLumberjack.git", + "state" : { + "revision" : "67ec5818a757aba4d7c534e21a905d878d128dbf", + "version" : "3.8.1" + } + }, { "identity" : "codescanner", "kind" : "remoteSourceControl", @@ -126,6 +135,24 @@ "version" : "2.2.3" } }, + { + "identity" : "svgkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SVGKit/SVGKit.git", + "state" : { + "revision" : "58152b9f7c85eab239160b36ffdfd364aa43d666", + "version" : "3.0.0" + } + }, + { + "identity" : "swift-log", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-log.git", + "state" : { + "revision" : "532d8b529501fb73a2455b179e0bbb6d49b652ed", + "version" : "1.5.3" + } + }, { "identity" : "swift-protobuf", "kind" : "remoteSourceControl", diff --git a/AsyncSwift/AsyncSwift.entitlements b/AsyncSwift/AsyncSwift.entitlements index 3575a32..9f562cf 100644 --- a/AsyncSwift/AsyncSwift.entitlements +++ b/AsyncSwift/AsyncSwift.entitlements @@ -8,5 +8,9 @@ applinks:asyncswift.info + com.apple.security.application-groups + + group.com.kim.AsyncSwift + diff --git a/AsyncSwiftWidget/Assets.xcassets/AccentColor.colorset/Contents.json b/AsyncSwiftWidget/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/AsyncSwiftWidget/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AsyncSwiftWidget/Assets.xcassets/AppIcon.appiconset/Contents.json b/AsyncSwiftWidget/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/AsyncSwiftWidget/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AsyncSwiftWidget/Assets.xcassets/Contents.json b/AsyncSwiftWidget/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/AsyncSwiftWidget/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AsyncSwiftWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json b/AsyncSwiftWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/AsyncSwiftWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AsyncSwiftWidget/AsyncSwiftWidget.swift b/AsyncSwiftWidget/AsyncSwiftWidget.swift new file mode 100644 index 0000000..f164114 --- /dev/null +++ b/AsyncSwiftWidget/AsyncSwiftWidget.swift @@ -0,0 +1,60 @@ +// +// AsyncSwiftWidget.swift +// AsyncSwiftWidget +// +// Created by 김인섭 on 2023/10/01. +// + +import WidgetKit +import SwiftUI + +struct Provider: TimelineProvider { + func placeholder(in context: Context) -> SimpleEntry { + SimpleEntry(date: Date(), imageData: getRemoteImage()) + } + + func getSnapshot(in context: Context, completion: @escaping (SimpleEntry) -> ()) { + let entry = SimpleEntry(date: Date(), imageData: getRemoteImage()) + completion(entry) + } + + func getTimeline(in context: Context, completion: @escaping (Timeline) -> ()) { + + let entry = SimpleEntry(date: Date(), imageData: getRemoteImage()) + let nextUpdate = Calendar.current.date(byAdding: .minute, value: 15, to: Date()) + let timeline = Timeline(entries: [entry], policy: .after(nextUpdate!)) + completion(timeline) + } + + func getRemoteImage() -> Data? { + let urlString = "https://raw.githubusercontent.com/Async-Swift/jsonstorage/a94eb982e9b9db90543de1d574a6dc5f0c637f5b/Images/widget-large.svg" + return try? Data(contentsOf: URL(string: urlString)!) + } +} + +struct SimpleEntry: TimelineEntry { + var date: Date + let imageData: Data? +} + +struct AsyncSwiftWidget: Widget { + let kind: String = "AsyncSwiftWidget" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, provider: Provider()) { entry in + AsyncSwiftWidgetEntryView(entry: entry) + } + .configurationDisplayName("AsyncSwift") + .description("행사 정보를 확인하세요.") + .supportedFamilies( + [.systemLarge] + ) + } +} + +struct AsyncSwiftWidget_Previews: PreviewProvider { + static var previews: some View { + AsyncSwiftWidgetEntryView(entry: SimpleEntry(date: Date(), imageData: nil)) + .previewContext(WidgetPreviewContext(family: .systemSmall)) + } +} diff --git a/AsyncSwiftWidget/AsyncSwiftWidgetBundle.swift b/AsyncSwiftWidget/AsyncSwiftWidgetBundle.swift new file mode 100644 index 0000000..5b8cf8d --- /dev/null +++ b/AsyncSwiftWidget/AsyncSwiftWidgetBundle.swift @@ -0,0 +1,16 @@ +// +// AsyncSwiftWidgetBundle.swift +// AsyncSwiftWidget +// +// Created by 김인섭 on 2023/10/01. +// + +import WidgetKit +import SwiftUI + +@main +struct AsyncSwiftWidgetBundle: WidgetBundle { + var body: some Widget { + AsyncSwiftWidget() + } +} diff --git a/AsyncSwiftWidget/AsyncSwiftWidgetEntryView.swift b/AsyncSwiftWidget/AsyncSwiftWidgetEntryView.swift new file mode 100644 index 0000000..b98cb7d --- /dev/null +++ b/AsyncSwiftWidget/AsyncSwiftWidgetEntryView.swift @@ -0,0 +1,25 @@ +// +// AsyncSwiftWidgetEntryView.swift +// AsyncSwift +// +// Created by 김인섭 on 2023/10/01. +// + +import SwiftUI +import WidgetKit +import SVGKit + +struct AsyncSwiftWidgetEntryView : View { + var entry: Provider.Entry + + var body: some View { + if let imageData = entry.imageData, let image = SVGKImage(data: imageData) { + Image(uiImage: image.uiImage) + .resizable() + .scaledToFill() + .offset(y: 10) + } else { + Text("다음 행사때 만나요. 🤗") + } + } +} diff --git a/AsyncSwiftWidget/Info.plist b/AsyncSwiftWidget/Info.plist new file mode 100644 index 0000000..0f118fb --- /dev/null +++ b/AsyncSwiftWidget/Info.plist @@ -0,0 +1,11 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/AsyncSwiftWidgetExtension.entitlements b/AsyncSwiftWidgetExtension.entitlements new file mode 100644 index 0000000..04d5f4c --- /dev/null +++ b/AsyncSwiftWidgetExtension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.com.kim.AsyncSwift + + +