Post

Replies

Boosts

Views

Activity

Reply to How to collect a user's real email address when using Sign in with Apple and Private Relay?
Hide My Email is a service designed to allow users to HIDE THEIR EMAIL from apps and websites. To you, as the app developer, the email you are given is a valid email address, and you should treat it as such. The issue is in this bit of your post: For marketing reasons, I would prefer to have the user’s real email address instead of the relay email. You're not entitled to override someone's preferences and force them to receive marketing emails from you. Bypassing a Hide My Email address is doing exactly that. If the user decides they no longer want to receive emails from you, they can deactivate that email address and not receive your emails. That is their right. You have no right to override this, or to force someone to provide a different or non-'privaterelay' email address. If I download your app, and it refuses to allow a Hide My Email address, your app would be deleted immediately and I'd never use anything from you again. I'm pretty sure I'm not alone in this.
2w
Reply to Contrast for texts in widgets with image backgrounds transparent mode
But I can't help you if I don't know how that widget has been created. How are the four images displayed? What modifiers are you using? Is that in Clear or Tinted mode?! I've suggested the code from WidgetKit that you can use to change the appearance of the image in the different widget styles. Can you maybe apply them to the four images in the widget and show us what it looks like in Clear and Tinted modes? .vibrant mode is used when a widget is on the Lock Screen, in StandBy, and also in Tinted and Clear modes, and you either don't show an image background, or - if your widget requires an image, like Apple's Photos widget - then you need to desaturate your image and accent your text. Try some different options, post the code used, and a screenshot of how it looks.
2w
Reply to Contrast for texts in widgets with image backgrounds transparent mode
Right, but the code you've posted isn't making use of any of the suggestions I made - which are from WidgetKit. Those bits of WidgetKit are there to aid you in displaying the widget in the correct style for the appearance currently selected. Look at how Apple's own Podcasts widgets or Weather widgets act on the Home Screen in Clear and Tinted modes; they have no gradient or background. The recommended style for a widget background in Clear or Tinted modes is to have a clear background, i.e. no image, so you should either not display your image, or set its opacity to a low number and tweak it until it looks good. Preview your widget in Xcode, change the display mode to Clear or Tinted, then add the modifier .widgetAccentedRenderingMode(.accentedDesaturated)to the Image. Does it improve your widget?
3w
Reply to Contrast for texts in widgets with image backgrounds transparent mode
Are you using @Environment(\.widgetRenderingMode) var widgetRenderingMode already? If not, add that to your widget view, and change how the widget looks depending on the various values of widgetRenderingMode, i.e.: var body: some View { ZStack { switch renderingMode { case .fullColor: Text("Full color") case .accented: ZStack { Circle(...) VStack { Text("Accented") .widgetAccentable() Text("Normal") } } case .vibrant: Text("Full color") default: ... } } } Also, on images, there's a modifier: .widgetAccentedRenderingMode() with options like .accentedDesaturated. Take a look at how each of those values affects your widget, and you might find out the right combination that works in each of the various Home Screen modes. Note that this is only available from iOS 18 onwards. Also note (from the dev documentation) if the Image is a subview for a group that has widgetAccentable(true) applied, this modifier may conflict. It's quicker to check the various looks in Xcode previews than it is to build and deploy to an iPhone and customise the Home Screen each time, just to save you some time.
3w
Reply to 32 byte NSNumber memory leak - how to fix?
I've tried to reproduce it in a new project, but it doesn't happen, either in the Simulator or on a physical device, possibly because it only happens when there are a bunch of views or a certain stack, who knows. Back in the original project, deploying to a physical iPhone and triggering the snapshot function is now producing this in Instruments: The call to superView.drawHierarchy(in: superView.bounds, afterScreenUpdates: true) within generateSnapshot() is selected. Everything after that is UIKitCore, Foundation or CoreFoundation, so I don't see how I'm leaking the memory. I've raised FB21074853 with the smaller project. It won't show the issue, but it might be a starting point for the guys at Apple to get to it.
Topic: UI Frameworks SubTopic: UIKit Tags:
3w
Reply to Adding days to a date using the result of a division operation
What version of Xcode are you using? What version of iOS/macOS/other OS are you building for? I tried it in Xcode 26.1.1 on macOS 15.7.2, targeting iOS 26.1 and it works fine, no errors. Here's a reduced version (that also works): var dateComponent = DateComponents() dateComponent.day = Int(200 / 80) let newDate: Date = Calendar.current.date(byAdding: dateComponent, to: Date.now)! print(newDate)
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’25