I am looking into the new CarPlay support for systemSmall widgets introduced in iOS 26 (Apple documentation).
I am trying to figure out if there is a way to programmatically detect whether the widget is currently being displayed on the iPhone/iPad home/lock screen or in CarPlay.
So far, I haven’t found any information in the documentation or APIs that indicate how to distinguish between these environments. Is there an API, environment value, or best practice for handling this scenario?
Thanks in advance for any insights!
WidgetKit
RSS for tagShow relevant, glanceable content from your app on iOS and iPadOS Home Screen and Lock Screen, macOS Desktop, Apple Watch Smart Stack and Complications, and in StandBy mode on iPhone.
Posts under WidgetKit tag
200 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
The calendar widget and buttons shows a lightened / material background behind some content when the widget is in clear / tinted mode (example here: https://developer.apple.com/videos/play/wwdc2025/278?time=72).
How can this be done? I tried applying a material and glass background to a view using the .background(...) modifier, but the background is made white.
Text("Hello")
.padding()
.background {
ContainerRelativeShape()
.fill(.thinMaterial)
}
Text("Hello")
.padding()
.background {
ContainerRelativeShape()
.glassEffect()
}
Is this not supported, a bug, or am I doing something wrong?
Hi everyone,
I’m working on implementing Live Activities in my app, and I’ve encountered an issue where the Live Activity updates work intermittently when the app is in the background. Sometimes they update correctly, but at other times, they don’t update at all, even though they should be running in the background.
However, when the app is brought to the foreground, the updates happen correctly.
A few things I’ve checked:
The app is using ActivityKit to update the Live Activity with Activity.update().
I’ve enabled the necessary background modes in the Capabilities section.
Is there a possibility that I’m hitting the system budget limit while experiencing this issue? If this is a limitation, how can I avoid it or manage this situation?
Has anyone else faced this issue? Any advice or potential solutions would be greatly appreciated!
Thank you!
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
Swift
SwiftUI
WidgetKit
ActivityKit
In the iOS 26 developer preview, I noticed that the new Liquid Glass style only applies when the user’s home screen theme is set to transparent. Is it possible to allow users to directly set the new Liquid Glass style for widgets, instead of having it tied to the home screen theme setting?
Hi everyone!
My Apple Watch app has relied for years on the WKApplication.scheduleBackgroundRefresh(...) method to keep the app updated in the background. The system would reliably trigger WKApplicationDelegate.handle(_:), where I would then schedule the next refresh task (usually 15 minutes later).
As stated in the documentation, as long as there is a complication on the watch face, these background tasks should run at a relatively stable frequency.
However, this approach seems to have stopped working on watchOS 26. I no longer receive any WKApplicationRefreshBackgroundTask at all. Has anyone else experienced this issue?
Hi everyone!
I've noticed a color rendering issue with Home Screen widgets on iOS 26: the colors displayed in widgets are inconsistent with those shown inside the app. At first, I suspected this might be caused by differences in color spaces, but even after explicitly specifying the color space for SwiftUI.Color or UIColor, the widget colors remain incorrect.
Steps to reproduce:
Create a new iOS project in Xcode 26 beta 6.
Add a new Widget Extension target.
Use the following Widget view code:
struct MyWidgets: Widget {
let kind: String = "MyWidgets"
var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: Provider()) { entry in
let white = Color(.sRGB, red: 1, green: 1, blue: 1)
let veryLightGray = Color(.sRGB, red: 0.96, green: 0.96, blue: 0.96)
let lightGray = Color(.sRGB, red: 0.9, green: 0.9, blue: 0.9)
VStack(spacing: 0) {
Rectangle()
.foregroundStyle(veryLightGray) // 👈
Rectangle()
.foregroundStyle(lightGray) // 👈
}
.containerBackground(white, for: .widget) // 👈
}
.configurationDisplayName("My Widget")
}
}
⬆️ In-app, the colors are correct: the top block is a very light gray (white=0.96)✅, and the bottom block is a regular gray (white=0.90)✅.
However, on the Home Screen widget, the result is as follows:
⬆️ The top light gray block blends completely into the white background and is indistinguishable; the bottom gray block also appears lighter than it does in-app ❌. This issue occurs both on the simulator and on real devices. (Interestingly, the colors are correct in the Xcode Preview.)
Whether I declare colors in code (SwiftUI.Color or UIColor) or in the Asset Catalog, the widget's color rendering does not match expectations.
What's even stranger is that if I add an extra pure white block (white=1.0) to the view, it immediately affects all the colors in the widget:
This whole behavior makes it very difficult to set accurate colors for widgets on iOS 26. While it seems related to glass effect rendering and color space handling, I still feel there might be a bug in the implementation.
My company's app has a few widgets and a couple of them we do not want to show up on CarPlay due to safety concerns when iOS 26 releases. I understand Apple's recommended way to prevent users from using your widget in CarPlay is to use the .disfavoredLocations([.carPlay], for: [.systemSmall]), and this puts your widget in the 'Other' section of the widgets.
https://developer.apple.com/download/files/CarPlay-Developer-Guide.pdf
However, this .carPlay widget location is only available in Xcode 26, and our app cannot be built on Xcode 26 yet due to some build errors. We are able to fix those build errors in a separate branch, but we won't be doing our official release builds on Xcode 26 until it is out of beta, which is usually right before iOS 26 officially releases to general audiences. We release our app versions on a monthly cadence, so the version that will be out when iOS 26 comes out is already in testing.
Is there any existing way we can disable this widget on CarPlay so it does not appear to work when tapped? Currently, it opens our CarPlay app, but the CarPlay app does nothing with it. On the iPhone, when you tap the widget it opens our app and performs a function.
We don't wan't to disable it on the iPhone, just when it's on CarPlay. We don't have time before the app release to implement the same functionality on our CarPlay app. I haven't found any reliable way to detect if the widget is running in the CarPlay location versus the iPhone home screen.
Thanks in advance for any assistance.
I'm having some trouble getting my widget to display how I want when the user has a tint applied to their home screen. The issue I'm having is with a Text() element, as well as a LinearGradient I am displaying on top of my image. The text should always be white, and the gradient is always black with varying levels of opacity.
I've managed to fix this issue with images displayed in my widget by leveraging
widgetAccentedRenderingMode(.fullColor)
however, there does not seem to be an equivalent of this for non-Image components. I'm aware of
.widgetAccentable(false)
but as I understand it, elements are already considered not accentable by default and you need to explicitly declare widgetAccentable(true) to add them to the accent group. I've tried specifying this to be false up and down my view hierarchy just to see if something will stick but no luck.
Are there any other levers I can pull to preserve the declared colors for my text and gradient components? The images I am displaying is album artwork where preserving the original image is integral, but the tinted text color and overlaid gradient often clash or just looks bad in general. Is there a solution for colored primitive elements?
After reinstalling the App,the ControlWidget Gallery doesn't show custom SF Symbols
I want to display a grid of items in my widget similar to the systemLarge Shortcuts app widget. I use clipShape(.containerRelative) to get the widget corner radius, but items that do not touch a corner in any way do not get this treatment. This is even worse with the extra large widget. How can I apply the corner radius of the widget minus the padding across all items? It does not seem like the radius is exposed outside of that special shape.
I struggling in getting Xcode Cloud to work with a stand alone watch app. This app has the following three targets and each bundle identifier is set up in the Identifiers section of the developer portal.
iphone container target called Unleashed abc.xyz.Unleashed
watch target called Unleashed Watch App abc.xyz.Unleashed.watchkitapp
watch target called Unleashed WidgetExtension abc.xyz.Unleashed.watchkitapp.Unleashed-Widget
I have a App Store provisioning set up for abc.xyz.Unleashed.watchkitapp
The app runs fine in the watch simulator, but fails with the following when I do an Xcode Cloud build
Export archive for ad-hoc distribution
Export archive for development distribution
Export archive for app-store distribution
When I expand each one of these errors it reports:
Command exited with non-zero exit-code: 70
I also tried archiving the project in Xcode then selected the Archive but it won't let me validate because that button is disabled.
Very confused I have successfully used Xcode Cloud for a phone app but am having a problem with this watch app that has a widget
During the WWDC Session called "Design widgets for visionOS" the presenter says:
You can choose whether the background of your widget participates in tinting. If you opted out, for example to preserve a photo or illustration, make sure it still looks good alongside the selected color palette.
Unfortunately, this session has no example code. Can someone point me to the correct way to do this? Is there a modifier we can use on views?
(reposting this in the correct topic/subtopic)
I’m implementing a Control Widget for watchOS 26 Beta 5, using .promptsForUserConfiguration() so that users can select an option from an enum when adding the widget.
The overall functionality works fine, but when users configure the option, the enum’s corresponding text is not properly localized. My enum is defined like this:
static var caseDisplayRepresentations: [XXXType: DisplayRepresentation] {
[
XX1: .init(title: .init("text1", table: "xxx")),
XX2: .init(title: .init("text2", table: "xxx")),
]
}
After the configuration is completed and the Control Widget appears in the Control Center or Smart Stack, the text is displayed correctly.
Same code on iOS work perfect.
I am building a widget that supports 2 different widget kinds, each supporting systemSmall, systemMedium, and systemLarge size families.
My widget does download and display images so I expect memory usage to be on the higher end, but in debugging some memory issues, I notice that when I build my widget scheme to a physical device, things start off reasonable at ~12MB of memory usage. But as I change the widgets intent, add the other widget kind, or add different widget size families, this memory usage grows until it ultimately hits the 30MB cap.
My question is, is the 30MB memory limit spread across all my supported widget kinds/sizes? Or does each individual widget get its own 30MB cap?
i.e., if I have systemMedium Widget A and systemLarge Widget B, are they sharing that 30MB memory limit?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
Extensions
Instruments
Debugging
WidgetKit
I'm working on the control widget which should display the SF image on the UI, but I have found that it cannot be displayed stably. I have eight CarCtrlWidgets which is about the type doorLock、chargeCover、frontBox、 locateCarLight、 locateCarHorn、 ventilate、 backBox and airCondition, it should all be showed but sometime they only show the text and placeholder. I'm aware of the images should be custom SF image and I can see them to show perfectly sometimes, but in other time it is just failed. This's really confused me, can anyone help me out?
deviceversion 18.5;device model iPhone 16 pro;
Background
I'm developing an iOS app with Live Activities that allows users to select custom background images. While these custom images display correctly in widgets, they fail to appear in Live Activities on both Lock Screen and Dynamic Island, despite successful image loading and data transfer.
Technical Details
iOS Version: Testing on iOS 17.2+
Image Storage: Using App Group shared container for image sharing between main app and widget extension
Image Loading: Successfully confirmed via logs - images load correctly with proper dimensions
UI Framework: SwiftUI with ActivityKit
What Works
✅ Custom images display correctly in Home Screen widgets
✅ Built-in bundled images work in Live Activities
✅ Image data successfully transfers via App Group shared container
✅ Image loading logs show successful UIImage creation with correct dimensions
What Doesn't Work
❌ Custom user images don't display in Live Activities (Lock Screen)
❌ Custom user images don't display in Dynamic Island
❌ Images appear as black/gray background despite successful loading
Code Implementation
I've tried multiple approaches:
1. SwiftUI Image approach:
Image(uiImage: customImage)
.resizable()
.aspectRatio(contentMode: .fill)
2. containerBackground API approach:
.containerBackground(for: .widget) {
Image(uiImage: customImage)
.resizable()
.aspectRatio(contentMode: .fill)
}
3. UIKit wrapper approach:
struct UIImageViewWrapper: UIViewRepresentable {
let image: UIImage
func makeUIView(context: Context) -> UIImageView {
let imageView = UIImageView(image: image)
imageView.contentMode = .scaleAspectFill
return imageView
}
func updateUIView(_ uiView: UIImageView, context: Context) {
uiView.image = image
}
}
Observations
Images load successfully (confirmed via console logs)
File paths are correct and accessible
Same image loading code works perfectly in widgets
When testing with UIKit approach, a red prohibition icon appears, suggesting system restrictions
Questions
Is there a technical limitation preventing user-provided images from displaying in Live Activities?
Are there specific security restrictions for Live Activity backgrounds that don't apply to widgets?
Is this behavior intentional based on Apple's design guidelines for Live Activities?
What's the recommended approach for custom backgrounds in Live Activities?
Apple Documentation Reference
I found this guidance in "10 questions with the Live Activities team":
"The Dynamic Island is most immersive when you don't provide background color or imagery — think of it purely as a canvas of foreground view elements."
However, this seems to be design guidance rather than a technical restriction, and it doesn't specifically address Lock Screen Live Activities.
Expected Behavior
Custom user images should display as backgrounds in Live Activities, similar to how they work in widgets.
Current Workaround
I've implemented a color extraction system that generates gradients based on the dominant colors of user images, but users specifically want to see their actual images.
Has anyone successfully implemented custom user images as Live Activity backgrounds, or can Apple clarify the intended behavior and limitations?
Thank you for any insights!
Summary
When a SwiftUI widget uses a Link containing an Image modified with .widgetAccentedRenderingMode (using any mode except .fullColor), tapping the image on the widget launches the app but does not pass the expected deep link URL to the SceneDelegate.
Steps to Reproduce
Create a SwiftUI Widget View with a Link:
struct ImageView: View {
var image: UIImage
var body: some View {
Link(URL(string: "myapp://image")!) {
Image(uiImage: image)
.resizable()
.widgetAccentedRenderingMode(.accentedDesaturated) // or any mode other than .fullColor
.scaledToFill()
.clipped()
}
}
}
Add Custom URL Scheme in Info.plist:
<dict>
<key>CFBundleURLName</key>
<string>com.company.myapp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp</string>
</array>
</dict>
Implement Deep Link Handling in SceneDelegate:
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let url = connectionOptions.urlContexts.first?.url {
handle(url)
}
}
func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) {
if let url = urlContexts.first?.url {
handle(url)
}
}
private func handle(_ url: URL) {
// Process URL here
}
Run the application on a device or simulator.
Add the widget to the Home Screen.
Tap the image inside the widget.
Expected Result
The application launches and receives the URL in SceneDelegate, as expected.
Actual Result
The application launches, but the URL is not passed to SceneDelegate.
Both connectionOptions.urlContexts and openURLContexts are empty.
During the WWDC Session called "Design widgets for visionOS" the presenter says:
You can choose whether the background of your widget participates in tinting. If you opted out, for example to preserve a photo or illustration, make sure it still looks good alongside the selected color palette.
https://developer.apple.com/videos/play/wwdc2025/255
Unfortunately, this session has no example code. Can someone point me to the correct way to do this? Is there a modifier we can use on views?
When a user selects one the tint colors using the configuration screen, we would like to prevent some views from being tinted.
Pretty much the title. I am a noob in apple app development and currently starting it out. I got stuck in this. Can anyone let me know that how can i generate the token for starting live activity in terminated state? I have tried multiple times to find that this one is not working in terminated state. How can I overcome this? Is there any solution or workaround?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
iOS
iPhone
Notification Center
WidgetKit
I updated my IntentWidgetProvider recommendations() to return an empty array instead of all my previous static IntentRecommendation to allow my widgets to finally be configurable.
When I go to the watch widget chooser I see samples of my widgets OK:
But when I touch the sample would should bring up my configurations, I get "Unable to Load":
Anybody see this or have any ideas? Thanks.