I have a UIHostingController on which I have set: hostingController.sizingOptions = [.intrinsicContentSize] The size of my SwiftUI content changes with animation (I update a @Published property on an ObservableObject inside a withAnimation block). However, I notice that my hostingController.view just jumps to the new frame without animating the change. Question: how can I animate the frame changes in UIHostingController that are caused by sizingOptions = [.intrinsicContentSize]
Search results for
SwiftUI List performance
50,605 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
@DTS Engineer I am expecting the part on the left, in SwiftUI to animate exactly like the counterpart in UIKit on the right. But they do not; UIKit animation affects both UIView.center and UIView.bounds, and they travel using the same timing curve over the same duration, which makes it seem that the top of the UIKit view is attached to the top of the screen. However, this illusion is not preserved for SwiftUI view because UIHostingController.view.center is not animated; it's teleported to the end position. And I also happen to know that really bounds are not animated either, the UIView actually just fully teleports to the new state, while only the SwiftUI content is animated. And my question is - what is the way to make UIHostingController animate along its SwiftUI content? Can you maybe confirm that there isn't a built-in support for that?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Hi Quinn, Thank you for above pointers. Following it, I found that: The release entitlements file we were using (Ro_ _ IOSS_ _ _n.entitlements) did not include com.apple.developer.payment-pass-provisioning, so the app never claimed it. That’s why App Store Connect flagged the entitlement as missing. **Fixes I made: ** a. Added this key (entitlement) to RoboIOSSiren.entitlements manually: com.apple.developer.payment-pass-provisioning and updated aps-environment to production aps-environment production b. After (a) I did below in order: Clean + Archive In Xcode: Product > Clean Build Folder… Then: Product > Archive Verify entitlements in the archive In Organizer, select the new archive → Distribute App → Custom → App Store Connect → Export On the “Review IPA content” screen, confirm the entitlements list now includes: com.apple.developer.payment-pass-provisioning Upload using Transporter Upload the exported .ipa with Transporter. Check App Store Connect Wait for processing and re-check the TestF
Topic:
Code Signing
SubTopic:
Entitlements
Tags:
Hello @thisisjaymehta, Welcome to SwiftUI development! 🥳 The first thing I would look at is the Attributes menu, located in the Inspector area (the sidebar on the right of Xcode). You can also quickly open this tab by pressing ⌥ ⌘ 4. In that menu you will notice options for devices, appearances, sizes and more. In your screenshot, it appears you have the Scales set to Single Scale. You can try switching this to Individual Scale and add different scales which are configured to show on different devices. You can find more information about how to do that here Fitting images into available space If not, try appearances and see if it's a light/dark mode issue. It looks like you already did some troubleshooting by setting a solid white color background. A great tip you can use to check both color schemes easily is by using this toggle at the bottom of the canvas in Xcode, which will show both the light and dark move preview in Canvas. For more information on Xcodes canvas see Previewing your app’s interf
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
I'm experiencing a contradictory validation issue with DeviceActivityReportExtension that creates an impossible situation: The Problem: Without NSExtensionPrincipalClass in Info.plist → App Store Connect rejects upload with: Missing Info.plist values. No values for NSExtensionMainStoryboard or NSExtensionPrincipalClass found With NSExtensionPrincipalClass → Local install fails with: defines either an NSExtensionMainStoryboard or NSExtensionPrincipalClass key, which is not allowed for the extension point com.apple.deviceactivityui.report-extension Setup: Extension point: com.apple.deviceactivityui.report-extension Using SwiftUI with @main attribute and DeviceActivityReportExtension protocol Xcode 16.2, iOS 17.6 deployment target Code structure: @main struct SpoolReport: DeviceActivityReportExtension { var body: some DeviceActivityReportScene { // Report scenes here } } The extension builds and runs perfectly without NSExtensionPrincipalClass, but cannot be uploaded to App Store Connect. Adding the key
Hi everyone, I’m looking for clarification regarding an App Review rejection under Guideline 2.1 – Performance – App Completeness. Apple reported the following issue: Bug description: “Create PIN” button was not responsive Review device: iPad Air 11-inch (M3) OS version: iPadOS 26.2.1 What’s confusing is the following: Observed behavior on our side The app has been tested extensively on: Multiple iPhone models iPad devices (including recent iPadOS versions) In all our testing: The Create PIN button is responsive The tap action triggers correctly The flow completes without errors At this point, we are unable to reproduce the issue described by App Review on either iPhone or iPad. iPhone-only intent vs iPad review The app is designed and optimized for iPhone usage only. However, the review was performed on an iPad device. If an app is available for download on iPad, is it always expected to function fully on iPad regardless of being phone-optimized? If iPad support is not intended, is explicit
Topic:
App Store Distribution & Marketing
SubTopic:
App Review
Hello @isaacweisberg, I see the UIKit example on the right is animating correctly to me. It looks like you followed the steps correctly: Line 75 of ViewController.swift the UIHostingController observes .preferredContentSize. Nice work on implementing that! 😎👍 Can you clarify on what you mean? Are you trying to achieve the same effect in SwiftUI or is the UIKit example on the right not what you were looking for? Let me know, Travis Trotto - DTS Engineer
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Sorry for the delay, I didn't get the notification. Thanks for the code, I would recommend to add a link to a focused project where I can download and play with it as of course without the images nor drop targets is hard to see what you are trying to accomplish and will help many developers here figure it out. Customize the drag preview to make the interaction more intuitive. You can modify the draggable modifier .draggable(player, preview: { VStack { Image(jersey) .resizable() .frame(width: 50, height: 50) if let player = content.player { Text(player.last) .font(.caption) } } }) Currently, the drop handler just prints the item. You might want to update the CellContent's player based on the drop? .dropDestination(for: String.self) { items, location in if let firstItem = items.first { print(Dropped: (firstItem)) // Update player logic here if needed // e.g., content.player = updatedPlayerBasedOn(firstItem) } return true } Looking forward to your focused sample. That'll help us better understand what's going on
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
My app has a collection of Cell Views. some of the views' model objects include a Player, and others do not. I want to use drag and drop to move a player from one cell to another. I only want cells that contain a player to be valid drag sources. All cells will be valid drop destinations. When I uncomment the .disabled line both drag and drop become disabled. Is it possible to keep a view enabled as a dropDestination but disabled as a draggable source? VStack { Image(playerJersey_red) if let player = content.player { Text(player.name) } } .draggable(content) // .disabled(content.player == nil) .dropDestination(for: CellContent.self) { items, location in One thing I tried was to wrap everything in a ZStack and put a rectangle with .opacity(0.02) above the Image/Text VStack. I then left draggable modifying my VStack and moved dropDestination to the clear rectangle. This didn't work as I wasn't able to initiate a drag when tapping on the rectangle. Any other ideas or suggestions? thanks
1/ Issue Summary In our application, we use HKObserverQuery together with:HKHealthStore.enableBackgroundDelivery(for:frequency: .immediate) to enable HealthKit Background Delivery, allowing the system to wake our App Extension in the background to process health data updates. Under the same app build, identical HealthKit permission configuration, and the same watchOS version, we have observed significant differences in background delivery frequency across different devices. Specifically, on certain devices (e.g. Apple Watch Series 10, watchOS 26.2.1), the background delivery frequency is significantly reduced, behaving as if it is capped at approximately once per hour. On other control devices, under the same configuration, background delivery is triggered much more frequently and consistently, at approximately every 8–16 minutes. This behavior is consistently reproducible on the affected devices. **We would like to understand whether there are any officially recommended implementation patterns, best practice
Context: I am building a macOS file (currently image only) browser using SwiftUI. The core view is a ScrollView containing a LazyVGrid. The layout is dynamic: as the window resizes, I calculate the optimal number of columns and spacing using a GeometryReader. The Issue: While scrolling is pretty smooth (thanks to custom image caching and prefetching), window resizing is significantly laggy. After having scrolled the UI stutters and drops frames heavily while dragging the window edge. The Code: https://github.com/MorusPatre/Binder
Hi there, I just re-install 26.2, but I got many issues regarding to SwiftUI's components. How can I fix it? Do I need download or install something else?
Hi, The problems you are facing is due to the fact that you named your project SwiftUI. This is causing the build system to create a module for your app called SwiftUI which is the exact same module name that the system library is called. I expect you'd see these issues resolved if you rename your app to something that doesn't match one of the system frameworks.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Apologies for the delay! Please see our doc main page: https://developer.apple.com/documentation/foundationmodels The Foundation Models framework provides access to Apple’s on-device large language model that powers Apple Intelligence to help you perform intelligent tasks specific to your use case. This article from Apple says something similar: https://machinelearning.apple.com/research/apple-foundation-models-2025-updates The new Foundation Models framework gives access to developers to start creating their own reliable, production-quality generative AI features with the ~3B parameter on-device language model.
Topic:
Machine Learning & AI
SubTopic:
Foundation Models
Hi, I am developing an iOS application that utilizes Apple’s Foundation Models to perform certain summarization tasks. I would like to understand whether user data is transferred to Private Cloud Compute (PCC) in cases where the computation cannot be performed entirely on-device. This information is critical for our internal security and compliance reviews. I would appreciate your clarification on this matter. Thank you.
Topic:
Machine Learning & AI
SubTopic:
Foundation Models