diff --git a/FavouriteCardsWiget/Assets.xcassets/AccentColor.colorset/Contents.json b/FavouriteCardsWiget/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/FavouriteCardsWiget/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FavouriteCardsWiget/Assets.xcassets/AppIcon.appiconset/Contents.json b/FavouriteCardsWiget/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/FavouriteCardsWiget/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/FavouriteCardsWiget/Assets.xcassets/Contents.json b/FavouriteCardsWiget/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/FavouriteCardsWiget/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FavouriteCardsWiget/Assets.xcassets/WidgetBackground.colorset/Contents.json b/FavouriteCardsWiget/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/FavouriteCardsWiget/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FavouriteCardsWiget/FavouriteCardsWiget.swift b/FavouriteCardsWiget/FavouriteCardsWiget.swift new file mode 100644 index 0000000..883337c --- /dev/null +++ b/FavouriteCardsWiget/FavouriteCardsWiget.swift @@ -0,0 +1,73 @@ +// +// FavouriteCardsWiget.swift +// FavouriteCardsWiget +// +// Created by Pushpinder Pal Singh on 04/05/24. +// + +import WidgetKit +import SwiftUI + +struct Provider: TimelineProvider { + func placeholder(in context: Context) -> SimpleEntry { + SimpleEntry(date: Date(), emoji: "😀") + } + + func getSnapshot(in context: Context, completion: @escaping (SimpleEntry) -> ()) { + let entry = SimpleEntry(date: Date(), emoji: "😀") + completion(entry) + } + + func getTimeline(in context: Context, completion: @escaping (Timeline) -> ()) { + let entry = SimpleEntry(date: .now, emoji: "😀") + let timeline = Timeline(entries: [entry], policy: .never) + completion(timeline) + } +} + +struct SimpleEntry: TimelineEntry { + let date: Date + let emoji: String +} + +struct FavouriteCardsWigetEntryView : View { + var entry: Provider.Entry + + var body: some View { + HStack{ + VStack(alignment: .leading) { + Image("4".getCardNetwork().rawValue) + Text("Axis Magnus") + .font(.title2) + .fontWeight(.semibold) + } + Spacer() + } + } +} + +struct FavouriteCardsWiget: Widget { + let kind: String = "FavouriteCardsWiget" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, provider: Provider()) { entry in + if #available(iOS 17.0, *) { + FavouriteCardsWigetEntryView(entry: entry) + .containerBackground(.fill.tertiary, for: .widget) + } else { + FavouriteCardsWigetEntryView(entry: entry) + .padding() + .background() + } + } + .configurationDisplayName("My Widget") + .description("This is an example widget.") + } +} + +#Preview(as: .systemSmall) { + FavouriteCardsWiget() +} timeline: { + SimpleEntry(date: .now, emoji: "😀") + SimpleEntry(date: .now, emoji: "🤩") +} diff --git a/FavouriteCardsWiget/FavouriteCardsWigetBundle.swift b/FavouriteCardsWiget/FavouriteCardsWigetBundle.swift new file mode 100644 index 0000000..aaaf482 --- /dev/null +++ b/FavouriteCardsWiget/FavouriteCardsWigetBundle.swift @@ -0,0 +1,16 @@ +// +// FavouriteCardsWigetBundle.swift +// FavouriteCardsWiget +// +// Created by Pushpinder Pal Singh on 04/05/24. +// + +import WidgetKit +import SwiftUI + +@main +struct FavouriteCardsWigetBundle: WidgetBundle { + var body: some Widget { + FavouriteCardsWiget() + } +} diff --git a/FavouriteCardsWiget/Info.plist b/FavouriteCardsWiget/Info.plist new file mode 100644 index 0000000..0f118fb --- /dev/null +++ b/FavouriteCardsWiget/Info.plist @@ -0,0 +1,11 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/cards.xcodeproj/project.pbxproj b/cards.xcodeproj/project.pbxproj index 4799262..b0cf04f 100644 --- a/cards.xcodeproj/project.pbxproj +++ b/cards.xcodeproj/project.pbxproj @@ -30,10 +30,45 @@ FF584F4B2BE434D40036F3DD /* Settings in Frameworks */ = {isa = PBXBuildFile; productRef = FF584F4A2BE434D40036F3DD /* Settings */; }; FF9212BE2BE57A50005DF48E /* Boilerplate in Frameworks */ = {isa = PBXBuildFile; productRef = FF9212BD2BE57A50005DF48E /* Boilerplate */; }; FF9212C02BE57A50005DF48E /* Settings in Frameworks */ = {isa = PBXBuildFile; productRef = FF9212BF2BE57A50005DF48E /* Settings */; }; + FF9212C82BE57F38005DF48E /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FF9212C72BE57F37005DF48E /* WidgetKit.framework */; }; + FF9212CA2BE57F38005DF48E /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FF9212C92BE57F38005DF48E /* SwiftUI.framework */; }; + FF9212CD2BE57F38005DF48E /* FavouriteCardsWigetBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF9212CC2BE57F38005DF48E /* FavouriteCardsWigetBundle.swift */; }; + FF9212CF2BE57F38005DF48E /* FavouriteCardsWiget.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF9212CE2BE57F38005DF48E /* FavouriteCardsWiget.swift */; }; + FF9212D12BE57F3A005DF48E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FF9212D02BE57F3A005DF48E /* Assets.xcassets */; }; + FF9212D52BE57F3A005DF48E /* FavouriteCardsWigetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = FF9212C52BE57F37005DF48E /* FavouriteCardsWigetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; FF9452F92BDE314E00731D8B /* Secrets.plist in Resources */ = {isa = PBXBuildFile; fileRef = FF9452F82BDE314E00731D8B /* Secrets.plist */; }; FF9452FB2BE1F68700731D8B /* WNCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF9452FA2BE1F68700731D8B /* WNCollection.swift */; }; + FFC4AC1C2BE6056800E84BF4 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE599BB12B24465A002F49F8 /* Extensions.swift */; }; + FFC4AC1D2BE6057700E84BF4 /* CardData.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE599BB52B24495F002F49F8 /* CardData.swift */; }; + FFC4AC1E2BE6057B00E84BF4 /* CardDataStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE960C4E2B4AC00B00B67805 /* CardDataStore.swift */; }; + FFC4AC1F2BE605AA00E84BF4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EEBB52ED2B238D6800035B92 /* Assets.xcassets */; }; + FFC4AC202BE605EF00E84BF4 /* UserSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE599BAD2B2398DF002F49F8 /* UserSettings.swift */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + FF9212D32BE57F3A005DF48E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = EEBB52DE2B238D6600035B92 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FF9212C42BE57F37005DF48E; + remoteInfo = FavouriteCardsWigetExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + FF9212DA2BE57F3A005DF48E /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + FF9212D52BE57F3A005DF48E /* FavouriteCardsWigetExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ EE1D3E8F2B66AE66009733A5 /* Tip.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tip.swift; sourceTree = ""; }; EE1D3E912B66AE83009733A5 /* CardViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardViewModel.swift; sourceTree = ""; }; @@ -53,6 +88,13 @@ EEBB52ED2B238D6800035B92 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; EEBB52F02B238D6800035B92 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; EEBED8C72B6D7F6F00BEBE87 /* CardScanViewStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardScanViewStyle.swift; sourceTree = ""; }; + FF9212C52BE57F37005DF48E /* FavouriteCardsWigetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = FavouriteCardsWigetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + FF9212C72BE57F37005DF48E /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + FF9212C92BE57F38005DF48E /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + FF9212CC2BE57F38005DF48E /* FavouriteCardsWigetBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavouriteCardsWigetBundle.swift; sourceTree = ""; }; + FF9212CE2BE57F38005DF48E /* FavouriteCardsWiget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavouriteCardsWiget.swift; sourceTree = ""; }; + FF9212D02BE57F3A005DF48E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FF9212D22BE57F3A005DF48E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; FF9452F82BDE314E00731D8B /* Secrets.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Secrets.plist; sourceTree = ""; }; FF9452FA2BE1F68700731D8B /* WNCollection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WNCollection.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -72,6 +114,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FF9212C22BE57F37005DF48E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FF9212CA2BE57F38005DF48E /* SwiftUI.framework in Frameworks */, + FF9212C82BE57F38005DF48E /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -117,6 +168,8 @@ isa = PBXGroup; children = ( EEBB52E82B238D6600035B92 /* cards */, + FF9212CB2BE57F38005DF48E /* FavouriteCardsWiget */, + FF9212C62BE57F37005DF48E /* Frameworks */, EEBB52E72B238D6600035B92 /* Products */, ); sourceTree = ""; @@ -125,6 +178,7 @@ isa = PBXGroup; children = ( EEBB52E62B238D6600035B92 /* Holder: A Secure Card Vault.app */, + FF9212C52BE57F37005DF48E /* FavouriteCardsWigetExtension.appex */, ); name = Products; sourceTree = ""; @@ -165,6 +219,26 @@ path = ScanView; sourceTree = ""; }; + FF9212C62BE57F37005DF48E /* Frameworks */ = { + isa = PBXGroup; + children = ( + FF9212C72BE57F37005DF48E /* WidgetKit.framework */, + FF9212C92BE57F38005DF48E /* SwiftUI.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + FF9212CB2BE57F38005DF48E /* FavouriteCardsWiget */ = { + isa = PBXGroup; + children = ( + FF9212CC2BE57F38005DF48E /* FavouriteCardsWigetBundle.swift */, + FF9212CE2BE57F38005DF48E /* FavouriteCardsWiget.swift */, + FF9212D02BE57F3A005DF48E /* Assets.xcassets */, + FF9212D22BE57F3A005DF48E /* Info.plist */, + ); + path = FavouriteCardsWiget; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -175,10 +249,12 @@ EEBB52E22B238D6600035B92 /* Sources */, EEBB52E32B238D6600035B92 /* Frameworks */, EEBB52E42B238D6600035B92 /* Resources */, + FF9212DA2BE57F3A005DF48E /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + FF9212D42BE57F3A005DF48E /* PBXTargetDependency */, ); name = cards; packageProductDependencies = ( @@ -194,6 +270,23 @@ productReference = EEBB52E62B238D6600035B92 /* Holder: A Secure Card Vault.app */; productType = "com.apple.product-type.application"; }; + FF9212C42BE57F37005DF48E /* FavouriteCardsWigetExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = FF9212D62BE57F3A005DF48E /* Build configuration list for PBXNativeTarget "FavouriteCardsWigetExtension" */; + buildPhases = ( + FF9212C12BE57F37005DF48E /* Sources */, + FF9212C22BE57F37005DF48E /* Frameworks */, + FF9212C32BE57F37005DF48E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FavouriteCardsWigetExtension; + productName = FavouriteCardsWigetExtension; + productReference = FF9212C52BE57F37005DF48E /* FavouriteCardsWigetExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -201,12 +294,15 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1500; + LastSwiftUpdateCheck = 1530; LastUpgradeCheck = 1500; TargetAttributes = { EEBB52E52B238D6600035B92 = { CreatedOnToolsVersion = 15.0; }; + FF9212C42BE57F37005DF48E = { + CreatedOnToolsVersion = 15.3; + }; }; }; buildConfigurationList = EEBB52E12B238D6600035B92 /* Build configuration list for PBXProject "cards" */; @@ -228,6 +324,7 @@ projectRoot = ""; targets = ( EEBB52E52B238D6600035B92 /* cards */, + FF9212C42BE57F37005DF48E /* FavouriteCardsWigetExtension */, ); }; /* End PBXProject section */ @@ -243,6 +340,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FF9212C32BE57F37005DF48E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFC4AC1F2BE605AA00E84BF4 /* Assets.xcassets in Resources */, + FF9212D12BE57F3A005DF48E /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -268,8 +374,29 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FF9212C12BE57F37005DF48E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF9212CF2BE57F38005DF48E /* FavouriteCardsWiget.swift in Sources */, + FFC4AC202BE605EF00E84BF4 /* UserSettings.swift in Sources */, + FFC4AC1D2BE6057700E84BF4 /* CardData.swift in Sources */, + FFC4AC1C2BE6056800E84BF4 /* Extensions.swift in Sources */, + FF9212CD2BE57F38005DF48E /* FavouriteCardsWigetBundle.swift in Sources */, + FFC4AC1E2BE6057B00E84BF4 /* CardDataStore.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + FF9212D42BE57F3A005DF48E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FF9212C42BE57F37005DF48E /* FavouriteCardsWigetExtension */; + targetProxy = FF9212D32BE57F3A005DF48E /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ EE1D3E952B692C9F009733A5 /* Beta */ = { isa = XCBuildConfiguration; @@ -330,6 +457,7 @@ EE1D3E962B692C9F009733A5 /* Beta */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; @@ -486,6 +614,7 @@ EEBB52F52B238D6800035B92 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; @@ -523,6 +652,7 @@ EEBB52F62B238D6800035B92 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; @@ -557,6 +687,90 @@ }; name = Release; }; + FF9212D72BE57F3A005DF48E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 6; + DEVELOPMENT_TEAM = 4WMQY24R33; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = FavouriteCardsWiget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = FavouriteCardsWiget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.swiftlysingh.cards.debug.FavouriteCardsWiget; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FF9212D82BE57F3A005DF48E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 6; + DEVELOPMENT_TEAM = 4WMQY24R33; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = FavouriteCardsWiget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = FavouriteCardsWiget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.swiftlysingh.cards.FavouriteCardsWiget; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + FF9212D92BE57F3A005DF48E /* Beta */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 6; + DEVELOPMENT_TEAM = 4WMQY24R33; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = FavouriteCardsWiget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = FavouriteCardsWiget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.swiftlysingh.cards.FavouriteCardsWiget; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Beta; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -580,6 +794,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + FF9212D62BE57F3A005DF48E /* Build configuration list for PBXNativeTarget "FavouriteCardsWigetExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FF9212D72BE57F3A005DF48E /* Debug */, + FF9212D82BE57F3A005DF48E /* Release */, + FF9212D92BE57F3A005DF48E /* Beta */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ diff --git a/cards/CardView/CardView.swift b/cards/CardView/CardView.swift index 5b3eb23..6b09ad7 100644 --- a/cards/CardView/CardView.swift +++ b/cards/CardView/CardView.swift @@ -36,7 +36,7 @@ struct CardView: View { .contextMenu(menuItems: { Button(action: { model.copyAction(with: value.wrappedValue) - UserSettings.shared.requestReview() + SettingsViewModel().rateTheAppAction() }) { Text("Copy to clipboard") Image(systemName: "doc.on.doc") diff --git a/cards/Settings/UserSettings.swift b/cards/Settings/UserSettings.swift index 3781e46..2ca14df 100644 --- a/cards/Settings/UserSettings.swift +++ b/cards/Settings/UserSettings.swift @@ -15,9 +15,4 @@ class UserSettings : ObservableObject { @AppStorage("username") var showNumber = 4.0 @AppStorage("timeout") var authTimeout = 10 @AppStorage("isAuthEnabled") var isAuthEnabled = true - - func requestReview() { - guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return } - SKStoreReviewController.requestReview(in: windowScene) - } }