Hello there!
I wanted to give a native scrolling mechanism for the Swift Charts Graph a try and experiment a bit if the scenario that we try to achieve might be possible, but it seems that the Swift Charts scrolling performance is very poor.
The graph was created as follows:
X-axis is created based on a date range,
Y-axis is created based on an integer values between moreless 0-320 value.
the graph is scrollable horizontally only (x-axis),
The time range (x-axis) for the scrolling content was set to one year from now date (so the user can scroll one year into the past as a minimum visible date (.chartXScale).
The X-axis shows 3 hours of data per screen width (.chartXVisibleDomain).
The data points for the graph are generated once when screen is about to appear so that the Charts engine can use it (no lazy loading implemented yet).
The line data points (LineMark views) consist of 2880 data points distributed every 5 minutes which simulates - two days of continuous data stream that we want to present. The rest of the graph displays no data at all.
The performance result:
The graph on the initial loading phase is frozen for about 10-15 seconds until the data appears on the graph.
Scrolling is very laggy - the CPU usage is 100% and is unacceptable for the end users.
If we show no data at all on the graph (so no LineMark views are created at all) - the result is similar - the empty graph scrolling is also very laggy.
Below I am sharing a test code:
@main
struct ChartsTestApp: App {
var body: some Scene {
WindowGroup {
ContentView()
Spacer()
}
}
}
struct LineDataPoint: Identifiable, Equatable {
var id: Int
let date: Date
let value: Int
}
actor TestData {
func generate(startDate: Date) async -> [LineDataPoint] {
var values: [LineDataPoint] = []
for i in 0..<(1440 * 2) {
values.append(
LineDataPoint(
id: i,
date: startDate.addingTimeInterval(
TimeInterval(60 * 5 * i) // Every 5 minutes
),
value: Int.random(in: 1...100)
)
)
}
return values
}
}
struct ContentView: View {
var startDate: Date {
return endDate.addingTimeInterval(-3600*24*30*12) // one year into the past from now
}
let endDate = Date()
@State var dataPoints: [LineDataPoint] = []
var body: some View {
Chart {
ForEach(dataPoints) { item in
LineMark(
x: .value("Date", item.date),
y: .value("Value", item.value),
series: .value("Series", "Test")
)
}
}
.frame(height: 200)
.chartScrollableAxes(.horizontal)
.chartYAxis(.hidden)
.chartXScale(domain: startDate...endDate) // one year possibility to scroll back
.chartXVisibleDomain(length: 3600 * 3) // 3 hours visible on screen
.onAppear {
Task {
dataPoints = await TestData().generate(startDate: startDate)
}
}
}
}
I would be grateful for any insights or suggestions on how to improve it or if it's planned to be improved in the future.
Currently, I use UIKit CollectionView where we split the graph into smaller chunks of the graph and we present the SwiftUI Chart content in the cells, so we use the scrolling offered there. I wonder if it's possible to use native SwiftUI for such a scenario so that later on we could also implement some kind of lazy loading of the data as the user scrolls into the past.
Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
The Widget Image display on iOS26 transparency mode is blank
Both of these writing methods show blank Spaces. Is there a problem with my code or a bug in the system?
The current compilation environment is Xcode Version 16.3 (16E140) iOS26.0
Is the Cancel button intentionally removed from UISearchBar (right side)?
Even when using searchController with navigationItem also.
showsCancelButton = true
doesn’t display the cancel button.
Also:
When tapping the clear ("x") button inside the search field, the search is getting canceled, and searchBarCancelButtonClicked(_:) is triggered (Generally it should only clear text, not cancel search).
If the search text is empty and I tap outside the search bar, the search is canceled.
Also when I have tableview in my controller(like recent searches) below search bar and if I try to tap when editing started, action is not triggered(verified in sample too). Just cancellation is happening.
In a split view controller, if the search is on the right side and I try to open the side panel, the search also gets canceled.
Are these behaviors intentional changes, beta issues, or are we missing something in implementation?
I need to create a Mac application using Objective-C. The application has to use PHPickerViewController to provide user a familiar interface to pick photos.
Here is the Objective-C code that used to present the photo picker.
//ViewController.h
#import <Cocoa/Cocoa.h>
#import <PhotosUI/PhotosUI.h>
@interface ViewController : NSViewController<PHPickerViewControllerDelegate>
@property (nonatomic, weak) IBOutlet NSImageView *myImageView;
@end
// ViewController.m
@implementation ViewController
PHPickerViewController* pickerViewController = nil;
- (void)pickPhotos {
PHPickerConfiguration *config = [[PHPickerConfiguration alloc] init];
config.selectionLimit = 0; // Allow multiple selections
config.filter = [PHPickerFilter imagesFilter]; // Filter for images
pickerViewController = [[PHPickerViewController alloc] initWithConfiguration:config];
pickerViewController.preferredContentSize = NSMakeSize(800, 600);
pickerViewController.delegate = self; // Set the delegate to handle selection
[self presentViewControllerAsModalWindow:pickerViewController];
- (IBAction)clicked:(id)sender {
NSLog(@"Button Clicked");
[self pickPhotos];
}
- (void)picker:(PHPickerViewController *)picker didFinishPicking:(NSArray<PHPickerResult *> *)results {
if (pickerViewController) {
[picker dismissViewController:pickerViewController];
}
}
@end
Can you please guide me to show the photo picker to a bigger size?
Topic:
UI Frameworks
SubTopic:
AppKit
When you use .navigationTransition(.zoom(sourceID: "placeholder", in: placehoder)) for navigation animation, going back using the swipe gesture is still very buggy on IOS26. I know it has been mentioned in other places like here: https://developer.apple.com/forums/thread/796805?answerId=856846022#856846022 but nothing seems to have been done to fix this issue.
Here is a video showing the bug comparing when the back button is used vs swipe to go back: https://imgur.com/a/JgEusRH
I wish there was a way to at least disable the swipe back gesture until this bug is fixed.
in this great talk https://developer.apple.com/videos/play/wwdc2023/10111/ the code references usdz models to replace hands. e.g assets/gloves/LeftGlove_v001.usdz. Are these models available to download to explain rigging and how to make hand models (ideally in Blender )
Are the glove assets used in the sample from wwdc2023-10111 available somewhere?
Thanks
Hi team, I've been trying to extend the animation when we call the function setVisibleMapRect, we can use UIView.animate to lengthen the animation time, but one thing that I found not working is that when I extend the animation to 3, 5, or 10 seconds, and the changes is still ongoing and there's a gesture performed, the map will completely ignore the gesture. Causing the map to be having this kind of like "delayed" or "freeze" experience for the user. The map will immediately move to the final rect and ignores the user gesture.
I've been checking on this problem for a week now and I'm quite stuck. I've tried using CADisplayLink to manually animate the camera per system fresh rate, it works very well, I can stop the camera movement anytime there are touches, but it causes the resource CPU spikes.
Removing the animation layers recursively on sublayers and subviews also doesn't help. While storing the animation into a UIViewPropertyAnimator and use stopAnimation will always ignores user first interactions too while also animating the camera to the final position (which is not expected).
I'm experiencing intermittent crashes on iOS when launching a Flutter app after it was killed from the app switcher. The app works fine when resumed from background.
Environment:
Flutter 3.38.3
Crash signature:
EXC_BAD_ACCESS (SIGBUS)
Stack overflow in (null)
compare:options:range:locale: >
Thread 0: CFStringGetLength → CFStringCompareWithOptionsAndLocale → UIKitCore (
85+ inlined recursive calls)
What I've tried:
Increased stack size to 64MB (-Wl,-stack_size,0x4000000) - didn't help
Disabled iOS State Restoration - didn't help
Added snapshot overlay in applicationWillResignActive - helped for background issue, but not cold start
Key observation:
The crash happens intermittently. Sometimes the app opens on 2nd attempt, sometimes on 5th. This suggests a race condition between Flutter engine initialization and iOS view hierarchy traversal.
Question:
Is there a way to delay iOS view hierarchy operations until Flutter is fully initialized?
Any help appreciated!
Topic:
UI Frameworks
SubTopic:
UIKit
Question: How to prevent Flutter app crash on iOS 18 during cold start when iOS traverses view hierarchy before Flutter engine is fully initialized?
Help needed: Looking for a way to either delay iOS view hierarchy traversal or ensure Flutter is fully initialized before iOS lifecycle callbacks fire.
Problem Summary
Our Flutter app crashes on cold start for approximately 1-2% of iOS users. The crash occurs specifically on iOS and only under these exact conditions:
When crash happens:
User opens app and uses it normally ✅
User minimizes app (goes to background) ✅
User returns to app from background ✅ (works fine)
User kills app from app switcher (swipe up to close)
User taps app icon to launch again → CRASH ❌
Key observations:
Crash is intermittent - app may open on 2nd, 3rd, or 5th attempt
100% reproducible on affected devices by repeating kill→launch cycle
~98% of users have no issues
Environment
Flutter: 3.38.3
Crash Logs (from Sentry)
Crash Type 1: Stack Overflow (most common)
OS Version: iOS 18.7.2 (22H124)
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: BUS_NOOP at 0x000000016ad5be90
Application Specific Information:
compare:options:range:locale: >
Stack overflow in (null)
Thread 0 Crashed:
0 CoreFoundation CFStringGetLength
1 CoreFoundation CFStringCompareWithOptionsAndLocale
2 CoreFoundation
3 libsystem_c bsearch
4 CoreFoundation
5 UIKitCore
...
15-99: UIKitCore 0x30e177148 [inlined] // 85+ recursive calls
Crash Type 2: Use-After-Free
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: SEGV_NOOP at 0x0500007f14000000
KERN_INVALID_ADDRESS at 0x500007f14000000
Thread 0 Crashed:
0 libobjc.A.dylib objc_retainAutoreleaseReturnValue
1 UIKitCore
...
6 libobjc.A.dylib objcrootDealloc
7 QuartzCore // CALayer operations
What We Tried (nothing solved cold start crash)
Attempt
Result
Increased stack size to 64MB (-Wl,-stack_size,0x4000000)
❌ No effect
Disabled iOS State Restoration
❌ No effect
Added isViewLoaded checks in AppDelegate
❌ No effect
Added try-catch around GetStorage/SecureStorage init
❌ No effect
Added isAppActive flag to track app state
❌ No effect
Snapshot overlay in applicationWillResignActive
✅ Fixed background→foreground crash, ❌ but NOT cold start
Current AppDelegate.swift
import UIKit
import Flutter
@main
@objc
class AppDelegate: FlutterAppDelegate {
private var snapshotView: UIView?
private var isAppActive = false
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
window?.overrideUserInterfaceStyle = .light
isAppActive = true
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func application(_ application: UIApplication, shouldSaveSecureApplicationState coder: NSCoder) -> Bool {
return false
}
override func application(_ application: UIApplication, shouldRestoreSecureApplicationState coder: NSCoder) -> Bool {
return false
}
override func applicationWillResignActive(_ application: UIApplication) {
guard isAppActive,
let window = self.window,
let rootVC = window.rootViewController,
rootVC.isViewLoaded,
snapshotView == nil
else { return }
let snapshot = UIView(frame: window.bounds)
snapshot.backgroundColor = .white
snapshot.tag = 999
window.addSubview(snapshot)
snapshotView = snapshot
}
override func applicationDidBecomeActive(_ application: UIApplication) {
guard snapshotView != nil else {
isAppActive = true
return
}
snapshotView?.removeFromSuperview()
snapshotView = nil
}
}
Topic:
UI Frameworks
SubTopic:
UIKit
Hi,
On a SwiftUI map I render a mix of MapPolygon and MapPolyline. All overlays must use the same overlay level (.aboveLabels).
Goal:
Ensure MapPolyline always renders on top of MapPolygon.
Issue:
I order data so polylines are last and even render in two passes (polygons first, polylines second), all at .aboveLabels.
Despite that, after polygons change (items removed/added based on zoom levels), I see polygons visually on top of polylines. It seems MapKit may batch/reorder rendering internally.
Questions:
Is there a reliable way in SwiftUI Map to enforce z-order within the same overlay level so MapPolyline always appears above MapPolygon?
If not, any known workarounds or best practices? (e.g. different composition patterns, using annotations with zIndex, or other techniques compatible with SwiftUI Map)
I know you can do this with UIKit, but first looking for a solution compatible with SwiftUI's version of MapKit.
Thanks
Hi. I have an iOS application with multiple input fields. I have to design an experience such that whenever the user presses enter key on a textfield, it should move focus to the next input field.
Similarly, consider a stack of 3 textfields, I want to cycle the focus as and when the user presses up/down arrow keys.
Other platforms like Android, have this feature out-of-the-box. I wanted to understand if iOS also supports this kind of behavior.
I know how to manually code such UX, but just wanted to confirm whether there is some inherent feature like on android which i can leverage?
Thanks.
Hi.
We discovered this strange behaviour when we're planning to migrate to Xcode 26.2 RC.
When our app is running on iOS 26, view controllers thar are pushed from the root of UITabBarController will show with an animation. The views are growing from either the top-left or bottom-right corner. This only happens when the hidesBottomBarWhenPushed variable is set to true. Also it only happens to view controllers that are pushed directly from a UITabBarController; subsequent view controllers that are pushed will not have this weird animation.
Since our app design requires hidesBottomBarWhenPushed to be true, we are asking if there is any way to fix this animation.
Please refer to the following gif:
We have tried methods described in this article but it doesn't work all the time: https://darjeelingsteve.com/articles/Fixing-UINavigationController-Push-Animation-Layout-Issues-on-iOS-26.html.
We've tried the following three methods:
This does not work at all. First-level view controllers are still showing with animation.
override func pushViewController(_ viewController: UIViewController, animated: Bool) {
super.pushViewController(viewController, animated: animated)
transitionCoordinator?.animate { _ in
UIView.performWithoutAnimation {
viewController.view.layoutIfNeeded()
}
}
}
This does not work as well.
override func pushViewController(_ viewController: UIViewController, animated: Bool) {
super.pushViewController(viewController, animated: animated)
transitionCoordinator?.animate(alongsideTransition: { [weak self] _ in
UIView.performWithoutAnimation {
self?.navigationBar.layoutIfNeeded()
}
}, completion: nil)
}
This works sometimes. However it breaks the push animation for some view controllers.
override func pushViewController(_ viewController: UIViewController, animated: Bool) {
super.pushViewController(viewController, animated: animated)
UIView.performWithoutAnimation {
viewController.view.layoutIfNeeded()
}
}
We've created a simple sample project that reproduces this problem. Please run it on a simulator running iOS 26.
https://drive.google.com/file/d/1q3pokphh1YDINH69LrHuqJQe8MijHQ2m/view?usp=sharing
If anyone has a solution to this please let me know. Thank you for reading.
Topic:
UI Frameworks
SubTopic:
UIKit
Hello developers,
atm im developing a small app focused on hiking. A core pice of the app is a Map() from MapKit. I only want a few points of interest to be visible on the map (e.g. no stores, no clubs etc.).
My question now is what modifier includes mountain Peaks? I tried .rockClimbing, .nationalPark, .landmark, .skiing & .hiking. However none of them makes mountain Peaks visible on the map.
The complete code would be:
Map()
.mapStyle(.standard(pointsOfInterest: .including([.rockClimbing, .nationalPark, .landmark, .skiing, .hiking])))
I'm using SwiftUI WebView and this error happens when app becomes inactive, the webview changes to blank, and will be in this state all along even if reopen a new webview. When I switch back to WKWebview, everything works fine.
environment Xcode 26.1(17B55) on macOS 15.7.1
Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))" UserInfo={NSLocalizedFailureReason=((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))}>
this is the code, pretty simple, in load() function i just call page.load().
WebView(vm.page)
.onAppear {
Task {
await vm.load()
}
}
UIViewController's modalInPopover is deprecated and might disappear in the near future. Is there any replacement?
UIViewController's presentViewController:animated:completion is not an equivalent because the modal style cannot be changed while the controller is already presented.
I'm using a custom modifier called AutoSheetDetentModifier to automatically size a sheet based on its content.
On iOS 26, it works as expected: the content height is measured correctly and the sheet shrinks to match that height.
However, on iOS 16, 17 and 18, the same code doesn’t work. The content height is still measured, but the sheet does not reduce its height. Instead, the sheet remains larger and the content appears vertically centered. (Note that content() includes ScrollView)
public struct AutoSheetDetentModifier: ViewModifier {
@State private var height: CGFloat = 380 // default value to avoid bouncing
public func body(content: Content) -> some View {
content
.modifier(MeasureHeightViewModifier(height: $height))
.presentationDetents([.height(height)])
}
}
public struct MeasureHeightViewModifier: ViewModifier {
@Binding var height: CGFloat
public func body(content: Content) -> some View {
content
.fixedSize(horizontal: false, vertical: true)
.background(
GeometryReader { geo -> Color in
DispatchQueue.main.async {
height = geo.size.height
}
return Color.clear
}
)
}
}
extension View {
public func applyAutoSheetDetent() -> some View {
self
.modifier(AutoSheetDetentModifier())
}
}
public var body: some View {
VStack {
header()
content() // includes ScrollView
footer()
}
.background(Color.customGray)
.applyAutoSheetDetent()
}
func content() -> some View {
ScrollView {
VStack {
ForEach(items) { item in
itemRow(item)
}
}
}
.frame(maxHeight: UIScreen.main.bounds.height * 0.7)
}
Screenshot from iOS 26 (working as expected):
Screenshot from iOS 18 (not working):
How can I make .presentationDetents(.height) shrink the sheet correctly on iOS 16–18, the same way it does on iOS 26?
Our app has a UITabBar and the compactInlineLayoutAppearance has a custom font set. This worked fine on iOS 26.0 and 26.1.
[self.bottomTabBar.standardAppearance.compactInlineLayoutAppearance.normal setTitleTextAttributes: @{
NSFontAttributeName:[UIFont fontWithName:@"AvenirNext-DemiBold" size:18.0]
}];
But on iOS 26.2, the system ignores this custom font. How can I apply a custom font to a UITabBar on iOS 26.2?
Hi,
I found an issue related to dynamic app icon changes using
UIApplication.shared.setAlternateIconName specifically on iOS 26.1.
Test Scenario
1. Change icon using:
UIApplication.shared.setAlternateIconName("TestIcon")
→ Works correctly.
2. Revert to primary icon using:
UIApplication.shared.setAlternateIconName(nil)
Issue on iOS 26.1
For some users, the device does not revert back to the primary icon when calling setAlternateIconName(nil).
To handle this case, we attempted to force the primary icon by explicitly calling:
UIApplication.shared.setAlternateIconName("AppIcon")
However, on iOS 26.1:
• As soon as this call is made,
the entire setAlternateIconName API stops working.
• Every subsequent call to setAlternateIconName fails.
• The API begins returning errors (e.g. NSPOSIXErrorDomain code 35).
• The issue persists until the device is rebooted.
Expected Behavior
We understand that providing "AppIcon" should not change the icon (since primary icon is restored using nil),
but on earlier versions of iOS (≤ 26.0):
• Calling "AppIcon" simply does nothing (no icon change)
• And setAlternateIconName(nil) works as expected to restore the default icon.
Problem Summary
• On iOS 26.1, calling setAlternateIconName("AppIcon") puts the icon system into a bad state.
• After this call:
• The API becomes unresponsive
• All icon changes fail
• Only a reboot restores normal behavior
• This regression does not occur on iOS 26.0 or earlier.
Request
Is this a known issue with the app icon system on iOS 26.1?
Should "AppIcon" explicitly be rejected, or is the freeze/error state unintended behavior?
Any guidance or confirmation would be greatly appreciated. Thanks!
Topic:
UI Frameworks
SubTopic:
UIKit
Hello,
While integrating the Liquid Glass UI introduced in iOS 26 into my existing app, I encountered an unexpected issue.
My app uses a UITabBarController, where each tab contains a UINavigationController,
and the actual content resides in each UIViewController.
Typically, I perform navigation using navigationController?.pushViewController(...) and hide the TabBar by setting vc.hidesBottomBarWhenPushed = true when needed.
This structure worked perfectly fine prior to iOS 26, and I believe many apps use a similar approach.
However, after enabling Liquid Glass UI, a problem occurs.
Problem Description
From AViewController, I push BViewController with hidesBottomBarWhenPushed = true.
BViewController appears, and the TabBar is hidden as expected.
When performing a swipe-back gesture, as soon as AViewController becomes visible, the TabBar immediately reappears (likely due to A’s viewWillAppear).
The TabBar remains visible for a short moment even if the gesture is canceled — during that time, it is also interactable.
Before iOS 26, the TabBar appeared synchronized with AViewController and did not prematurely show during the swipe transition.
Tried using the new iOS 18 API:
tabBarController?.setTabBarHidden(false, animated: true)
It slightly improves the animation behavior, but the issue persists.
If hidesBottomBarWhenPushed is now deprecated or discouraged,
migrating entirely to setTabBarHidden would require significant refactoring, which is not practical for many existing apps.
Is this caused by a misuse of hidesBottomBarWhenPushed,
or could this be a regression or design change in iOS 26’s Liquid Glass UI?