Post

Replies

Boosts

Views

Activity

Widget link broken by `.desaturated` image rendering mode
Using desaturated mode on an image in a widget will break any links or buttons that use the image as their 'label'. Using the following will just open the app as if there was no link at all - therefore just using the fallback userActivity handler, or any .widgetURL() urls provided. Link(destination: URL(string: "bug://never-works")!) { Image("puppy") .widgetAccentedRenderingMode(.desaturated) } The same goes for buttons: Button(intent: MyDemoIntent()) { Image("puppy") .widgetAccentedRenderingMode(.desaturated) } I've tried hacky solutions like putting the link behind the image using a ZStack, and disabling hit testing on the image, but they don't work. Anything else to try? Logged as Feedback #15152620.
2
1
239
Sep ’24
Text with relative date - sizing bug when used in widget
When using a SwiftUI Text view with a relative date, with .minimumScaleFactor(), in a widget, the Text will always be shown at the minimum scale rather than the largest size possible. This started happening in iOS17, and is still the case in iOS18. Therefore, if for example, you wanted to have a Text, showing a relative date in a countdown, with a "minimumScaleFactor" of 0.5, it will always show at 0.5 scale, no matter how much space there is available. Text(.now, style: .relative) .font(.system(size: 80, weight: .bold, design: .rounded)) .minimumScaleFactor(0.2) ^^ will always show at 0.2 scale (in a widget) even if there's space for much more. This is only the case in widgets, not in the main app. Similarly, if you try to use "ViewThatFits" instead of "minimumScaleFactor", it will choose the smallest view, even if larger ones would fit. Screenshot demonstrates the issue - all the countdown text views should be similarly large. This is not an issue with lack of vertical spacing causing the more flexible views to shrink - it behaves the same even if there's loads of vertical space too. Maybe related, but trying to use ".fixedSize()" with a relative date Text view in a widget results in a completely blank widget. Seems like a system bug rather than anything wrong in my code - I've logged it as Feedback (#15151577) with a demo project. Has anybody else come up against these issues - any solutions?
4
0
281
Sep ’24
iOS18 Control Widget that opens parent app
I feel like this is probably really easy and hopefully I'm just doing something stupid, but I can't get a control to open the app it belongs to. Taking the intent itself directly from the example code, and it does nothing when the button is pressed. struct OpenAppWidget: ControlWidget { var body: some ControlWidgetConfiguration { StaticControlConfiguration( kind: "com.dfjkldfsfrw.ControlCenterWidgetDemo.OpenApp" ) { /// This one - based on the demo code - doesn't work on simulator or device ControlWidgetButton(action: LaunchAppIntent()) { Label("Launch App", systemImage: "arrow.up.right") } } .displayName("Launch App") .description("A an example control that launches the parent app.") } } struct LaunchAppIntent: OpenIntent { static var title: LocalizedStringResource = "Launch App" @Parameter(title: "Target") var target: LaunchAppEnum } enum LaunchAppEnum: String, AppEnum { case timer case history static var typeDisplayRepresentation = TypeDisplayRepresentation("Productivity Timer's app screens") static var caseDisplayRepresentations = [ LaunchAppEnum.timer : DisplayRepresentation("Timer"), LaunchAppEnum.history : DisplayRepresentation("History") ] } I've tried adding a perform( function to the intent, and setting openAppWhenRun to true, but they don't seem to make a difference. I've also tried using an OpenURLIntent in the result of the button's intent to open the app based on a custom url scheme, but whilst that seems to work in the simulator, it doesn't work on a real device. What am I missing?
3
2
887
Aug ’24
Subscription Introductory Pricing: Doesn't display intro price in confirmation alert
I'm currently testing introductory pricing for one of our apps. I've configured the introductory price in iTunesConnect, and the introductoryPrice `SKProductDiscount` is present in the `SKProduct` that I receive from my `SKProductsRequest`, so I can show the details of the deal to the user.When actually purchasing the product (an auto-renewable subscription) in sandbox mode, the price that appears in the confirmation pop-up is the full-price. It doesn't mention anything about the introductory price or period.1. Is this just a(nother) limitation of the sandbox for testing IAPs, or is there something else that I should do to explicitly put the introductory price through the queue instead of the full price?2. If there's nothing I need to do to explicitly use the introductory price instead of the full-price. Is there another way that I can choose to only provide the introductory pricing to certain users?
5
0
3.8k
Feb ’18