Search results for

“swiftui”

17,491 results found

Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Button with Image view label has smaller hit target
Thanks for the post. When you use a custom label: closure containing only an Image, SwiftUI sizes the button exactly to the intrinsic bounds of that image. If the image is small, like a standard SF Symbol, the minimum tap target size of 44x44. You can explicitly define a minimum frame for the image. However, when you expand the frame of an image, the empty space around it might not register taps. To fix this, apply .contentShape(Rectangle()) to tell SwiftUI that the entire bounding box should be interactive. In place code using your code above without using Xcode. Button { print(Button 3 tapped) } label: { Image(systemName: 3.square.fill) .frame(minWidth: 44, minHeight: 44) .contentShape(Rectangle()) } Albert
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’26
Reply to iOS app will not auto-sleep
Thanks for your post and congratulations on your SwiftUI app. Is the iPhone is plugged into your Mac and running through Xcode? The debugger alters the device's power management and prevents it from sleeping normally so you don't lose your debugging session. There are a few things that prevents the device for going to sleep that you may be using without knowing. On top of my head. If you are using the camera, you likely have an AVCaptureSession running, make sure the camera session is not actively running, because it assumes the user is framing a shot or recording. Even if the camera view is hidden behind another SwiftUI view or you navigated to a different tab, if you didn't explicitly tell the session to stop, it keeps running in the background and keeps the screen awake. Temporarily comment out the code that calls session.startRunning() and see if the phone sleeps. If it does, you know the camera is the issue. Another one, do a global search in your Xcode project for isIdleTimerDisabled S
May ’26
iOS app will not auto-sleep
Hello, I am working on a iOS app. This is my first big project in SwiftUI which it is going well besides I can not get my phone to auto-sleep/auto-lock when I am in the app. I am testing the app on my phone through xcode. As I am checking my energy report on idle it is saying Low and is almost to the very bottom, and my memory is idling at 90MB~115MB which seems very low. Now If I just leave the app it works right away even if I do not clear the app. I am wondering if anyone has any ideas on how to help me with this issue. I am using HealthKit, a Timer and the camera. I am making a workout app to give some information. I can also give more info if needed I will appreciate any help or ideas. I have tried to use AI to see if it can find any issues and it said that it didn't see anything wrong with my code that will cause it not to sleep now that is AI and it isn't perfect so I would appreciate any help.
1
0
303
May ’26
How to align a newly opened volumetric window with the center of an existing 2D window in visionOS?
I’m building a visionOS app that starts with a regular 2D SwiftUI window. From that 2D window, the user can enter a volumetric mode, where I want to open a large volumetric WindowGroup and have it appear centered around the same spatial position as the original 2D window. The volumetric window is physically large, roughly over 1m × 1m × 30cm. Because of that, placement behavior is very noticeable. My intended behavior is: User is interacting with a regular 2D window. User taps a button. A large volumetric window opens. The volumetric window appears in front of the user, ideally centered on or near the original 2D window’s position. The original 2D window is dismissed or replaced. My current workaround is to call openWindow(id:) for the volumetric window, then dismiss the original 2D window. This works in the sense that the volume is created, but its initial position is noticeably offset from the original 2D window. I also tried using defaultWindowPlacement to control the placement of the volumetric w
Topic: Design SubTopic: General Tags:
4
0
2.1k
May ’26
FamilyActivityPicker missing search bar when embedded inline on iPad
When FamilyActivityPicker is used as an embedded view (not via the .familyActivityPicker sheet modifier), the search bar that normally appears at the bottom is not rendered on iPad. The same code shows the search bar correctly on iPhone. Environment Frameworks: SwiftUI, FamilyControls Device: iPad (reproduces on multiple models / iPadOS versions — 26.2, 26.5) iPhone: search bar appears as expected Usage The picker is placed directly inside a SwiftUI view hierarchy: import SwiftUI import FamilyControls struct ContentView: View { @State private var selection = FamilyActivitySelection() var body: some View { FamilyActivityPicker(selection: $selection) } } Expected A search field is visible at the bottom of the sheet (same as iPhone), allowing the user to search for apps/categories/websites. Actual On iPad, no search field is rendered. The picker only shows the category/app list. There is no way to search. Notes I would like the embedded FamilyActivityPicker to show the same search affo
1
0
297
May ’26
Reply to Custom Keyboard help
import UIKit import SwiftUI class KeyboardViewController: UIInputViewController { private var customHeightConstraint: NSLayoutConstraint? private let targetHeight: CGFloat = 450.0 private var systemDefaultHeight: CGFloat = 228.0 // Safe fallback override func viewDidLoad() { super.viewDidLoad() setupSwiftUIContent() // Initialize the constraint at default high priority to avoid layout warnings customHeightConstraint = view.heightAnchor.constraint(equalToConstant: targetHeight) customHeightConstraint?.priority = UILayoutPriority(999) customHeightConstraint?.isActive = true } override func viewIsAppearing(_ animated: Bool) { super.viewIsAppearing(animated) // Dynamically find iOS's system-encapsulated height constraint if let encapsulatedConstraint = view.constraints.first(where: { $0.firstItem === view && $0.firstAttribute == .height && $0 !== customHeightConstraint }) { systemDefaultHeight = encapsulatedConstraint.constant } // Apply the offset trick: target (450) - system default (22
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’26
Reply to Custom Keyboard help
I was able to find a fix after 2 intense days troubleshooting this with Claude and GPT. Eventually Gemini solved the problem for me! Sending 2 messages due to 7k char limitation Problem: Custom iOS keyboard extension (UIInputViewController, SwiftUI content via UIHostingController). On every appearance, the keyboard window visibly resizes — the host app's UI reacts to it. Happens in every host app (Instagram, iMessage, etc.), not app-specific. The desired behaviour is what Bitmoji/Wispr do — keyboard just appears cleanly with no visible resize. What the logs show (captured via in-keyboard debug overlay — Xcode console doesn't work for extensions): Every single appearance, without exception, produces this sequence in viewDidLayoutSubviews: viewDidLoad: bounds.height = 0.0 viewDidLayoutSubviews: 844.0 viewDidLayoutSubviews: 844.0 (multiple passes) viewDidLayoutSubviews: 678.0 (multiple passes) viewDidLayoutSubviews: 450.0 ← our target viewDidAppear fires at 678, not 450. The final 678→450 snap happens a
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’26
WeatherKit WeatherService fails to generate JWT with WDSJWTAuthenticator Code=2 despite valid entitlement/profile
Hi Apple Developer Support / WeatherKit team, I’m trying to use native iOS WeatherKit through WeatherService.shared in a SwiftUI app. Every request fails before weather data is returned because WeatherDaemon cannot generate the WeatherKit JWT. I am not using the REST API or manually generating a JWT. This is the native Swift WeatherKit API. import WeatherKit import CoreLocation let current = try await WeatherService.shared.weather( for: CLLocation(latitude: 25.76, longitude: -80.19), including: .current ) I also tested the same pattern used in Apple’s sample project, “Fetching weather forecasts with WeatherKit,” which calls: WeatherService.shared.weather(for: location, including: .current) The error I get is: Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 (null) Encountered an error when fetching weather data subset; error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=W
3
0
357
May ’26
ControlCenter blocks a MenuBarExtra item due to foreign trackedApplications entry
I am seeing a reproducible issue with macOS ControlCenter's per-app menu bar tracking state in a SwiftUI MenuBarExtra app. On launch the app creates its menu bar status item. ControlCenter then reads group.com.apple.controlcenter / trackedApplications, moves the app's status item host to the blocked list, sends NSStatusItemChangeVisibilityAction with visibility=0, and the app terminates because its only status item is removed. Two observations: Changing only the bundle identifier makes the menu bar item appear normally. In trackedApplications, the affected app has its own entry with isAllowed: true; a separate entry for another app has isAllowed: false, and that disallowed foreign entry's menuItemLocations contained an entry referencing the affected app. Removing only the affected app's reference from the other app's disallowed entry fixed the issue: the app launched normally, and ControlCenter no longer sent visibility=0. ControlCenter appears to associate one app's menu item identity with another a
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2
0
467
May ’26
Gesture causing AGGraphGetValue
I have a custom UIGestureRecognizerRepresentable that causes a crash. Only happens about once a week, and that’s with about a thousand times it gets invoked. But it’s persistent and annoying when it happens. The code looks like func handleUIGestureRecognizerAction(_ recognizer: Recognizer, context: Context) { let startLocation = context.converter.convert(globalPoint: recognizer.startLocation, to: coorinateSpace) coorinateSpace is set in init and has crashed on .global, .local, and .named(foo) The convert function gets caught in a AGGraphGetValue loop before finally failing. It has happened while attached to the debugger, but there is not any more information than is in the logs. I don’t even know why it would invoke AttributeGraph in the first place. Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x23aedd1d0 __pthread_kill + 8 1 libsystem_pthread.dylib 0x1eb0cf7dc pthread_kill + 268 2 libsystem_c.dylib 0x197a89c98 abort + 148 3 AttributeGraph 0x1befffef0 AG::pr
Topic: UI Frameworks SubTopic: SwiftUI
1
0
376
May ’26
How do I get content to blur behind a floating input bar, like Mail, Messages and other native apps do?
I have a chat app with a floating composer pill (NSGlassEffectView) pinned to the bottom of my content area. Messages scroll behind it. The pill looks fine but content behind it is completely clear. Fully legible text showing through, no frosting at all. Mail, Messages, Notes all have this frosted look where content behind a floating bar is blurred enough that you can't read it. That's what I'm going for. My scroll view has wantsLayer = true. I tried hasVerticalScroller = true + scrollerStyle = .overlay based on a tip I saw in another thread. No change. Is NSGlassEffectView supposed to blur what's behind it, or is the frosting in Apple's apps coming from the scroll edge effect? If it's the scroll edge effect, is there any way to trigger it for a custom floating view at the bottom of a scroll view? I can't find any AppKit API for this. I also spent time trying this in SwiftUI using .glassEffect() on macOS. Same result, the material renders nearly clear with no way to control the frosting level via any
0
0
684
May ’26
Reply to A few issues with the iPhone Photos app
(part 2 of 2) — continuing from my response above. The following performance considerations and progressive-loading techniques apply to both the SwiftUI path and the UIKit path described in part 1. PhotoKit performance tips (apply to both paths) A few details from the PHCachingImageManager and PHImageManager header comments that are easy to miss and matter for smoothness: Use PHImageRequestOptionsDeliveryModeOpportunistic (the default for async requests) — your result handler may be called multiple times: first with a fast, lower-quality result, then with the final high-quality image as it becomes available. This is what lets the grid feel instant even while the real thumbnails are still being prepared. From the header: client may get several image results when the call is asynchronous. Match your caching options exactly to your request options. From the startCachingImagesForAssets header comment: The options values shall exactly match the options values used in loading methods. If your targetSize, c
Topic: App & System Services SubTopic: General Tags:
May ’26
Reply to A few issues with the iPhone Photos app
Thanks for the positive observation about the Photos app's grid zoom — it is genuinely smooth, and wanting to replicate that in your own app is a reasonable aspiration. I spent some cycles putting together the following summary of APIs you may wish to explore pursuing this goal. A framing note before getting to the substance: I can't share the specifics of how Apple's Photos app is implemented internally, since that's not something DTS can detail. What I can do is point you to the public APIs and techniques that let you build similar grid-zoom behavior in your own app. The good news is that the public surface includes a class for the interpolated-zoom effect you're after. The SwiftUI path For a photo-library-backed grid with smooth pinch-to-zoom in SwiftUI, the building blocks are: LazyVGrid for the grid container (iOS 14 or later). MagnifyGesture (iOS 17 or later) for pinch input. MagnifyGesture replaced the now-deprecated MagnificationGesture; the gesture's value gives you the magnificatio
Topic: App & System Services SubTopic: General Tags:
May ’26
Reply to iOS 26 rendering gap on scroll surfaces — lower scroll view does not render
Thank you for your post. A portion of the screen failing to render is definitely not a great user experience, so it's important we find out exactly what's going on here and how to resolve it. I'll do everything I can to help us narrow this down and get it in front of the right team. 😃 [quote='827018021, jmpss, /thread/827018, /profile/jmpss'] We see it on both UIKit and SwiftUI scroll surfaces inside the same UITabBarController: [/quote] Since you mentioned you're unable to reproduce this locally, it would be helpful to gather as much detail as possible from the affected users for each of these apps That Apple Discussions thread has varying reports, with some users mentioning they were mid-search, while users in the Reddit thread report the issue is resolved by disabling Reachability. Once we narrow this down, I want to make sure I see exactly what you are seeing. Please file a bug report with Feedback Assistant and attach your project, screenshots, and steps to reproduce there as well, so I can sha
Topic: UI Frameworks SubTopic: General Tags:
May ’26
Reply to Glass effect interactive effect issue when used with concentric shapes
@kamilochel Thanks for the post, any chance you can create a new thread with those images, description and provide the full code of your view as I only see the children code .glassEffect only applies the shape mask and edge highlights to the glass material itself. The interactive highlight (the surface hover effect) calculates its own boundary based on the view's hit-testing shape, which often defaults to a capsule or standard rectangle if it encounters highly rounded corners without an explicit content shape. But I would appreciate if in a new thread you can provide the full code for SwiftUI engineers to help you with that effect. Thanks Albert
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’26
Reply to SwiftUI Button with Image view label has smaller hit target
Thanks for the post. When you use a custom label: closure containing only an Image, SwiftUI sizes the button exactly to the intrinsic bounds of that image. If the image is small, like a standard SF Symbol, the minimum tap target size of 44x44. You can explicitly define a minimum frame for the image. However, when you expand the frame of an image, the empty space around it might not register taps. To fix this, apply .contentShape(Rectangle()) to tell SwiftUI that the entire bounding box should be interactive. In place code using your code above without using Xcode. Button { print(Button 3 tapped) } label: { Image(systemName: 3.square.fill) .frame(minWidth: 44, minHeight: 44) .contentShape(Rectangle()) } Albert
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to iOS app will not auto-sleep
Thanks for your post and congratulations on your SwiftUI app. Is the iPhone is plugged into your Mac and running through Xcode? The debugger alters the device's power management and prevents it from sleeping normally so you don't lose your debugging session. There are a few things that prevents the device for going to sleep that you may be using without knowing. On top of my head. If you are using the camera, you likely have an AVCaptureSession running, make sure the camera session is not actively running, because it assumes the user is framing a shot or recording. Even if the camera view is hidden behind another SwiftUI view or you navigated to a different tab, if you didn't explicitly tell the session to stop, it keeps running in the background and keeps the screen awake. Temporarily comment out the code that calls session.startRunning() and see if the phone sleeps. If it does, you know the camera is the issue. Another one, do a global search in your Xcode project for isIdleTimerDisabled S
Replies
Boosts
Views
Activity
May ’26
iOS app will not auto-sleep
Hello, I am working on a iOS app. This is my first big project in SwiftUI which it is going well besides I can not get my phone to auto-sleep/auto-lock when I am in the app. I am testing the app on my phone through xcode. As I am checking my energy report on idle it is saying Low and is almost to the very bottom, and my memory is idling at 90MB~115MB which seems very low. Now If I just leave the app it works right away even if I do not clear the app. I am wondering if anyone has any ideas on how to help me with this issue. I am using HealthKit, a Timer and the camera. I am making a workout app to give some information. I can also give more info if needed I will appreciate any help or ideas. I have tried to use AI to see if it can find any issues and it said that it didn't see anything wrong with my code that will cause it not to sleep now that is AI and it isn't perfect so I would appreciate any help.
Replies
1
Boosts
0
Views
303
Activity
May ’26
How to align a newly opened volumetric window with the center of an existing 2D window in visionOS?
I’m building a visionOS app that starts with a regular 2D SwiftUI window. From that 2D window, the user can enter a volumetric mode, where I want to open a large volumetric WindowGroup and have it appear centered around the same spatial position as the original 2D window. The volumetric window is physically large, roughly over 1m × 1m × 30cm. Because of that, placement behavior is very noticeable. My intended behavior is: User is interacting with a regular 2D window. User taps a button. A large volumetric window opens. The volumetric window appears in front of the user, ideally centered on or near the original 2D window’s position. The original 2D window is dismissed or replaced. My current workaround is to call openWindow(id:) for the volumetric window, then dismiss the original 2D window. This works in the sense that the volume is created, but its initial position is noticeably offset from the original 2D window. I also tried using defaultWindowPlacement to control the placement of the volumetric w
Topic: Design SubTopic: General Tags:
Replies
4
Boosts
0
Views
2.1k
Activity
May ’26
FamilyActivityPicker missing search bar when embedded inline on iPad
When FamilyActivityPicker is used as an embedded view (not via the .familyActivityPicker sheet modifier), the search bar that normally appears at the bottom is not rendered on iPad. The same code shows the search bar correctly on iPhone. Environment Frameworks: SwiftUI, FamilyControls Device: iPad (reproduces on multiple models / iPadOS versions — 26.2, 26.5) iPhone: search bar appears as expected Usage The picker is placed directly inside a SwiftUI view hierarchy: import SwiftUI import FamilyControls struct ContentView: View { @State private var selection = FamilyActivitySelection() var body: some View { FamilyActivityPicker(selection: $selection) } } Expected A search field is visible at the bottom of the sheet (same as iPhone), allowing the user to search for apps/categories/websites. Actual On iPad, no search field is rendered. The picker only shows the category/app list. There is no way to search. Notes I would like the embedded FamilyActivityPicker to show the same search affo
Replies
1
Boosts
0
Views
297
Activity
May ’26
Reply to Custom Keyboard help
import UIKit import SwiftUI class KeyboardViewController: UIInputViewController { private var customHeightConstraint: NSLayoutConstraint? private let targetHeight: CGFloat = 450.0 private var systemDefaultHeight: CGFloat = 228.0 // Safe fallback override func viewDidLoad() { super.viewDidLoad() setupSwiftUIContent() // Initialize the constraint at default high priority to avoid layout warnings customHeightConstraint = view.heightAnchor.constraint(equalToConstant: targetHeight) customHeightConstraint?.priority = UILayoutPriority(999) customHeightConstraint?.isActive = true } override func viewIsAppearing(_ animated: Bool) { super.viewIsAppearing(animated) // Dynamically find iOS's system-encapsulated height constraint if let encapsulatedConstraint = view.constraints.first(where: { $0.firstItem === view && $0.firstAttribute == .height && $0 !== customHeightConstraint }) { systemDefaultHeight = encapsulatedConstraint.constant } // Apply the offset trick: target (450) - system default (22
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to Custom Keyboard help
I was able to find a fix after 2 intense days troubleshooting this with Claude and GPT. Eventually Gemini solved the problem for me! Sending 2 messages due to 7k char limitation Problem: Custom iOS keyboard extension (UIInputViewController, SwiftUI content via UIHostingController). On every appearance, the keyboard window visibly resizes — the host app's UI reacts to it. Happens in every host app (Instagram, iMessage, etc.), not app-specific. The desired behaviour is what Bitmoji/Wispr do — keyboard just appears cleanly with no visible resize. What the logs show (captured via in-keyboard debug overlay — Xcode console doesn't work for extensions): Every single appearance, without exception, produces this sequence in viewDidLayoutSubviews: viewDidLoad: bounds.height = 0.0 viewDidLayoutSubviews: 844.0 viewDidLayoutSubviews: 844.0 (multiple passes) viewDidLayoutSubviews: 678.0 (multiple passes) viewDidLayoutSubviews: 450.0 ← our target viewDidAppear fires at 678, not 450. The final 678→450 snap happens a
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’26
WeatherKit WeatherService fails to generate JWT with WDSJWTAuthenticator Code=2 despite valid entitlement/profile
Hi Apple Developer Support / WeatherKit team, I’m trying to use native iOS WeatherKit through WeatherService.shared in a SwiftUI app. Every request fails before weather data is returned because WeatherDaemon cannot generate the WeatherKit JWT. I am not using the REST API or manually generating a JWT. This is the native Swift WeatherKit API. import WeatherKit import CoreLocation let current = try await WeatherService.shared.weather( for: CLLocation(latitude: 25.76, longitude: -80.19), including: .current ) I also tested the same pattern used in Apple’s sample project, “Fetching weather forecasts with WeatherKit,” which calls: WeatherService.shared.weather(for: location, including: .current) The error I get is: Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 (null) Encountered an error when fetching weather data subset; error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=W
Replies
3
Boosts
0
Views
357
Activity
May ’26
ControlCenter blocks a MenuBarExtra item due to foreign trackedApplications entry
I am seeing a reproducible issue with macOS ControlCenter's per-app menu bar tracking state in a SwiftUI MenuBarExtra app. On launch the app creates its menu bar status item. ControlCenter then reads group.com.apple.controlcenter / trackedApplications, moves the app's status item host to the blocked list, sends NSStatusItemChangeVisibilityAction with visibility=0, and the app terminates because its only status item is removed. Two observations: Changing only the bundle identifier makes the menu bar item appear normally. In trackedApplications, the affected app has its own entry with isAllowed: true; a separate entry for another app has isAllowed: false, and that disallowed foreign entry's menuItemLocations contained an entry referencing the affected app. Removing only the affected app's reference from the other app's disallowed entry fixed the issue: the app launched normally, and ControlCenter no longer sent visibility=0. ControlCenter appears to associate one app's menu item identity with another a
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
2
Boosts
0
Views
467
Activity
May ’26
Gesture causing AGGraphGetValue
I have a custom UIGestureRecognizerRepresentable that causes a crash. Only happens about once a week, and that’s with about a thousand times it gets invoked. But it’s persistent and annoying when it happens. The code looks like func handleUIGestureRecognizerAction(_ recognizer: Recognizer, context: Context) { let startLocation = context.converter.convert(globalPoint: recognizer.startLocation, to: coorinateSpace) coorinateSpace is set in init and has crashed on .global, .local, and .named(foo) The convert function gets caught in a AGGraphGetValue loop before finally failing. It has happened while attached to the debugger, but there is not any more information than is in the logs. I don’t even know why it would invoke AttributeGraph in the first place. Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x23aedd1d0 __pthread_kill + 8 1 libsystem_pthread.dylib 0x1eb0cf7dc pthread_kill + 268 2 libsystem_c.dylib 0x197a89c98 abort + 148 3 AttributeGraph 0x1befffef0 AG::pr
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
376
Activity
May ’26
How do I get content to blur behind a floating input bar, like Mail, Messages and other native apps do?
I have a chat app with a floating composer pill (NSGlassEffectView) pinned to the bottom of my content area. Messages scroll behind it. The pill looks fine but content behind it is completely clear. Fully legible text showing through, no frosting at all. Mail, Messages, Notes all have this frosted look where content behind a floating bar is blurred enough that you can't read it. That's what I'm going for. My scroll view has wantsLayer = true. I tried hasVerticalScroller = true + scrollerStyle = .overlay based on a tip I saw in another thread. No change. Is NSGlassEffectView supposed to blur what's behind it, or is the frosting in Apple's apps coming from the scroll edge effect? If it's the scroll edge effect, is there any way to trigger it for a custom floating view at the bottom of a scroll view? I can't find any AppKit API for this. I also spent time trying this in SwiftUI using .glassEffect() on macOS. Same result, the material renders nearly clear with no way to control the frosting level via any
Replies
0
Boosts
0
Views
684
Activity
May ’26
Reply to A few issues with the iPhone Photos app
(part 2 of 2) — continuing from my response above. The following performance considerations and progressive-loading techniques apply to both the SwiftUI path and the UIKit path described in part 1. PhotoKit performance tips (apply to both paths) A few details from the PHCachingImageManager and PHImageManager header comments that are easy to miss and matter for smoothness: Use PHImageRequestOptionsDeliveryModeOpportunistic (the default for async requests) — your result handler may be called multiple times: first with a fast, lower-quality result, then with the final high-quality image as it becomes available. This is what lets the grid feel instant even while the real thumbnails are still being prepared. From the header: client may get several image results when the call is asynchronous. Match your caching options exactly to your request options. From the startCachingImagesForAssets header comment: The options values shall exactly match the options values used in loading methods. If your targetSize, c
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to A few issues with the iPhone Photos app
Thanks for the positive observation about the Photos app's grid zoom — it is genuinely smooth, and wanting to replicate that in your own app is a reasonable aspiration. I spent some cycles putting together the following summary of APIs you may wish to explore pursuing this goal. A framing note before getting to the substance: I can't share the specifics of how Apple's Photos app is implemented internally, since that's not something DTS can detail. What I can do is point you to the public APIs and techniques that let you build similar grid-zoom behavior in your own app. The good news is that the public surface includes a class for the interpolated-zoom effect you're after. The SwiftUI path For a photo-library-backed grid with smooth pinch-to-zoom in SwiftUI, the building blocks are: LazyVGrid for the grid container (iOS 14 or later). MagnifyGesture (iOS 17 or later) for pinch input. MagnifyGesture replaced the now-deprecated MagnificationGesture; the gesture's value gives you the magnificatio
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to iOS 26 rendering gap on scroll surfaces — lower scroll view does not render
Thank you for your post. A portion of the screen failing to render is definitely not a great user experience, so it's important we find out exactly what's going on here and how to resolve it. I'll do everything I can to help us narrow this down and get it in front of the right team. 😃 [quote='827018021, jmpss, /thread/827018, /profile/jmpss'] We see it on both UIKit and SwiftUI scroll surfaces inside the same UITabBarController: [/quote] Since you mentioned you're unable to reproduce this locally, it would be helpful to gather as much detail as possible from the affected users for each of these apps That Apple Discussions thread has varying reports, with some users mentioning they were mid-search, while users in the Reddit thread report the issue is resolved by disabling Reachability. Once we narrow this down, I want to make sure I see exactly what you are seeing. Please file a bug report with Feedback Assistant and attach your project, screenshots, and steps to reproduce there as well, so I can sha
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to Glass effect interactive effect issue when used with concentric shapes
@kamilochel Thanks for the post, any chance you can create a new thread with those images, description and provide the full code of your view as I only see the children code .glassEffect only applies the shape mask and edge highlights to the glass material itself. The interactive highlight (the surface hover effect) calculates its own boundary based on the view's hit-testing shape, which often defaults to a capsule or standard rectangle if it encounters highly rounded corners without an explicit content shape. But I would appreciate if in a new thread you can provide the full code for SwiftUI engineers to help you with that effect. Thanks Albert
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’26