Add an Apple Watch face complication that opens the app

A static WidgetKit accessory widget (launcher only — no data sharing,
App Group, or entitlements). Tapping any accessory widget opens its
containing app, so this is enough to place a Workouts button on the
watch face. Supports the circular, corner, inline, and rectangular
accessory families.

New 'Workouts Watch Widget' app-extension target embedded in the watch
app via project.yml.
This commit is contained in:
2026-06-20 22:15:26 -04:00
parent 8f69497b24
commit 192aa6f95a
5 changed files with 135 additions and 0 deletions
+20
View File
@@ -78,6 +78,9 @@ targets:
excludes:
- "Resources/Info-*.plist"
- "Resources/*.entitlements"
dependencies:
- target: Workouts Watch Widget
embed: true
postBuildScripts:
- script: '"${SRCROOT}/Scripts/update_build_number.sh"'
name: Update Build Number
@@ -98,3 +101,20 @@ targets:
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME: AccentColor
TARGETED_DEVICE_FAMILY: "4"
DEVELOPMENT_ASSET_PATHS: "\"Workouts Watch App/Preview Content\""
# ---- watchOS widget extension (a launcher complication for the watch face) --
Workouts Watch Widget:
type: app-extension
platform: watchOS
sources:
- path: Workouts Watch Widget
excludes:
- "Resources/Info-*.plist"
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: dev.rzen.indie.Workouts.watchkitapp.widget
INFOPLIST_FILE: "Workouts Watch Widget/Resources/Info-WatchWidget.plist"
GENERATE_INFOPLIST_FILE: false
SWIFT_STRICT_CONCURRENCY: complete
WATCHOS_DEPLOYMENT_TARGET: "26.0"
TARGETED_DEVICE_FAMILY: "4"