diff --git a/IntentsExtension/Info.plist b/IntentsExtension/Info.plist new file mode 100644 index 00000000..3fd27e58 --- /dev/null +++ b/IntentsExtension/Info.plist @@ -0,0 +1,24 @@ + + + + + NSExtension + + NSExtensionAttributes + + IntentsRestrictedWhileLocked + + IntentsRestrictedWhileProtectedDataUnavailable + + IntentsSupported + + MyCardIntent + + + NSExtensionPointIdentifier + com.apple.intents-service + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).IntentHandler + + + diff --git a/IntentsExtension/IntentHandler.swift b/IntentsExtension/IntentHandler.swift new file mode 100644 index 00000000..542cb467 --- /dev/null +++ b/IntentsExtension/IntentHandler.swift @@ -0,0 +1,19 @@ +// +// IntentHandler.swift +// IntentsExtension +// +// Created by kimhyungyu on 2023/02/05. +// + +import Intents + +class IntentHandler: INExtension { + + override func handler(for intent: INIntent) -> Any { + // This is the default implementation. If you want different objects to handle different intents, + // you can override this and return the handler you want for that particular intent. + + return self + } + +} diff --git a/IntentsExtensionUI/Base.lproj/MainInterface.storyboard b/IntentsExtensionUI/Base.lproj/MainInterface.storyboard new file mode 100644 index 00000000..e6c64fcf --- /dev/null +++ b/IntentsExtensionUI/Base.lproj/MainInterface.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IntentsExtensionUI/Info.plist b/IntentsExtensionUI/Info.plist new file mode 100644 index 00000000..2fcb578d --- /dev/null +++ b/IntentsExtensionUI/Info.plist @@ -0,0 +1,21 @@ + + + + + NSExtension + + NSExtensionAttributes + + IntentsSupported + + INSendMessageIntent + MyCardIntent + + + NSExtensionMainStoryboard + MainInterface + NSExtensionPointIdentifier + com.apple.intents-ui-service + + + diff --git a/IntentsExtensionUI/IntentViewController.swift b/IntentsExtensionUI/IntentViewController.swift new file mode 100644 index 00000000..86d2b872 --- /dev/null +++ b/IntentsExtensionUI/IntentViewController.swift @@ -0,0 +1,36 @@ +// +// IntentViewController.swift +// IntentsExtensionUI +// +// Created by kimhyungyu on 2023/02/05. +// + +import IntentsUI + +// As an example, this extension's Info.plist has been configured to handle interactions for INSendMessageIntent. +// You will want to replace this or add other intents as appropriate. +// The intents whose interactions you wish to handle must be declared in the extension's Info.plist. + +// You can test this example integration by saying things to Siri like: +// "Send a message using " + +class IntentViewController: UIViewController, INUIHostedViewControlling { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + // MARK: - INUIHostedViewControlling + + // Prepare your view controller for the interaction to handle. + func configureView(for parameters: Set, of interaction: INInteraction, interactiveBehavior: INUIInteractiveBehavior, context: INUIHostedViewContext, completion: @escaping (Bool, Set, CGSize) -> Void) { + // Do configuration here, including preparing views and calculating a desired size for presentation. + completion(true, parameters, self.desiredSize) + } + + var desiredSize: CGSize { + return self.extensionContext!.hostedViewMaximumAllowedSize + } + +} diff --git a/NADA-iOS-forRelease.xcodeproj/project.pbxproj b/NADA-iOS-forRelease.xcodeproj/project.pbxproj index 52f97224..860aace6 100644 --- a/NADA-iOS-forRelease.xcodeproj/project.pbxproj +++ b/NADA-iOS-forRelease.xcodeproj/project.pbxproj @@ -94,6 +94,8 @@ 77F2C0ED27632AA7007641E3 /* CardHarmony.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 77F2C0EC27632AA7007641E3 /* CardHarmony.storyboard */; }; 77F47D93276C79B600414659 /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77F47D92276C79B600414659 /* Header.swift */; }; DBBB91E1639641F40C5B4416 /* Pods_NADA_iOS_forRelease.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A2183AE0E469153221624A0 /* Pods_NADA_iOS_forRelease.framework */; }; + F80975E92990A27400075B93 /* Widgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = F838B66A298E5C5300D84340 /* Widgets.intentdefinition */; }; + F80975EA2990A27900075B93 /* Widgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = F838B66A298E5C5300D84340 /* Widgets.intentdefinition */; }; F811720027383097002742CF /* ChangeGroupRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F81171FF27383097002742CF /* ChangeGroupRequest.swift */; }; F822E7A92709CEB60020452C /* Notification.swift in Sources */ = {isa = PBXBuildFile; fileRef = F822E7A82709CEB60020452C /* Notification.swift */; }; F8268DB927730B0100BF114B /* FirstCardAlertBottomSheetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8268DB827730B0100BF114B /* FirstCardAlertBottomSheetViewController.swift */; }; @@ -105,6 +107,13 @@ F83206AA26F61E3700D61711 /* FrontCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F83206A826F61E3700D61711 /* FrontCardCell.swift */; }; F83206AB26F61E3700D61711 /* FrontCardCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F83206A926F61E3700D61711 /* FrontCardCell.xib */; }; F835EF6F29800F51001ABAAF /* UIApplication+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F835EF6E29800F51001ABAAF /* UIApplication+Extension.swift */; }; + F838B660298E5C5300D84340 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F838B65F298E5C5300D84340 /* WidgetKit.framework */; }; + F838B662298E5C5300D84340 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F838B661298E5C5300D84340 /* SwiftUI.framework */; }; + F838B667298E5C5300D84340 /* WidgetsLiveActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = F838B666298E5C5300D84340 /* WidgetsLiveActivity.swift */; }; + F838B66C298E5C5400D84340 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F838B66B298E5C5400D84340 /* Assets.xcassets */; }; + F838B66E298E5C5400D84340 /* Widgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = F838B66A298E5C5300D84340 /* Widgets.intentdefinition */; }; + F838B66F298E5C5400D84340 /* Widgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = F838B66A298E5C5300D84340 /* Widgets.intentdefinition */; }; + F838B672298E5C5400D84340 /* WidgetsExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = F838B65E298E5C5300D84340 /* WidgetsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; F84BAF9D26FDB417004CA335 /* CardCreationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F84BAF9C26FDB417004CA335 /* CardCreationViewController.swift */; }; F84BAFAD26FDB543004CA335 /* FrontCardCreationCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F84BAFAB26FDB543004CA335 /* FrontCardCreationCollectionViewCell.swift */; }; F84BAFAE26FDB543004CA335 /* FrontCardCreationCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F84BAFAC26FDB543004CA335 /* FrontCardCreationCollectionViewCell.xib */; }; @@ -123,10 +132,22 @@ F87122762733046300A24E74 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = F87122752733046300A24E74 /* Card.swift */; }; F871227827330A3800A24E74 /* CardCreationRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F871227727330A3800A24E74 /* CardCreationRequest.swift */; }; F8719DDB274F92E90081AD51 /* UITextField+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8719DDA274F92E90081AD51 /* UITextField+Extension.swift */; }; + F87D222A298ECAFB001A882B /* Intents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F87D2229298ECAFB001A882B /* Intents.framework */; }; + F87D222D298ECAFB001A882B /* IntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F87D222C298ECAFB001A882B /* IntentHandler.swift */; }; + F87D2235298ECAFB001A882B /* IntentsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F87D2234298ECAFB001A882B /* IntentsUI.framework */; }; + F87D2238298ECAFB001A882B /* IntentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F87D2237298ECAFB001A882B /* IntentViewController.swift */; }; + F87D223B298ECAFB001A882B /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F87D2239298ECAFB001A882B /* MainInterface.storyboard */; }; + F87D223F298ECAFB001A882B /* IntentsExtensionUI.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = F87D2233298ECAFB001A882B /* IntentsExtensionUI.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + F87D2242298ECAFB001A882B /* IntentsExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = F87D2228298ECAFB001A882B /* IntentsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; F88101F92987CBAF007266B5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = F88101F82987CBAF007266B5 /* GoogleService-Info.plist */; }; F8915A22275728F20013D609 /* SelectBirthBottomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8915A20275728F20013D609 /* SelectBirthBottomViewController.swift */; }; F8915A23275728F20013D609 /* SelectMBTIBottomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8915A21275728F20013D609 /* SelectMBTIBottomViewController.swift */; }; F8A9FE1A2743DC6B00BC60CE /* CardListInGroupRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8A9FE192743DC6B00BC60CE /* CardListInGroupRequest.swift */; }; + F8BCDD22298FFA830044D0B4 /* QRCodeWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8BCDD21298FFA830044D0B4 /* QRCodeWidget.swift */; }; + F8BCDD24298FFA940044D0B4 /* OpenAppLockScreenWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8BCDD23298FFA940044D0B4 /* OpenAppLockScreenWidget.swift */; }; + F8BCDD25298FFAF90044D0B4 /* WidgetsBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F838B664298E5C5300D84340 /* WidgetsBundle.swift */; }; + F8BCDD26298FFB0B0044D0B4 /* MyCardWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F838B668298E5C5300D84340 /* MyCardWidget.swift */; }; + F8BCDD27298FFB280044D0B4 /* Color+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F87D2222298EA616001A882B /* Color+Extension.swift */; }; F8C310C0273A7360008EC5BA /* FrontCardCreationDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C310BF273A7360008EC5BA /* FrontCardCreationDelegate.swift */; }; F8C83FAE272F99940009DF0D /* MoyaLoggerPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C83FAD272F99940009DF0D /* MoyaLoggerPlugin.swift */; }; F8C83FB6272F9E380009DF0D /* UtilService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C83FB5272F9E380009DF0D /* UtilService.swift */; }; @@ -153,6 +174,46 @@ F8FC43BF26C025180033E151 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = F8FC43BE26C025180033E151 /* .swiftlint.yml */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + F838B670298E5C5400D84340 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F8FC437A26C01CDD0033E151 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F838B65D298E5C5300D84340; + remoteInfo = WidgetsExtension; + }; + F87D223D298ECAFB001A882B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F8FC437A26C01CDD0033E151 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F87D2232298ECAFB001A882B; + remoteInfo = IntentsExtensionUI; + }; + F87D2240298ECAFB001A882B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F8FC437A26C01CDD0033E151 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F87D2227298ECAFB001A882B; + remoteInfo = IntentsExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + F838B673298E5C5400D84340 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + F87D223F298ECAFB001A882B /* IntentsExtensionUI.appex in Embed Foundation Extensions */, + F87D2242298ECAFB001A882B /* IntentsExtension.appex in Embed Foundation Extensions */, + F838B672298E5C5400D84340 /* WidgetsExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 1E770167DDA25A2CE063AA5C /* Pods-NADA-iOS-forRelease.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NADA-iOS-forRelease.release.xcconfig"; path = "Target Support Files/Pods-NADA-iOS-forRelease/Pods-NADA-iOS-forRelease.release.xcconfig"; sourceTree = ""; }; 39007F2B27080D8200E7143E /* UIViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extension.swift"; sourceTree = ""; }; @@ -255,6 +316,15 @@ F83206A826F61E3700D61711 /* FrontCardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrontCardCell.swift; sourceTree = ""; }; F83206A926F61E3700D61711 /* FrontCardCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FrontCardCell.xib; sourceTree = ""; }; F835EF6E29800F51001ABAAF /* UIApplication+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+Extension.swift"; sourceTree = ""; }; + F838B65E298E5C5300D84340 /* WidgetsExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = WidgetsExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + F838B65F298E5C5300D84340 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + F838B661298E5C5300D84340 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + F838B664298E5C5300D84340 /* WidgetsBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetsBundle.swift; sourceTree = ""; }; + F838B666298E5C5300D84340 /* WidgetsLiveActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetsLiveActivity.swift; sourceTree = ""; }; + F838B668298E5C5300D84340 /* MyCardWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCardWidget.swift; sourceTree = ""; }; + F838B66A298E5C5300D84340 /* Widgets.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = Widgets.intentdefinition; sourceTree = ""; }; + F838B66B298E5C5400D84340 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + F838B66D298E5C5400D84340 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F84BAF9C26FDB417004CA335 /* CardCreationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardCreationViewController.swift; sourceTree = ""; }; F84BAFAB26FDB543004CA335 /* FrontCardCreationCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrontCardCreationCollectionViewCell.swift; sourceTree = ""; }; F84BAFAC26FDB543004CA335 /* FrontCardCreationCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FrontCardCreationCollectionViewCell.xib; sourceTree = ""; }; @@ -273,10 +343,22 @@ F87122752733046300A24E74 /* Card.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Card.swift; sourceTree = ""; }; F871227727330A3800A24E74 /* CardCreationRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardCreationRequest.swift; sourceTree = ""; }; F8719DDA274F92E90081AD51 /* UITextField+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Extension.swift"; sourceTree = ""; }; + F87D2222298EA616001A882B /* Color+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Extension.swift"; sourceTree = ""; }; + F87D2228298ECAFB001A882B /* IntentsExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = IntentsExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + F87D2229298ECAFB001A882B /* Intents.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Intents.framework; path = System/Library/Frameworks/Intents.framework; sourceTree = SDKROOT; }; + F87D222C298ECAFB001A882B /* IntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntentHandler.swift; sourceTree = ""; }; + F87D222E298ECAFB001A882B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F87D2233298ECAFB001A882B /* IntentsExtensionUI.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = IntentsExtensionUI.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + F87D2234298ECAFB001A882B /* IntentsUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IntentsUI.framework; path = System/Library/Frameworks/IntentsUI.framework; sourceTree = SDKROOT; }; + F87D2237298ECAFB001A882B /* IntentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntentViewController.swift; sourceTree = ""; }; + F87D223A298ECAFB001A882B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; + F87D223C298ECAFB001A882B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F88101F82987CBAF007266B5 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; F8915A20275728F20013D609 /* SelectBirthBottomViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectBirthBottomViewController.swift; sourceTree = ""; }; F8915A21275728F20013D609 /* SelectMBTIBottomViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectMBTIBottomViewController.swift; sourceTree = ""; }; F8A9FE192743DC6B00BC60CE /* CardListInGroupRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CardListInGroupRequest.swift; sourceTree = ""; }; + F8BCDD21298FFA830044D0B4 /* QRCodeWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCodeWidget.swift; sourceTree = ""; }; + F8BCDD23298FFA940044D0B4 /* OpenAppLockScreenWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenAppLockScreenWidget.swift; sourceTree = ""; }; F8C310BF273A7360008EC5BA /* FrontCardCreationDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrontCardCreationDelegate.swift; sourceTree = ""; }; F8C83FAD272F99940009DF0D /* MoyaLoggerPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoyaLoggerPlugin.swift; sourceTree = ""; }; F8C83FB5272F9E380009DF0D /* UtilService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UtilService.swift; sourceTree = ""; }; @@ -306,6 +388,31 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + F838B65B298E5C5300D84340 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F838B662298E5C5300D84340 /* SwiftUI.framework in Frameworks */, + F838B660298E5C5300D84340 /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F87D2225298ECAFB001A882B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F87D222A298ECAFB001A882B /* Intents.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F87D2230298ECAFB001A882B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F87D2235298ECAFB001A882B /* IntentsUI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F8FC437F26C01CDD0033E151 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -543,6 +650,10 @@ isa = PBXGroup; children = ( 4A2183AE0E469153221624A0 /* Pods_NADA_iOS_forRelease.framework */, + F838B65F298E5C5300D84340 /* WidgetKit.framework */, + F838B661298E5C5300D84340 /* SwiftUI.framework */, + F87D2229298ECAFB001A882B /* Intents.framework */, + F87D2234298ECAFB001A882B /* IntentsUI.framework */, ); name = Frameworks; sourceTree = ""; @@ -622,6 +733,15 @@ path = CardCell; sourceTree = ""; }; + F838B663298E5C5300D84340 /* Widgets */ = { + isa = PBXGroup; + children = ( + F87D2220298EA5E5001A882B /* Resource */, + F87D2249298ECBEA001A882B /* WidgetsBundle */, + ); + path = Widgets; + sourceTree = ""; + }; F84BAF9E26FDB425004CA335 /* CardCreation */ = { isa = PBXGroup; children = ( @@ -716,6 +836,56 @@ path = Card; sourceTree = ""; }; + F87D2220298EA5E5001A882B /* Resource */ = { + isa = PBXGroup; + children = ( + F838B66D298E5C5400D84340 /* Info.plist */, + F838B66B298E5C5400D84340 /* Assets.xcassets */, + F838B66A298E5C5300D84340 /* Widgets.intentdefinition */, + F87D2221298EA606001A882B /* Extension */, + ); + path = Resource; + sourceTree = ""; + }; + F87D2221298EA606001A882B /* Extension */ = { + isa = PBXGroup; + children = ( + F87D2222298EA616001A882B /* Color+Extension.swift */, + ); + path = Extension; + sourceTree = ""; + }; + F87D222B298ECAFB001A882B /* IntentsExtension */ = { + isa = PBXGroup; + children = ( + F87D222C298ECAFB001A882B /* IntentHandler.swift */, + F87D222E298ECAFB001A882B /* Info.plist */, + ); + path = IntentsExtension; + sourceTree = ""; + }; + F87D2236298ECAFB001A882B /* IntentsExtensionUI */ = { + isa = PBXGroup; + children = ( + F87D2237298ECAFB001A882B /* IntentViewController.swift */, + F87D2239298ECAFB001A882B /* MainInterface.storyboard */, + F87D223C298ECAFB001A882B /* Info.plist */, + ); + path = IntentsExtensionUI; + sourceTree = ""; + }; + F87D2249298ECBEA001A882B /* WidgetsBundle */ = { + isa = PBXGroup; + children = ( + F838B664298E5C5300D84340 /* WidgetsBundle.swift */, + F838B668298E5C5300D84340 /* MyCardWidget.swift */, + F8BCDD21298FFA830044D0B4 /* QRCodeWidget.swift */, + F8BCDD23298FFA940044D0B4 /* OpenAppLockScreenWidget.swift */, + F838B666298E5C5300D84340 /* WidgetsLiveActivity.swift */, + ); + path = WidgetsBundle; + sourceTree = ""; + }; F8915A1F275713A10013D609 /* CardCreation */ = { isa = PBXGroup; children = ( @@ -788,6 +958,9 @@ children = ( F8FC43BE26C025180033E151 /* .swiftlint.yml */, F8FC438426C01CDD0033E151 /* NADA-iOS-forRelease */, + F838B663298E5C5300D84340 /* Widgets */, + F87D222B298ECAFB001A882B /* IntentsExtension */, + F87D2236298ECAFB001A882B /* IntentsExtensionUI */, F8FC438326C01CDD0033E151 /* Products */, 186051B2C99DBAECC539DAC9 /* Pods */, 4D28D444572353D68574D2B0 /* Frameworks */, @@ -798,6 +971,9 @@ isa = PBXGroup; children = ( F8FC438226C01CDD0033E151 /* NADA-iOS-forRelease.app */, + F838B65E298E5C5300D84340 /* WidgetsExtension.appex */, + F87D2228298ECAFB001A882B /* IntentsExtension.appex */, + F87D2233298ECAFB001A882B /* IntentsExtensionUI.appex */, ); name = Products; sourceTree = ""; @@ -971,6 +1147,57 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + F838B65D298E5C5300D84340 /* WidgetsExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = F838B676298E5C5400D84340 /* Build configuration list for PBXNativeTarget "WidgetsExtension" */; + buildPhases = ( + F838B65A298E5C5300D84340 /* Sources */, + F838B65B298E5C5300D84340 /* Frameworks */, + F838B65C298E5C5300D84340 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WidgetsExtension; + productName = WidgetsExtension; + productReference = F838B65E298E5C5300D84340 /* WidgetsExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; + F87D2227298ECAFB001A882B /* IntentsExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = F87D2246298ECAFB001A882B /* Build configuration list for PBXNativeTarget "IntentsExtension" */; + buildPhases = ( + F87D2224298ECAFB001A882B /* Sources */, + F87D2225298ECAFB001A882B /* Frameworks */, + F87D2226298ECAFB001A882B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = IntentsExtension; + productName = IntentsExtension; + productReference = F87D2228298ECAFB001A882B /* IntentsExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; + F87D2232298ECAFB001A882B /* IntentsExtensionUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = F87D2243298ECAFB001A882B /* Build configuration list for PBXNativeTarget "IntentsExtensionUI" */; + buildPhases = ( + F87D222F298ECAFB001A882B /* Sources */, + F87D2230298ECAFB001A882B /* Frameworks */, + F87D2231298ECAFB001A882B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = IntentsExtensionUI; + productName = IntentsExtensionUI; + productReference = F87D2233298ECAFB001A882B /* IntentsExtensionUI.appex */; + productType = "com.apple.product-type.app-extension"; + }; F8FC438126C01CDD0033E151 /* NADA-iOS-forRelease */ = { isa = PBXNativeTarget; buildConfigurationList = F8FC439626C01CDE0033E151 /* Build configuration list for PBXNativeTarget "NADA-iOS-forRelease" */; @@ -981,10 +1208,14 @@ F8FC438026C01CDD0033E151 /* Resources */, AF97E239CC02D3189BC80412 /* [CP] Embed Pods Frameworks */, F8FC43BD26C0244D0033E151 /* ShellScript */, + F838B673298E5C5400D84340 /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + F838B671298E5C5400D84340 /* PBXTargetDependency */, + F87D223E298ECAFB001A882B /* PBXTargetDependency */, + F87D2241298ECAFB001A882B /* PBXTargetDependency */, ); name = "NADA-iOS-forRelease"; productName = "NADA-iOS-forRelease"; @@ -997,9 +1228,18 @@ F8FC437A26C01CDD0033E151 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1250; + LastSwiftUpdateCheck = 1420; LastUpgradeCheck = 1250; TargetAttributes = { + F838B65D298E5C5300D84340 = { + CreatedOnToolsVersion = 14.2; + }; + F87D2227298ECAFB001A882B = { + CreatedOnToolsVersion = 14.2; + }; + F87D2232298ECAFB001A882B = { + CreatedOnToolsVersion = 14.2; + }; F8FC438126C01CDD0033E151 = { CreatedOnToolsVersion = 12.5.1; }; @@ -1019,11 +1259,37 @@ projectRoot = ""; targets = ( F8FC438126C01CDD0033E151 /* NADA-iOS-forRelease */, + F838B65D298E5C5300D84340 /* WidgetsExtension */, + F87D2227298ECAFB001A882B /* IntentsExtension */, + F87D2232298ECAFB001A882B /* IntentsExtensionUI */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + F838B65C298E5C5300D84340 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F838B66C298E5C5400D84340 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F87D2226298ECAFB001A882B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F87D2231298ECAFB001A882B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F87D223B298ECAFB001A882B /* MainInterface.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F8FC438026C01CDD0033E151 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1138,11 +1404,44 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + F838B65A298E5C5300D84340 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8BCDD24298FFA940044D0B4 /* OpenAppLockScreenWidget.swift in Sources */, + F8BCDD27298FFB280044D0B4 /* Color+Extension.swift in Sources */, + F838B66E298E5C5400D84340 /* Widgets.intentdefinition in Sources */, + F838B667298E5C5300D84340 /* WidgetsLiveActivity.swift in Sources */, + F8BCDD25298FFAF90044D0B4 /* WidgetsBundle.swift in Sources */, + F8BCDD22298FFA830044D0B4 /* QRCodeWidget.swift in Sources */, + F8BCDD26298FFB0B0044D0B4 /* MyCardWidget.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F87D2224298ECAFB001A882B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F80975E92990A27400075B93 /* Widgets.intentdefinition in Sources */, + F87D222D298ECAFB001A882B /* IntentHandler.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F87D222F298ECAFB001A882B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F80975EA2990A27900075B93 /* Widgets.intentdefinition in Sources */, + F87D2238298ECAFB001A882B /* IntentViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F8FC437E26C01CDD0033E151 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( F87122762733046300A24E74 /* Card.swift in Sources */, + F838B66F298E5C5400D84340 /* Widgets.intentdefinition in Sources */, 39317D2227646F8E00D87166 /* GroupNameEditBottomSheetViewController.swift in Sources */, F84BAF9D26FDB417004CA335 /* CardCreationViewController.swift in Sources */, F8C83FCB272FA32C0009DF0D /* GroupService.swift in Sources */, @@ -1245,7 +1544,33 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + F838B671298E5C5400D84340 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F838B65D298E5C5300D84340 /* WidgetsExtension */; + targetProxy = F838B670298E5C5400D84340 /* PBXContainerItemProxy */; + }; + F87D223E298ECAFB001A882B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F87D2232298ECAFB001A882B /* IntentsExtensionUI */; + targetProxy = F87D223D298ECAFB001A882B /* PBXContainerItemProxy */; + }; + F87D2241298ECAFB001A882B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F87D2227298ECAFB001A882B /* IntentsExtension */; + targetProxy = F87D2240298ECAFB001A882B /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ + F87D2239298ECAFB001A882B /* MainInterface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + F87D223A298ECAFB001A882B /* Base */, + ); + name = MainInterface.storyboard; + sourceTree = ""; + }; F8FC439026C01CDE0033E151 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -1257,6 +1582,194 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + F838B674298E5C5400D84340 /* 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_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = T3VFJ764ZC; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Widgets/Resource/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Widgets; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "YJC.NADA-iOS-forRelease.Widgets"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore YJC.NADA-iOS-forRelease.Widgets"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F838B675298E5C5400D84340 /* 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_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Widgets/Resource/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Widgets; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "YJC.NADA-iOS-forRelease.Widgets"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + F87D2244298ECAFB001A882B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = T3VFJ764ZC; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = IntentsExtensionUI/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = IntentsExtensionUI; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "YJC.NADA-iOS-forRelease.IntentsExtensionUI"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore YJC.NADA-iOS-forRelease.IntentsExtensionUI"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F87D2245298ECAFB001A882B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = T3VFJ764ZC; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = IntentsExtensionUI/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = IntentsExtensionUI; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "YJC.NADA-iOS-forRelease.IntentsExtensionUI"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + F87D2247298ECAFB001A882B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = T3VFJ764ZC; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = IntentsExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = IntentsExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "YJC.NADA-iOS-forRelease.IntentsExtension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore YJC.NADA-iOS-forRelease.IntentsExtension"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F87D2248298ECAFB001A882B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = T3VFJ764ZC; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = IntentsExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = IntentsExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "YJC.NADA-iOS-forRelease.IntentsExtension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; F8FC439426C01CDE0033E151 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1377,6 +1890,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7F4EE1D042EC783FA8528743 /* Pods-NADA-iOS-forRelease.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "NADA-iOS-forRelease/NADA-iOS-forRelease.entitlements"; @@ -1405,6 +1919,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1E770167DDA25A2CE063AA5C /* Pods-NADA-iOS-forRelease.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "NADA-iOS-forRelease/NADA-iOS-forRelease.entitlements"; @@ -1432,6 +1947,33 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + F838B676298E5C5400D84340 /* Build configuration list for PBXNativeTarget "WidgetsExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F838B674298E5C5400D84340 /* Debug */, + F838B675298E5C5400D84340 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F87D2243298ECAFB001A882B /* Build configuration list for PBXNativeTarget "IntentsExtensionUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F87D2244298ECAFB001A882B /* Debug */, + F87D2245298ECAFB001A882B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F87D2246298ECAFB001A882B /* Build configuration list for PBXNativeTarget "IntentsExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F87D2247298ECAFB001A882B /* Debug */, + F87D2248298ECAFB001A882B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; F8FC437D26C01CDD0033E151 /* Build configuration list for PBXProject "NADA-iOS-forRelease" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/NADA-iOS-forRelease.xcodeproj/xcshareddata/xcschemes/IntentsExtension.xcscheme b/NADA-iOS-forRelease.xcodeproj/xcshareddata/xcschemes/IntentsExtension.xcscheme new file mode 100644 index 00000000..e859c310 --- /dev/null +++ b/NADA-iOS-forRelease.xcodeproj/xcshareddata/xcschemes/IntentsExtension.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NADA-iOS-forRelease.xcodeproj/xcshareddata/xcschemes/IntentsExtensionUI.xcscheme b/NADA-iOS-forRelease.xcodeproj/xcshareddata/xcschemes/IntentsExtensionUI.xcscheme new file mode 100644 index 00000000..a9a57819 --- /dev/null +++ b/NADA-iOS-forRelease.xcodeproj/xcshareddata/xcschemes/IntentsExtensionUI.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NADA-iOS-forRelease.xcodeproj/xcshareddata/xcschemes/WidgetsExtension.xcscheme b/NADA-iOS-forRelease.xcodeproj/xcshareddata/xcschemes/WidgetsExtension.xcscheme new file mode 100644 index 00000000..d076c405 --- /dev/null +++ b/NADA-iOS-forRelease.xcodeproj/xcshareddata/xcschemes/WidgetsExtension.xcscheme @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NADA-iOS-forRelease/Info.plist b/NADA-iOS-forRelease/Info.plist index fa43581f..c40fd8c8 100644 --- a/NADA-iOS-forRelease/Info.plist +++ b/NADA-iOS-forRelease/Info.plist @@ -52,6 +52,10 @@ 명함을 이미지로 저장하기 위해 갤러리 권한 허용이 필요해요. NSPhotoLibraryUsageDescription 명함 배경을 설정하기 위해 갤러리 권한 허용이 필요해요. + NSUserActivityTypes + + MyCardIntent + UIAppFonts NotoSansCJKkr-Bold.otf diff --git a/Widgets/Resource/Assets.xcassets/AccentColor.colorset/Contents.json b/Widgets/Resource/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/Widgets/Resource/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Widgets/Resource/Assets.xcassets/AppIcon.appiconset/Contents.json b/Widgets/Resource/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..13613e3e --- /dev/null +++ b/Widgets/Resource/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/Widgets/Resource/Assets.xcassets/Contents.json b/Widgets/Resource/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Widgets/Resource/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Widgets/Resource/Assets.xcassets/WidgetBackground.colorset/Contents.json b/Widgets/Resource/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/Widgets/Resource/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Widgets/Resource/Assets.xcassets/logoNada.imageset/Contents.json b/Widgets/Resource/Assets.xcassets/logoNada.imageset/Contents.json new file mode 100644 index 00000000..5765c0cd --- /dev/null +++ b/Widgets/Resource/Assets.xcassets/logoNada.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "scale" : "1x", + "idiom" : "universal", + "filename" : "logoNada.png" + }, + { + "idiom" : "universal", + "filename" : "logoNada@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "logoNada@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Widgets/Resource/Assets.xcassets/logoNada.imageset/logoNada.png b/Widgets/Resource/Assets.xcassets/logoNada.imageset/logoNada.png new file mode 100644 index 00000000..d802b2bc Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/logoNada.imageset/logoNada.png differ diff --git a/Widgets/Resource/Assets.xcassets/logoNada.imageset/logoNada@2x.png b/Widgets/Resource/Assets.xcassets/logoNada.imageset/logoNada@2x.png new file mode 100644 index 00000000..2bdebe15 Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/logoNada.imageset/logoNada@2x.png differ diff --git a/Widgets/Resource/Assets.xcassets/logoNada.imageset/logoNada@3x.png b/Widgets/Resource/Assets.xcassets/logoNada.imageset/logoNada@3x.png new file mode 100644 index 00000000..57adc73b Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/logoNada.imageset/logoNada@3x.png differ diff --git a/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/Contents.json b/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/Contents.json new file mode 100644 index 00000000..3edb3130 --- /dev/null +++ b/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "scale" : "1x", + "filename" : "widgetLogoWhite.png", + "idiom" : "universal" + }, + { + "filename" : "widgetLogoWhite@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "widgetLogoWhite@3x.png", + "scale" : "3x", + "idiom" : "universal" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/widgetLogoWhite.png b/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/widgetLogoWhite.png new file mode 100644 index 00000000..dea0f8d7 Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/widgetLogoWhite.png differ diff --git a/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/widgetLogoWhite@2x.png b/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/widgetLogoWhite@2x.png new file mode 100644 index 00000000..61d25636 Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/widgetLogoWhite@2x.png differ diff --git a/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/widgetLogoWhite@3x.png b/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/widgetLogoWhite@3x.png new file mode 100644 index 00000000..0867e364 Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/widgetLogoWhite.imageset/widgetLogoWhite@3x.png differ diff --git a/Widgets/Resource/Assets.xcassets/widgetQr.imageset/Contents.json b/Widgets/Resource/Assets.xcassets/widgetQr.imageset/Contents.json new file mode 100644 index 00000000..8c3bb520 --- /dev/null +++ b/Widgets/Resource/Assets.xcassets/widgetQr.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "widgetQr.png" + }, + { + "filename" : "widgetQr@2x.png", + "scale" : "2x", + "idiom" : "universal" + }, + { + "filename" : "widgetQr@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Widgets/Resource/Assets.xcassets/widgetQr.imageset/widgetQr.png b/Widgets/Resource/Assets.xcassets/widgetQr.imageset/widgetQr.png new file mode 100644 index 00000000..106faa4c Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/widgetQr.imageset/widgetQr.png differ diff --git a/Widgets/Resource/Assets.xcassets/widgetQr.imageset/widgetQr@2x.png b/Widgets/Resource/Assets.xcassets/widgetQr.imageset/widgetQr@2x.png new file mode 100644 index 00000000..8a040fda Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/widgetQr.imageset/widgetQr@2x.png differ diff --git a/Widgets/Resource/Assets.xcassets/widgetQr.imageset/widgetQr@3x.png b/Widgets/Resource/Assets.xcassets/widgetQr.imageset/widgetQr@3x.png new file mode 100644 index 00000000..520d8f10 Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/widgetQr.imageset/widgetQr@3x.png differ diff --git a/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/Contents.json b/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/Contents.json new file mode 100644 index 00000000..e5711dda --- /dev/null +++ b/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "widgetQrLockscreenWhite.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "widgetQrLockscreenWhite@2x.png" + }, + { + "scale" : "3x", + "idiom" : "universal", + "filename" : "widgetQrLockscreenWhite@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/widgetQrLockscreenWhite.png b/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/widgetQrLockscreenWhite.png new file mode 100644 index 00000000..a96a24da Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/widgetQrLockscreenWhite.png differ diff --git a/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/widgetQrLockscreenWhite@2x.png b/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/widgetQrLockscreenWhite@2x.png new file mode 100644 index 00000000..8ebf69e4 Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/widgetQrLockscreenWhite@2x.png differ diff --git a/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/widgetQrLockscreenWhite@3x.png b/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/widgetQrLockscreenWhite@3x.png new file mode 100644 index 00000000..33f4be45 Binary files /dev/null and b/Widgets/Resource/Assets.xcassets/widgetQrLockscreenWhite.imageset/widgetQrLockscreenWhite@3x.png differ diff --git a/Widgets/Resource/Extension/Color+Extension.swift b/Widgets/Resource/Extension/Color+Extension.swift new file mode 100644 index 00000000..f7b45a6e --- /dev/null +++ b/Widgets/Resource/Extension/Color+Extension.swift @@ -0,0 +1,32 @@ +// +// Color+Extension.swift +// NADA-iOS-forRelease +// +// Created by kimhyungyu on 2023/02/04. +// + +import SwiftUI + +extension Color { + static func backgroundColor(for colorScheme: ColorScheme) -> Color { + switch colorScheme { + case .light: + return Color(red: 255.0 / 255.0, green: 255.0 / 255.0, blue: 255.0 / 255.0) + case .dark: + return Color(red: 19.0 / 255.0, green: 20.0 / 255.0, blue: 22.0 / 255.0, opacity: 0.5) + @unknown default: + return Color(red: 255.0 / 255.0, green: 255.0 / 255.0, blue: 255.0 / 255.0) + } + } + + static func userNameColor(for colorScheme: ColorScheme) -> Color { + switch colorScheme { + case .light: + return Color(red: 19.0 / 255.0, green: 20.0 / 255.0, blue: 22.0 / 255.0) + case .dark: + return Color(red: 255.0 / 255.0, green: 255.0 / 255.0, blue: 255.0 / 255.0) + @unknown default: + return Color(red: 19.0 / 255.0, green: 20.0 / 255.0, blue: 22.0 / 255.0) + } + } +} diff --git a/Widgets/Resource/Info.plist b/Widgets/Resource/Info.plist new file mode 100644 index 00000000..0f118fb7 --- /dev/null +++ b/Widgets/Resource/Info.plist @@ -0,0 +1,11 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/Widgets/Resource/Widgets.intentdefinition b/Widgets/Resource/Widgets.intentdefinition new file mode 100644 index 00000000..78da667f --- /dev/null +++ b/Widgets/Resource/Widgets.intentdefinition @@ -0,0 +1,179 @@ + + + + + INEnums + + INIntentDefinitionModelVersion + 1.2 + INIntentDefinitionNamespace + 88xZPY + INIntentDefinitionSystemVersion + 22C65 + INIntentDefinitionToolsBuildVersion + 14C18 + INIntentDefinitionToolsVersion + 14.2 + INIntents + + + INIntentCategory + information + INIntentDescriptionID + tVvJ9c + INIntentEligibleForWidgets + + INIntentIneligibleForSuggestions + + INIntentLastParameterTag + 2 + INIntentName + MyCard + INIntentParameters + + + INIntentParameterConfigurable + + INIntentParameterDisplayName + 내 명함 + INIntentParameterDisplayNameID + vkhY1e + INIntentParameterDisplayPriority + 1 + INIntentParameterName + myCard + INIntentParameterObjectType + MyCard + INIntentParameterObjectTypeNamespace + 88xZPY + INIntentParameterPromptDialogs + + + INIntentParameterPromptDialogCustom + + INIntentParameterPromptDialogType + Configuration + + + INIntentParameterPromptDialogCustom + + INIntentParameterPromptDialogType + Primary + + + INIntentParameterSupportsDynamicEnumeration + + INIntentParameterTag + 2 + INIntentParameterType + Object + + + INIntentResponse + + INIntentResponseCodes + + + INIntentResponseCodeName + success + INIntentResponseCodeSuccess + + + + INIntentResponseCodeName + failure + + + + INIntentTitle + My Card + INIntentTitleID + gpCwrM + INIntentType + Custom + INIntentVerb + View + + + INTypes + + + INTypeDisplayName + MyCard + INTypeDisplayNameID + J1deG2 + INTypeLastPropertyTag + 100 + INTypeName + MyCard + INTypeProperties + + + INTypePropertyDefault + + INTypePropertyDisplayPriority + 1 + INTypePropertyName + identifier + INTypePropertyTag + 1 + INTypePropertyType + String + + + INTypePropertyDefault + + INTypePropertyDisplayPriority + 2 + INTypePropertyName + displayString + INTypePropertyTag + 2 + INTypePropertyType + String + + + INTypePropertyDefault + + INTypePropertyDisplayPriority + 3 + INTypePropertyName + pronunciationHint + INTypePropertyTag + 3 + INTypePropertyType + String + + + INTypePropertyDefault + + INTypePropertyDisplayPriority + 4 + INTypePropertyName + alternativeSpeakableMatches + INTypePropertySupportsMultipleValues + + INTypePropertyTag + 4 + INTypePropertyType + SpeakableString + + + INTypePropertyDisplayName + Card ID + INTypePropertyDisplayNameID + aRJ51O + INTypePropertyDisplayPriority + 5 + INTypePropertyName + cardID + INTypePropertyTag + 100 + INTypePropertyType + String + + + + + + diff --git a/Widgets/WidgetsBundle/MyCardWidget.swift b/Widgets/WidgetsBundle/MyCardWidget.swift new file mode 100644 index 00000000..c2c0ae43 --- /dev/null +++ b/Widgets/WidgetsBundle/MyCardWidget.swift @@ -0,0 +1,68 @@ +// +// MyCardWidget.swift +// Widgets +// +// Created by kimhyungyu on 2023/02/04. +// + +import WidgetKit +import SwiftUI +import Intents + +struct MyCardProvider: IntentTimelineProvider { + func placeholder(in context: Context) -> MyCardEntry { + MyCardEntry(date: Date(), configuration: MyCardIntent()) + } + + func getSnapshot(for configuration: MyCardIntent, in context: Context, completion: @escaping (MyCardEntry) -> Void) { + let entry = MyCardEntry(date: Date(), configuration: configuration) + completion(entry) + } + + func getTimeline(for configuration: MyCardIntent, in context: Context, completion: @escaping (Timeline) -> Void) { + var entries: [MyCardEntry] = [] + + // Generate a timeline consisting of five entries an hour apart, starting from the current date. + let currentDate = Date() + for hourOffset in 0 ..< 5 { + let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! + let entry = MyCardEntry(date: entryDate, configuration: configuration) + entries.append(entry) + } + + let timeline = Timeline(entries: entries, policy: .atEnd) + completion(timeline) + } +} + +struct MyCardEntry: TimelineEntry { + let date: Date + let configuration: MyCardIntent +} + +struct MyCardEntryView: View { + var entry: MyCardProvider.Entry + + var body: some View { + Text(entry.date, style: .time) + } +} + +struct MyCardWidget: Widget { + let kind: String = "Widgets" + + var body: some WidgetConfiguration { + IntentConfiguration(kind: kind, intent: MyCardIntent.self, provider: MyCardProvider()) { entry in + MyCardEntryView(entry: entry) + } + .configurationDisplayName("My Widget") + .description("This is an example widget.") + } +} + +struct MyCardWidget_Previews: PreviewProvider { + static var previews: some View { + MyCardEntryView(entry: MyCardEntry(date: Date(), configuration: MyCardIntent())) + .previewContext(WidgetPreviewContext(family: .systemSmall)) + } +} diff --git a/Widgets/WidgetsBundle/OpenAppLockScreenWidget.swift b/Widgets/WidgetsBundle/OpenAppLockScreenWidget.swift new file mode 100644 index 00000000..c72adb53 --- /dev/null +++ b/Widgets/WidgetsBundle/OpenAppLockScreenWidget.swift @@ -0,0 +1,77 @@ +// +// OpenAppLockScreenWidget.swift +// WidgetsExtension +// +// Created by kimhyungyu on 2023/02/05. +// + +import WidgetKit +import SwiftUI + +struct OpenAppLockScreenProvider: TimelineProvider { + func placeholder(in context: Context) -> OpenAppLockScreenEntry { + OpenAppLockScreenEntry(date: Date()) + } + + func getSnapshot(in context: Context, completion: @escaping (OpenAppLockScreenEntry) -> Void) { + let entry = OpenAppLockScreenEntry(date: Date()) + completion(entry) + } + + func getTimeline(in context: Context, completion: @escaping (Timeline) -> Void) { + var entries: [OpenAppLockScreenEntry] = [] + + let currentDate = Date() + for hourOffset in 0 ..< 5 { + let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! + let entry = OpenAppLockScreenEntry(date: entryDate) + entries.append(entry) + } + + let timeline = Timeline(entries: entries, policy: .never) + completion(timeline) + } +} + +struct OpenAppLockScreenEntry: TimelineEntry { + let date: Date +} + +struct OpenAppLockScreenEntryView: View { + var entry: OpenAppLockScreenProvider.Entry + @Environment(\.widgetFamily) var widgetFamily + + var body: some View { + switch widgetFamily { + case .accessoryCircular: + ZStack { + AccessoryWidgetBackground() + Image("widgetLogoWhite") + .resizable() + } + default: + Image("widgetLogoWhite") + } + } +} + +struct OpenAppLockScreenWidget: Widget { + let kind: String = "OpenAppLockScreen" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, + provider: OpenAppLockScreenProvider()) { entry in + OpenAppLockScreenEntryView(entry: entry) + } + .configurationDisplayName("나다 NADA") + .description("나다 NADA를 실행합니다.") + .supportedFamilies([.accessoryCircular]) + } +} + +struct OpenAppLockScreenWidget_Previews: PreviewProvider { + static var previews: some View { + OpenAppLockScreenEntryView(entry: OpenAppLockScreenEntry(date: Date())) + .previewContext(WidgetPreviewContext(family: .accessoryCircular)) + } +} diff --git a/Widgets/WidgetsBundle/QRCodeWidget.swift b/Widgets/WidgetsBundle/QRCodeWidget.swift new file mode 100644 index 00000000..45faeed3 --- /dev/null +++ b/Widgets/WidgetsBundle/QRCodeWidget.swift @@ -0,0 +1,83 @@ +// +// QRCodeWidget.swift +// WidgetsExtension +// +// Created by kimhyungyu on 2023/02/05. +// + +import WidgetKit +import SwiftUI + +struct QRCodeProvider: TimelineProvider { + func placeholder(in context: Context) -> QRCodeEntry { + QRCodeEntry(date: Date()) + } + + func getSnapshot(in context: Context, completion: @escaping (QRCodeEntry) -> Void) { + let entry = QRCodeEntry(date: Date()) + completion(entry) + } + + func getTimeline(in context: Context, completion: @escaping (Timeline) -> Void) { + var entries: [QRCodeEntry] = [] + + let currentDate = Date() + for hourOffset in 0 ..< 5 { + let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! + let entry = QRCodeEntry(date: entryDate) + entries.append(entry) + } + + let timeline = Timeline(entries: entries, policy: .never) + completion(timeline) + } +} + +struct QRCodeEntry: TimelineEntry { + let date: Date +} + +struct QRCodeEntryView: View { + var entry: QRCodeProvider.Entry + @Environment(\.widgetFamily) var widgetFamily + + var body: some View { + switch widgetFamily { + case .accessoryCircular: + ZStack { + AccessoryWidgetBackground() + Image("widgetQrLockscreenWhite") + .resizable() + .widgetURL(URL(string: "openQRCodeWidget")) + } + default: + Image("widgetQr") + .resizable() + .scaledToFill() + .widgetURL(URL(string: "openQRCodeWidget")) + } + } +} + +struct QRCodeWidget: Widget { + let kind: String = "QRCodeWidget" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, + provider: QRCodeProvider()) { entry in + QRCodeEntryView(entry: entry) + } + .configurationDisplayName("QR Code 위젯") + .description("QR Code 를 인식할 수 있도록 카메라로 빠르게 접근합니다.") + .supportedFamilies([.systemSmall, .accessoryCircular]) + } +} + +struct QRCodeWidget_Previews: PreviewProvider { + static var previews: some View { + QRCodeEntryView(entry: QRCodeEntry(date: Date())) + .previewContext(WidgetPreviewContext(family: .systemSmall)) + QRCodeEntryView(entry: QRCodeEntry(date: Date())) + .previewContext(WidgetPreviewContext(family: .accessoryCircular)) + } +} diff --git a/Widgets/WidgetsBundle/WidgetsBundle.swift b/Widgets/WidgetsBundle/WidgetsBundle.swift new file mode 100644 index 00000000..e1a7dfd6 --- /dev/null +++ b/Widgets/WidgetsBundle/WidgetsBundle.swift @@ -0,0 +1,19 @@ +// +// WidgetsBundle.swift +// Widgets +// +// Created by kimhyungyu on 2023/02/04. +// + +import WidgetKit +import SwiftUI + +@main +struct WidgetsBundle: WidgetBundle { + var body: some Widget { + MyCardWidget() + OpenAppLockScreenWidget() + QRCodeWidget() + WidgetsLiveActivity() + } +} diff --git a/Widgets/WidgetsBundle/WidgetsLiveActivity.swift b/Widgets/WidgetsBundle/WidgetsLiveActivity.swift new file mode 100644 index 00000000..a1535ec5 --- /dev/null +++ b/Widgets/WidgetsBundle/WidgetsLiveActivity.swift @@ -0,0 +1,77 @@ +// +// WidgetsLiveActivity.swift +// Widgets +// +// Created by kimhyungyu on 2023/02/04. +// + +import ActivityKit +import WidgetKit +import SwiftUI + +struct WidgetsAttributes: ActivityAttributes { + public struct ContentState: Codable, Hashable { + // Dynamic stateful properties about your activity go here! + var value: Int + } + + // Fixed non-changing properties about your activity go here! + var name: String +} + +struct WidgetsLiveActivity: Widget { + var body: some WidgetConfiguration { + ActivityConfiguration(for: WidgetsAttributes.self) { context in + // Lock screen/banner UI goes here + VStack { + Text("Hello") + } + .activityBackgroundTint(Color.cyan) + .activitySystemActionForegroundColor(Color.black) + + } dynamicIsland: { context in + DynamicIsland { + // Expanded UI goes here. Compose the expanded UI through + // various regions, like leading/trailing/center/bottom + DynamicIslandExpandedRegion(.leading) { + Text("Leading") + } + DynamicIslandExpandedRegion(.trailing) { + Text("Trailing") + } + DynamicIslandExpandedRegion(.bottom) { + Text("Bottom") + // more content + } + } compactLeading: { + Text("L") + } compactTrailing: { + Text("T") + } minimal: { + Text("Min") + } + .widgetURL(URL(string: "http://www.apple.com")) + .keylineTint(Color.red) + } + } +} + +struct WidgetsLiveActivity_Previews: PreviewProvider { + static let attributes = WidgetsAttributes(name: "Me") + static let contentState = WidgetsAttributes.ContentState(value: 3) + + static var previews: some View { + attributes + .previewContext(contentState, viewKind: .dynamicIsland(.compact)) + .previewDisplayName("Island Compact") + attributes + .previewContext(contentState, viewKind: .dynamicIsland(.expanded)) + .previewDisplayName("Island Expanded") + attributes + .previewContext(contentState, viewKind: .dynamicIsland(.minimal)) + .previewDisplayName("Minimal") + attributes + .previewContext(contentState, viewKind: .content) + .previewDisplayName("Notification") + } +}