[ios] add OMapsWidgetExtension target to the project

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn 2024-10-08 22:09:36 +04:00 committed by Roman Tsisyk
parent 5831885806
commit b452b608b8
16 changed files with 492 additions and 0 deletions

View file

@ -475,10 +475,24 @@
ED1080A72B791CFE0023F27E /* SocialMediaCollectionViewHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED1080A62B791CFE0023F27E /* SocialMediaCollectionViewHeader.swift */; };
ED1263AB2B6F99F900AD99F3 /* UIView+AddSeparator.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED1263AA2B6F99F900AD99F3 /* UIView+AddSeparator.swift */; };
ED1ADA332BC6B1B40029209F /* CarPlayServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED1ADA322BC6B1B40029209F /* CarPlayServiceTests.swift */; };
ED2D72382D1315B100660FBF /* TrackRecordingActivityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2D72372D1315B100660FBF /* TrackRecordingActivityManager.swift */; };
ED2D74382D14337500660FBF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ED2D74342D14337500660FBF /* Assets.xcassets */; };
ED2D74392D14337500660FBF /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = ED2D74352D14337500660FBF /* Info.plist */; };
ED2D743A2D14337500660FBF /* AppLogo.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2D742C2D14337500660FBF /* AppLogo.swift */; };
ED2D743B2D14337500660FBF /* LiveActivityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2D742D2D14337500660FBF /* LiveActivityManager.swift */; };
ED2D743C2D14337500660FBF /* StatisticDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2D742E2D14337500660FBF /* StatisticDetailView.swift */; };
ED2D743D2D14337500660FBF /* StatisticValueView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2D742F2D14337500660FBF /* StatisticValueView.swift */; };
ED2D743E2D14337500660FBF /* TrackRecordingLiveActivityAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2D74302D14337500660FBF /* TrackRecordingLiveActivityAttributes.swift */; };
ED2D743F2D14337500660FBF /* TrackRecordingLiveActivityConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2D74312D14337500660FBF /* TrackRecordingLiveActivityConfiguration.swift */; };
ED2D74402D14337500660FBF /* TrackRecordingLiveActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2D74322D14337500660FBF /* TrackRecordingLiveActivityView.swift */; };
ED2D74412D14337500660FBF /* OMapsWidgetExtensionBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2D74362D14337500660FBF /* OMapsWidgetExtensionBundle.swift */; };
ED2E328E2D10500900807A08 /* TrackRecordingButtonArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED46DD922D06F804007CACD6 /* TrackRecordingButtonArea.swift */; };
ED2E32912D10501700807A08 /* TrackRecordingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED49D76F2CF0E3A8004AF27E /* TrackRecordingViewController.swift */; };
ED3EAC202B03C88100220A4A /* BottomTabBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3EAC1F2B03C88100220A4A /* BottomTabBarButton.swift */; };
ED43B8BD2C12063500D07BAA /* DocumentPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED43B8BC2C12063500D07BAA /* DocumentPicker.swift */; };
ED46DDCE2D098A0B007CACD6 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED46DDCD2D098A0B007CACD6 /* WidgetKit.framework */; };
ED46DDD02D098A0B007CACD6 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED46DDCF2D098A0B007CACD6 /* SwiftUI.framework */; };
ED46DDE12D098A0C007CACD6 /* OMapsWidgetExtensionExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = ED46DDCC2D098A0B007CACD6 /* OMapsWidgetExtensionExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
ED4DC7772CAEDECC0029B338 /* ProductsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED4DC7752CAEDECC0029B338 /* ProductsViewModel.swift */; };
ED4DC7782CAEDECC0029B338 /* ProductButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED4DC7732CAEDECC0029B338 /* ProductButton.swift */; };
ED4DC7792CAEDECC0029B338 /* ProductsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED4DC7742CAEDECC0029B338 /* ProductsViewController.swift */; };
@ -694,6 +708,13 @@
remoteGlobalIDString = 6741A93D1BF340DE002C974C;
remoteInfo = OMaps;
};
ED46DDDF2D098A0C007CACD6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = ED46DDCB2D098A0B007CACD6;
remoteInfo = OMapsWidgetExtensionExtension;
};
FA456C4626BDCC8E00B83C20 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FA456C4026BDCC8E00B83C20 /* shaders.xcodeproj */;
@ -738,6 +759,17 @@
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
ED46DDE22D098A0C007CACD6 /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
ED46DDE12D098A0C007CACD6 /* OMapsWidgetExtensionExtension.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
FA456C4E26BDCCC300B83C20 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@ -1406,9 +1438,23 @@
ED1080A62B791CFE0023F27E /* SocialMediaCollectionViewHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocialMediaCollectionViewHeader.swift; sourceTree = "<group>"; };
ED1263AA2B6F99F900AD99F3 /* UIView+AddSeparator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+AddSeparator.swift"; sourceTree = "<group>"; };
ED1ADA322BC6B1B40029209F /* CarPlayServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarPlayServiceTests.swift; sourceTree = "<group>"; };
ED2D72372D1315B100660FBF /* TrackRecordingActivityManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackRecordingActivityManager.swift; sourceTree = "<group>"; };
ED2D742C2D14337500660FBF /* AppLogo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLogo.swift; sourceTree = "<group>"; };
ED2D742D2D14337500660FBF /* LiveActivityManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveActivityManager.swift; sourceTree = "<group>"; };
ED2D742E2D14337500660FBF /* StatisticDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticDetailView.swift; sourceTree = "<group>"; };
ED2D742F2D14337500660FBF /* StatisticValueView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticValueView.swift; sourceTree = "<group>"; };
ED2D74302D14337500660FBF /* TrackRecordingLiveActivityAttributes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackRecordingLiveActivityAttributes.swift; sourceTree = "<group>"; };
ED2D74312D14337500660FBF /* TrackRecordingLiveActivityConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackRecordingLiveActivityConfiguration.swift; sourceTree = "<group>"; };
ED2D74322D14337500660FBF /* TrackRecordingLiveActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackRecordingLiveActivityView.swift; sourceTree = "<group>"; };
ED2D74342D14337500660FBF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
ED2D74352D14337500660FBF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
ED2D74362D14337500660FBF /* OMapsWidgetExtensionBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OMapsWidgetExtensionBundle.swift; sourceTree = "<group>"; };
ED3EAC1F2B03C88100220A4A /* BottomTabBarButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarButton.swift; sourceTree = "<group>"; };
ED43B8BC2C12063500D07BAA /* DocumentPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentPicker.swift; sourceTree = "<group>"; };
ED46DD922D06F804007CACD6 /* TrackRecordingButtonArea.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackRecordingButtonArea.swift; sourceTree = "<group>"; };
ED46DDCC2D098A0B007CACD6 /* OMapsWidgetExtensionExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = OMapsWidgetExtensionExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
ED46DDCD2D098A0B007CACD6 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
ED46DDCF2D098A0B007CACD6 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
ED48BBB817C2B1E2003E7E92 /* CircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleView.h; sourceTree = "<group>"; };
ED48BBB917C2B1E2003E7E92 /* CircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleView.m; sourceTree = "<group>"; };
ED49D76F2CF0E3A8004AF27E /* TrackRecordingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackRecordingViewController.swift; sourceTree = "<group>"; };
@ -1823,6 +1869,15 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
ED46DDC92D098A0B007CACD6 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
ED46DDD02D098A0B007CACD6 /* SwiftUI.framework in Frameworks */,
ED46DDCE2D098A0B007CACD6 /* WidgetKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@ -1864,6 +1919,7 @@
children = (
6741AA5D1BF340DE002C974C /* Organic Maps (Debug).app */,
ED097E762BB80C320006ED01 /* OMapsTests.xctest */,
ED46DDCC2D098A0B007CACD6 /* OMapsWidgetExtensionExtension.appex */,
);
name = Products;
sourceTree = "<group>";
@ -1890,6 +1946,7 @@
29B97317FDCFA39411CA2CEA /* Resources */,
F6E2FBFB1E097B9F0083EBEC /* UI */,
ED1ADA312BC6B19E0029209F /* Tests */,
ED2D74372D14337500660FBF /* OMapsWidgetExtension */,
);
indentWidth = 2;
name = Maps;
@ -1958,6 +2015,8 @@
FA853BD026BC3B8A0026D455 /* libsuccinct.a */,
FA853BA626BC3ACE0026D455 /* CoreApi.framework */,
FA14E683276014C10066E453 /* libz.1.tbd */,
ED46DDCD2D098A0B007CACD6 /* WidgetKit.framework */,
ED46DDCF2D098A0B007CACD6 /* SwiftUI.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -3124,6 +3183,31 @@
path = Tests;
sourceTree = "<group>";
};
ED2D74332D14337500660FBF /* LiveActivity */ = {
isa = PBXGroup;
children = (
ED2D742C2D14337500660FBF /* AppLogo.swift */,
ED2D742D2D14337500660FBF /* LiveActivityManager.swift */,
ED2D742E2D14337500660FBF /* StatisticDetailView.swift */,
ED2D742F2D14337500660FBF /* StatisticValueView.swift */,
ED2D74302D14337500660FBF /* TrackRecordingLiveActivityAttributes.swift */,
ED2D74312D14337500660FBF /* TrackRecordingLiveActivityConfiguration.swift */,
ED2D74322D14337500660FBF /* TrackRecordingLiveActivityView.swift */,
);
path = LiveActivity;
sourceTree = "<group>";
};
ED2D74372D14337500660FBF /* OMapsWidgetExtension */ = {
isa = PBXGroup;
children = (
ED2D74332D14337500660FBF /* LiveActivity */,
ED2D74342D14337500660FBF /* Assets.xcassets */,
ED2D74352D14337500660FBF /* Info.plist */,
ED2D74362D14337500660FBF /* OMapsWidgetExtensionBundle.swift */,
);
path = OMapsWidgetExtension;
sourceTree = "<group>";
};
ED43B8B92C12061600D07BAA /* DocumentPicker */ = {
isa = PBXGroup;
children = (
@ -3972,11 +4056,13 @@
6741A9A01BF340DE002C974C /* Sources */,
6741AA311BF340DE002C974C /* Frameworks */,
4740184523F5BDE900A93C81 /* Embed Frameworks */,
ED46DDE22D098A0C007CACD6 /* Embed Foundation Extensions */,
);
buildRules = (
);
dependencies = (
FA456C4D26BDCC9400B83C20 /* PBXTargetDependency */,
ED46DDE02D098A0C007CACD6 /* PBXTargetDependency */,
);
name = OMaps;
productName = Maps;
@ -4001,6 +4087,25 @@
productReference = ED097E762BB80C320006ED01 /* OMapsTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
ED46DDCB2D098A0B007CACD6 /* OMapsWidgetExtensionExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = ED46DDE62D098A0C007CACD6 /* Build configuration list for PBXNativeTarget "OMapsWidgetExtensionExtension" */;
buildPhases = (
ED46DDC82D098A0B007CACD6 /* Sources */,
ED46DDC92D098A0B007CACD6 /* Frameworks */,
ED46DDCA2D098A0B007CACD6 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = OMapsWidgetExtensionExtension;
packageProductDependencies = (
);
productName = OMapsWidgetExtensionExtension;
productReference = ED46DDCC2D098A0B007CACD6 /* OMapsWidgetExtensionExtension.appex */;
productType = "com.apple.product-type.app-extension";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@ -4023,6 +4128,9 @@
};
};
};
ED46DDCB2D098A0B007CACD6 = {
CreatedOnToolsVersion = 16.0;
};
};
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Maps" */;
@ -4089,6 +4197,7 @@
targets = (
6741A93D1BF340DE002C974C /* OMaps */,
ED097E752BB80C320006ED01 /* OMapsTests */,
ED46DDCB2D098A0B007CACD6 /* OMapsWidgetExtensionExtension */,
);
};
/* End PBXProject section */
@ -4294,6 +4403,15 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
ED46DDCA2D098A0B007CACD6 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
ED2D74382D14337500660FBF /* Assets.xcassets in Resources */,
ED2D74392D14337500660FBF /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -4783,6 +4901,21 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
ED46DDC82D098A0B007CACD6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
ED2D743A2D14337500660FBF /* AppLogo.swift in Sources */,
ED2D743B2D14337500660FBF /* LiveActivityManager.swift in Sources */,
ED2D743C2D14337500660FBF /* StatisticDetailView.swift in Sources */,
ED2D743D2D14337500660FBF /* StatisticValueView.swift in Sources */,
ED2D743E2D14337500660FBF /* TrackRecordingLiveActivityAttributes.swift in Sources */,
ED2D743F2D14337500660FBF /* TrackRecordingLiveActivityConfiguration.swift in Sources */,
ED2D74402D14337500660FBF /* TrackRecordingLiveActivityView.swift in Sources */,
ED2D74412D14337500660FBF /* OMapsWidgetExtensionBundle.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
@ -4791,6 +4924,11 @@
target = 6741A93D1BF340DE002C974C /* OMaps */;
targetProxy = ED097E7A2BB80C320006ED01 /* PBXContainerItemProxy */;
};
ED46DDE02D098A0C007CACD6 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = ED46DDCB2D098A0B007CACD6 /* OMapsWidgetExtensionExtension */;
targetProxy = ED46DDDF2D098A0C007CACD6 /* PBXContainerItemProxy */;
};
FA456C4D26BDCC9400B83C20 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = shaders_metal;
@ -5027,6 +5165,62 @@
};
name = Release;
};
ED46DDE32D098A0C007CACD6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 9Z6432XD7L;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = OMapsWidgetExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = OMapsWidgetExtension;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 Organic Maps. All rights reserved.";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
PRODUCT_BUNDLE_IDENTIFIER = app.organicmaps.debug.OMapsWidgetExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
ED46DDE42D098A0C007CACD6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Z6432XD7L;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = OMapsWidgetExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = OMapsWidgetExtension;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 Organic Maps. All rights reserved.";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = app.organicmaps.debug.OMapsWidgetExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
FAAB411B149BA84700C245B1 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 347526FA1DC0B00F00918CF5 /* common-debug.xcconfig */;
@ -5135,6 +5329,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
ED46DDE62D098A0C007CACD6 /* Build configuration list for PBXNativeTarget "OMapsWidgetExtensionExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
ED46DDE32D098A0C007CACD6 /* Debug */,
ED46DDE42D098A0C007CACD6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;

View file

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,35 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "logo.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widgetkit-extension</string>
</dict>
</dict>
</plist>

View file

@ -0,0 +1,9 @@
import SwiftUI
struct AppLogo: View {
var body: some View {
Image(.logo)
.resizable()
.aspectRatio(contentMode: .fit)
}
}

View file

@ -0,0 +1,26 @@
import ActivityKit
import SwiftUI
@available(iOS 16.2, *)
final class LiveActivityManager {
static func startActivity<T: ActivityAttributes>(_ attributes: T, content: ActivityContent<T.ContentState>) throws -> Activity<T> {
return try Activity.request(attributes: attributes, content: content, pushType: nil)
}
static func update<T: ActivityAttributes>(_ activity: Activity<T>, content: ActivityContent<T.ContentState>) {
Task {
await activity.update(content)
}
}
static func stop(_ activity: Activity<some ActivityAttributes>) {
// semaphore is used for removing the activity during the app termination
let semaphore = DispatchSemaphore(value: 0)
Task {
await activity.end(nil, dismissalPolicy: .immediate)
semaphore.signal()
}
semaphore.wait()
}
}

View file

@ -0,0 +1,28 @@
import SwiftUI
struct StatisticDetailView: View {
private let title: String
private let subtitle: String
init(title: String, subtitle: String) {
self.title = title
self.subtitle = subtitle
}
var body: some View {
VStack(alignment: .leading) {
Text(title)
.contentTransition(.numericText())
.font(.system(size: 14, weight: .bold).monospacedDigit())
.minimumScaleFactor(0.5)
.lineLimit(1)
.foregroundStyle(.white)
Text(subtitle)
.font(.system(size: 10))
.minimumScaleFactor(0.5)
.lineLimit(2)
.multilineTextAlignment(.center)
.foregroundStyle(.white)
}
}
}

View file

@ -0,0 +1,17 @@
import SwiftUI
struct StatisticValueView: View {
private let value: String
init(_ value: String) {
self.value = value
}
var body: some View {
Text(value)
.contentTransition(.numericText())
.minimumScaleFactor(0.1)
.font(.title3.bold().monospacedDigit())
.foregroundStyle(.white)
}
}

View file

@ -0,0 +1,17 @@
import ActivityKit
import AppIntents
struct TrackRecordingLiveActivityAttributes: ActivityAttributes {
struct ContentState: Codable, Hashable {
struct StatisticsViewModel: Codable, Hashable {
let key: String
let value: String
}
let duration: StatisticsViewModel
let distance: StatisticsViewModel
let ascent: StatisticsViewModel
let descent: StatisticsViewModel
let maxElevation: StatisticsViewModel
let minElevation: StatisticsViewModel
}
}

View file

@ -0,0 +1,26 @@
import WidgetKit
import SwiftUI
struct TrackRecordingLiveActivityConfiguration: Widget {
@Environment(\.colorScheme) private var colorScheme
var body: some WidgetConfiguration {
ActivityConfiguration(for: TrackRecordingLiveActivityAttributes.self) { context in
TrackRecordingLiveActivityView(state: context.state)
} dynamicIsland: { context in
DynamicIsland {
DynamicIslandExpandedRegion(.center) {
// TODO: Implement the expanded view
}
} compactLeading: {
AppLogo()
} compactTrailing: {
StatisticValueView(context.state.duration.value)
} minimal: {
// TODO: Implement the minimal view
}
}
}
}

View file

@ -0,0 +1,71 @@
import SwiftUI
import WidgetKit
#if canImport(ActivityKit)
struct TrackRecordingLiveActivityView: View {
let state: TrackRecordingLiveActivityAttributes.ContentState
var body: some View {
VStack(alignment: .leading, spacing: 12) {
HStack(alignment: .top, spacing: 24) {
StatisticValueView(state.duration.value)
StatisticValueView(state.distance.value)
Spacer()
AppLogo()
.frame(width: 20, height: 20)
}
.padding([.top, .leading, .trailing], 16)
HStack(alignment: .top, spacing: 20) {
StatisticDetailView(title: state.ascent.value, subtitle: state.ascent.key)
StatisticDetailView(title: state.descent.value, subtitle: state.descent.key)
StatisticDetailView(title: state.maxElevation.value, subtitle: state.maxElevation.key)
StatisticDetailView(title: state.minElevation.value, subtitle: state.minElevation.key)
}
.padding([.leading, .trailing, .bottom], 16)
}
.background(.primary.opacity(0.15))
}
}
#if DEBUG
struct TrackRecordingLiveActivityWidget_Previews: PreviewProvider {
static var previews: some View {
Group {
let activityAttributes = TrackRecordingLiveActivityAttributes()
let activityState = TrackRecordingLiveActivityAttributes.ContentState(
duration: .init(
key: "Duration",
value: "1h 12min"
),
distance: .init(
key: "Distance",
value: "12 km"
),
ascent: .init(
key: "Ascent",
value: "100 m"
),
descent: .init(
key: "Descent",
value: "100 m"
),
maxElevation: .init(
key: "Max Elevation",
value: "100 m"
),
minElevation: .init(
key: "Min Elevation",
value: "10 m"
)
)
activityAttributes
.previewContext(activityState, viewKind: .content)
.previewDisplayName("Notification")
}
}
}
#endif
#endif

View file

@ -0,0 +1,9 @@
import WidgetKit
import SwiftUI
@main
struct OMapsWidgetExtensionBundle: WidgetBundle {
var body: some Widget {
TrackRecordingLiveActivityConfiguration()
}
}