There are several ways we are supposed to be able to control a11y (accessibility) focus in FKA (Full Keyboard Access) mode.
We should be able to set up an @AccessibilityFocusState variable that contains an enum for the different views that we want to receive a11y focus. That works from VO (VoiceOver) but not from FKA mode. See this sample project on Github:
https://stackoverflow.com/questions/79067665/how-to-manage-accessibilityfocusstate-for-swiftui-accessibility-keyboard
Similarly, we are supposed to be able to use accessibilitySortPriority to control the order that views are selected when a user using FKA tabs between views. That also works from VO but not from FKA mode. In the sample code below, the `.accessibilitySortPriority() ViewModifiers cause VO to change to a non-standard order when you swipe between views, but it has no effect in FKA mode.
Is there a way to either set the a11y focus or change the order in which the views are selected that actually works in SwiftUI when the user is in FKA mode?
Code that should cause FKA to tab between text fields in a custom order:
struct ContentView: View {
@State private var val1: String = "val 1"
@State private var val2: String = "val 2"
@State private var val3: String = "val 3"
@State private var val4: String = "val 4"
var body: some View {
VStack {
TextField("Value 1", text: $val1)
.accessibilitySortPriority(3)
VStack {
TextField("Value 2", text: $val2)
.accessibilitySortPriority(1)
}
HStack {
TextField("Value 3", text: $val3)
.accessibilitySortPriority(2)
TextField("Value 4", text: $val4)
.accessibilitySortPriority(4)
}
}
.padding()
}
}```
SwiftUI
RSS for tagProvide views, controls, and layout structures for declaring your app's user interface using SwiftUI.
Posts under SwiftUI tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Trying to implement my own forward/back buttons for the new SwiftUI WebView and reading the documentation I’m totally lost.
What’s the recommended way of implementing forward/back behavior with this component?
Unexpected SwiftUI Transaction Behavior
This minimal example demonstrates an unexpected behavior in SwiftUI's Transaction API:
var transaction = Transaction(animation: .none)
transaction.addAnimationCompletion { print("This should not be called!") }
The Issue
The completion handler is called immediately after creation, even though the transaction was never used in any SwiftUI animation context (like withTransaction or other animation-related APIs).
Expected vs Actual Behavior
Expected: The completion handler should only be called after the transaction is actually used in a SwiftUI animation.
Actual: The completion handler is called right after creation, regardless of whether the transaction is used or not.
Current Workaround
To avoid this, I'm forced to implement defensive programming: only creating transactions with completion handlers at the exact moment they're going to be used. This adds unnecessary complexity and goes against the intuitive usage of the Transactions API.
Summary
As presented in the SwiftUI WWDC video, the new tabViewBottomAccessory should allow for unique contents for .inline. This is what was presented as being used for the Apple Music miniplayer. However, the functionality seems to be either missing or unintuitive. As seen in the photos attached, not only does .inline functionality not seem to do anything, but the inline accessory also has misaligned elements that cannot be fixed by conditionally modifying the contents.
Build Target
iOS 26.0
Details
This problem recurs on physical devices, simulators, and Xcode previews.
Here is a view I've constructed for use as a tabViewBottomAccessory:
struct FitnessToolbarAccessory: View {
@Environment(\.tabViewBottomAccessoryPlacement) var placement
var body: some View {
if (placement == .inline) {
Text("hello")
} else {
HStack {
HStack {
Image(systemName: "dumbbell.fill")
VStack(alignment: .leading) {
Text("Active Workout")
Text("Push Day - Chest")
.font(.system(size: 13))
}
Spacer()
Image(systemName: "pause.fill")
}
.padding()
}
}
}
}
Here is the result, working as expected in expanded mode:
And here is the result in inline mode after minimizing the tabViewBottomAccessory:
The content of this inline accessory is clearly incorrect, as it was specified to contain a Text view containing "hello". Additionally, the contents seem to have some incorrect alignment. This occurs regardless of the contents of the accessory, even plain text.
Prior to iOS 26, ToolbarItems with .bottomBar placement were convenient for tab-specific frequent actions.
With iOS 26’s new tab layering now obscuring such ToolbarItems, it’s unclear whether .tabViewBottomAccessory is the intended replacement or if another pattern (like persistent floating buttons) is encouraged instead.
What’s the recommended way to support quick, tab-specific actions under the new system?
I’ve tried conditionally rendering a .tabViewBottomAccessory based on the active tab, but this causes a crash, which I’ve reported as FB18479195.
Summary
When using .tabViewBottomAccessory in SwiftUI and conditionally rendering it based on the selected tab, the app crashes with a NSInternalInconsistencyException related to _bottomAccessory.displayStyle.
Steps to Reproduce
Create a SwiftUI TabView using a @SceneStorage selectedTab binding.
Render a .tabViewBottomAccessory with conditional visibility tied to selectedTab == .storage.
Switch between tabs.
Return to the tab that conditionally shows the accessory (e.g., “Storage”).
Expected Behavior
SwiftUI should correctly add, remove, or show/hide the bottom accessory view without crashing.
Actual Behavior
The app crashes with the following error:
Environment
iOS version: iOS 26 seed 2 (23A5276f)
Xcode: 26
Swift: 6.2
Device: iPhone 12 Pro
I have opened a bug report with the FB number: FB18479195
Code Sample
import SwiftUI
struct ContentView: View {
enum TabContent: String {
case storage
case recipe
case profile
case addItem
}
@SceneStorage("selectedTab") private var selectedTab: TabContent = .storage
var body: some View {
TabView(selection: $selectedTab) {
Tab(
"Storage", systemImage: "refrigerator", value: TabContent.storage
) {
StorageView()
}
Tab(
"Cook", systemImage: "frying.pan", value: TabContent.recipe
) {
RecipeView()
}
Tab(
"Profile", systemImage: "person", value: TabContent.profile
) {
ProfileView()
}
}
.tabBarMinimizeBehavior(.onScrollDown)
.tabViewBottomAccessory {
if selectedTab == .storage {
Button(action: {
}) {
Label("Add Item", systemImage: "plus")
}
}
}
}
}
I sometimes use Xcode 14.2.
Recently, I have an issue with simulators:
on some SwiftUI project, the simulator list is empty.
I created a new project. I see the complete list of simulators, but when running for a simulator, it fails with following diag;
Same error with UIKit project.
Details
Unable to boot the Simulator.
Domain: NSPOSIXErrorDomain
Code: 60
Failure Reason: launchd failed to respond.
User Info: {
DVTErrorCreationDateKey = "2025-06-29 06:16:35 +0000";
IDERunOperationFailingWorker = "_IDEInstalliPhoneSimulatorWorker";
Session = "com.apple.CoreSimulator.SimDevice.134EC197-BA6B-45DF-B5B2-61A1D4F14863";
}
--
Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding
Domain: com.apple.SimLaunchHostService.RequestError
Code: 4
--
Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
"device_model" = "iPhone15,2";
"device_osBuild" = "16.2 (20C52)";
"device_platform" = "com.apple.platform.iphonesimulator";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = "x86_64";
"operation_duration_ms" = 8341;
"operation_errorCode" = 60;
"operation_errorDomain" = NSPOSIXErrorDomain;
"operation_errorWorker" = "_IDEInstalliPhoneSimulatorWorker";
"operation_name" = IDERunOperationWorkerGroup;
"param_consoleMode" = 0;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 3;
"param_destination_isProxy" = 0;
"param_destination_platform" = "com.apple.platform.iphonesimulator";
"param_diag_MainThreadChecker_stopOnIssue" = 0;
"param_diag_MallocStackLogging_enableDuringAttach" = 0;
"param_diag_MallocStackLogging_enableForXPC" = 1;
"param_diag_allowLocationSimulation" = 1;
"param_diag_checker_tpc_enable" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 0;
"param_diag_memoryGraphOnResourceException" = 0;
"param_diag_queueDebugging_enable" = 1;
"param_diag_runtimeProfile_generate" = 0;
"param_diag_sanitizer_asan_enable" = 0;
"param_diag_sanitizer_tsan_enable" = 0;
"param_diag_sanitizer_tsan_stopOnIssue" = 0;
"param_diag_sanitizer_ubsan_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 0;
"param_launcher_UID" = 2;
"param_launcher_allowDeviceSensorReplayData" = 0;
"param_launcher_kind" = 0;
"param_launcher_style" = 0;
"param_launcher_substyle" = 0;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_runnable_type" = 2;
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphonesimulator16.2";
"sdk_osVersion" = "16.2";
"sdk_variant" = iphonesimulator;
}
--
System Information
macOS Version 12.7.1 (Build 21G920)
Xcode 14.2 (21534) (Build 14C18)
Timestamp: 2025-06-29T08:16:35+02:00
I filed a bug report: FB18475006
Platform: visionOS 2.6
Framework: RealityKit, SwiftUIComponent: ImagePresentationComponent
I’m working with the new ImagePresentationComponent from visionOS 26 and hitting a rendering limitation when switching to .spatialStereoImmersive viewing mode within a WindowGroup context.
This is what I’m seeing:
Pure immersive space: ImagePresentationComponent with .spatialStereoImmersive mode works perfectly in a standalone ImmersiveSpace
Mode switching API: All mode transitions work correctly (logs confirm the component updates)
Spatial content: .spatialStereo mode renders correctly in both window and immersive contexts.
This is where it’s breaking for me:
Window context: When the same RealityView + ImagePresentationComponent is placed inside a WindowGroup (even when that window is floating in a mixed immersive space), switching to .spatialStereoImmersive mode shows no visual change
The API calls succeed, state updates correctly, but the immersive content doesn’t render.
Apple’s Spatial Gallery demonstrates exactly what I’m trying to achieve:
Spatial photos displayed in a window with what feels like horizontal scroll view using system window control bar, etc.
Tapping a spatial photo smoothly transitions it to immersive mode in-place.
The immersive content appears to “grow” from the original window position by just changing IPC viewing modes.
This proves the functionality should be possible, but I can’t determine the correct configuration.
So, my question to is:
Is there a specific RealityView or WindowGroup configuration required to enable immersive content rendering from window contexts that you know of?
Are there bounds/clipping settings that need to be configured to allow immersive content to “break out” of window constraints?
Does .spatialStereoImmersive require a specific rendering context that’s not available in windowed RealityView instances?
How do you think Apple’s SG app achieves this functionality?
For a little more context:
All viewing modes are available: [.mono, .spatialStereo, .spatialStereoImmersive]
The spatial photos are valid and work correctly in pure immersive space
Mixed immersive space is active when testing window context
No errors or warnings in console beyond the successful mode switching logs I’m getting
Any insights into the proper configuration for window-hosted immersive content
I am trying to create a radio group picker in SwiftUI, similar to this:
https://www.neobrutalism.dev/docs/radio-group
I already have a working view based version here:
https://github.com/rational-kunal/NeoBrutalism/blob/main/Sources/NeoBrutalism/Components/Radio/Radio.swift
Now I want to replace it with a more concise/swifty way of Picker with PickerStyle API:
However, I can't find any official documentation or examples showing how to implement PickerStyle. Is it possible to create my own PickerStyle? If not, what’s the recommended alternative to achieve a radio‑group look while still using Picker?
struct NBRadioGroupPickerStyle: PickerStyle {
static func _makeView<SelectionValue>(value: _GraphValue<_PickerValue<NBRadioGroupPickerStyle, SelectionValue>>, inputs: _ViewInputs) -> _ViewOutputs where SelectionValue : Hashable {
<#code#>
}
static func _makeViewList<SelectionValue>(value: _GraphValue<_PickerValue<NBRadioGroupPickerStyle, SelectionValue>>, inputs: _ViewListInputs) -> _ViewListOutputs where SelectionValue : Hashable {
<#code#>
}
}
Crossposting: https://forums.swift.org/t/how-can-i-build-a-custom-pickerstyle-in-swiftui/80755
I made a small project that freezes after the following steps:
Run the app
Turn on VoiceOver
Tap on "Header" once so it is read out loud
Turn off VoiceOver
Scroll up and down really quickly
Using the Time Profiler, the items in the Main Thread followed by significant drops are:
19.11 s 85.1% 0 s closure #2 in closure #1 in ViewRendererHost.render(interval:updateDisplayList:targetTimestamp:)
13.05 s 58.1% 4.00 ms ViewGraph.updateOutputs(async:)
7.97 s 35.5% 83.00 ms AG::Graph::UpdateStack::update()
5.76 s 25.6% 19.00 ms LayoutScrollableTransform.updateValue()
1.73 s 7.7% 2.00 ms specialized NativeDictionary.setValue(:forKey:isUnique:)
579.00 ms 2.6% 58.00 ms 0x100a8c908
311.00 ms 1.4% 165.00 ms __thread_stack_pcs
I see the memory usage increase by about 0.6 MB per second while frozen.
And there are a few things that prevent the freeze:
Changing LazyVStack for VStack
Removing the VStack from the Section
Removing the header: parameter from the Section
Reducing the range of the ForEach
Move the Text(verbatim: "Text at same level as ForEach containing Section") outside of the LazyVStack
However, these are all things I need to keep for my actual app. So what is causing this hang? Am I using SwiftUI in any way it's not intended to be used?
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
VStack(alignment: .leading) {
Image(systemName: "pencil.circle.fill")
Text("Title")
Text("Label")
}
ScrollView {
LazyVStack {
Section {
VStack {
ForEach(0..<70) { _ in
Text(verbatim: "A")
}
}
} header: {
Text(verbatim: "Header")
}
Text(verbatim: "Text at same level as ForEach containing Section")
}
}
}
}
}
AppDelegate:
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
window.rootViewController = UINavigationController(rootViewController: MainViewController())
window.makeKeyAndVisible()
self.window = window
return true
}
}
MainViewController:
import UIKit
import SwiftUI
final class MainViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let swiftUIView = ContentView()
let hostingController = UIHostingController(rootView: swiftUIView)
addChild(hostingController)
hostingController.view.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(hostingController.view)
NSLayoutConstraint.activate([
hostingController.view.topAnchor.constraint(equalTo: view.topAnchor),
hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
hostingController.didMove(toParent: self)
view.backgroundColor = .white
}
}
Previously, I sorted my FetchResult in a TableView like this:
@FetchRequest(
sortDescriptors: [SortDescriptor(\.rechnungsDatum, order: .forward)],
predicate: NSPredicate(format: "betragEingang == nil OR betragEingang == 0")
)
private var verguetungsantraege: FetchedResults<VerguetungsAntraege>
...
body
...
Table(of:VerguetungsAntraege.self, sortOrder: $verguetungsantraege.sortDescriptors) {
TableColumn("date", value:\.rechnungsDatum) { item in
Text(Formatters.dateFormatter.string(from: item.rechnungsDatum ?? Date()) )
}
.width(120)
TableColumn("rechNrKurz", value:\.rechnungsNummer) { item in
Text(item.rechnungsNummer ?? "")
}
.width(120)
TableColumn("betrag", value:\.totalSum ) {
Text(Formatters.currencyFormatter.string(from: $0.totalSum as NSNumber) ?? "kein Wert")
}
.width(120)
TableColumn("klient") {
Text(db.getKlientNameByUUID(id: $0.klient ?? UUID(), moc: moc))
}
} rows: {
ForEach(Array(verguetungsantraege)) { antrag in
TableRow(antrag)
}
}
There seem to be changes here in Xcode 26. In any case, I always get the error message in each line with TableColumn("title", value: \.sortingField)
Ambiguous use of 'init(_:value:content:)'
Does anyone have any idea what's changed? Unfortunately, the documentation doesn't provide any information.
I'm developing a calculator app and working to ensure a great experience for both VoiceOver and Braille display users.
For expressions like (2+3)×5, I need two different accessibility outputs:
VoiceOver (spoken): A descriptive string like “left paren two plus three right paren times five,” provided via .accessibilityValue. I'm using a custom spellOut function since VoiceOver doesn't announce parentheses—which are kind of important when doing math!
Braille (symbolic): The literal math string (2+3)×5, provided using .accessibilityCustomContent("", ...), with an empty label so it’s not spoken aloud.
The issue: I don’t have access to a Braille display device and Xcode’s Accessibility Inspector doesn’t seem to show the custom content.
Is there any way to confirm that custom Braille content is being set correctly in Simulator or with other tools?
Or…is there a "math mode" in VoiceOver that forces it to announce parentheses?
Any advice or workarounds would be much appreciated!
Thanks,
Uhl
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
External Accessory
iOS
Accessibility
SwiftUI
On iPadOS 26, dragging my draggable() View near the edge of the screen is causing a new window to open.
This doesn't happen with .onDrag on iPadOS 26, or with either .draggable() or .onDrag on iPadOS 18.5.
This is not something I'm intending to offer in my app, and doesn't really make sense. Is there any way to prevent this from happening? Is this a bug? I couldn't find any new documentation.
The thing being dragged: the "Font" rectangle on the right side of the screen, which represents an item in my app that is reorder-able when multiple are present.
I don't think the .searchable in the bottom bar / glass look works when you have TabView that has NavStack.
While editing the search text using the external keyboard (with VoiceOver on), if I try to navigate the to List using the keyboard, the focus jumps back to the search field immediately, preventing selection of list items. It's important to note that the voiceover navigation alone without a keyboard works as expected.
It’s as if the List never gains focus—every attempt to move focus lands back on the search field.
The code:
struct ContentView: View {
@State var searchText = ""
let items = ["Apple", "Banana", "Cherry", "Date", "Elderberry", "Fig", "Grape"]
var filteredItems: [String] {
if searchText.isEmpty {
return items
} else {
return items.filter { $0.localizedCaseInsensitiveContains(searchText) }
}
}
var body: some View {
if #available(iOS 16.0, *) {
NavigationStack {
List(filteredItems, id: \.self) { item in
Text(item)
}
.navigationTitle("Fruits")
.searchable(text: $searchText)
}
} else {
NavigationView {
List(filteredItems, id: \.self) { item in
Text(item)
}
.navigationTitle("Fruits")
.searchable(text: $searchText)
}
}
}
}
I'm a novice in RealityKit and ARKit. I'm using ARKit in SwiftUI to show a cube with a number as shown below.
import SwiftUI
import RealityKit
import ARKit
struct ContentView : View {
var body: some View {
return ARViewContainer()
}
}
#Preview {
ContentView()
}
struct ARViewContainer: UIViewRepresentable {
typealias UIViewType = ARView
func makeUIView(context: UIViewRepresentableContext<ARViewContainer>) -> ARView {
let arView = ARView(frame: .zero, cameraMode: .ar, automaticallyConfigureSession: true)
arView.enableTapGesture()
return arView
}
func updateUIView(_ uiView: ARView, context: UIViewRepresentableContext<ARViewContainer>) {
}
}
extension ARView {
func enableTapGesture() {
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTap(recognizer:)))
self.addGestureRecognizer(tapGestureRecognizer)
}
@objc func handleTap(recognizer: UITapGestureRecognizer) {
let tapLocation = recognizer.location(in: self) // print("Tap location: \(tapLocation)")
guard let rayResult = self.ray(through: tapLocation) else { return }
let results = self.raycast(from: tapLocation, allowing: .estimatedPlane, alignment: .any)
if let firstResult = results.first {
let position = simd_make_float3(firstResult.worldTransform.columns.3)
placeObject(at: position)
}
}
func placeObject(at position: SIMD3<Float>) {
let mesh = MeshResource.generateBox(size: 0.3)
let material = SimpleMaterial(color: UIColor.systemRed, roughness: 0.3, isMetallic: true)
let modelEntity = ModelEntity(mesh: mesh, materials: [material])
var unlitMaterial = UnlitMaterial()
if let textureResource = generateTextResource(text: "1", textColor: UIColor.white) {
unlitMaterial.color = .init(tint: .white, texture: .init(textureResource))
modelEntity.model?.materials = [unlitMaterial]
let id = UUID().uuidString
modelEntity.name = id
modelEntity.transform.scale = [0.3, 0.1, 0.3]
modelEntity.generateCollisionShapes(recursive: true)
let anchorEntity = AnchorEntity(world: position)
anchorEntity.addChild(modelEntity)
self.scene.addAnchor(anchorEntity)
}
}
func generateTextResource(text: String, textColor: UIColor) -> TextureResource? {
if let image = text.image(withAttributes: [NSAttributedString.Key.foregroundColor: textColor], size: CGSize(width: 18, height: 18)), let cgImage = image.cgImage {
let textureResource = try? TextureResource(image: cgImage, options: TextureResource.CreateOptions.init(semantic: nil))
return textureResource
}
return nil
}
}
I tap the floor and get a cube with '1' as shown below.
The background color of the cube is black, I guess. Where does this color come from and how can I change it into, say, red? Thanks.
hi everyone, any thought on how to implement a RichText(markdown) live editor using the new TextEditor(text: AttributedString, selection: AttributedTextSelection)?
Having issues like:
how to get the location of the selected text relatived to the TextEditor bounds, which is used to show and position a floating toolbar.
how to detect the cursor point is a new line and the content is "# ", (of couse now the user enter a space after the "#"), and if so, how to apply a H1 heading format to that line
much more issues like this, but these two are how to get me started, thanks
struct TextEditor8: View {
@State var text: AttributedString
@State var selection = AttributedTextSelection()
@State var isShowFloatingToolbar = false
@State var toolbarPosition: CGPoint = .zero
init() {
var text = AttributedString("Hello ✋🏻,Who is ready for Cooking?")
let range = text.characters.indices(where: \.isUppercase)
text[range].foregroundColor = .blue
_text = State(initialValue: text)
}
var body: some View {
ZStack(alignment: .topLeading) {
GeometryReader { geo in
TextEditor(text: $text, selection: $selection)
.onChange(of: selection, perform: { newV in
let v = text[newV]
if v.characters.isEmpty {
isShowFloatingToolbar = false
} else {
isShowFloatingToolbar = true
toolbarPosition = CGPoint(x: 20, y: 20) // how to get CGPoint relatived to TextEditor from selection
}
print("vvvv", v.characters.isEmpty)
})
}
if isShowFloatingToolbar {
FloatingToolbarAtSelection()
.position(toolbarPosition)
}
}
}
}
Hello,
I’m presenting the familyActivityPicker from a presented sheet in my application.
When I select some apps, categories or websites and tap “Done”, the familyActivityPicker is dismissed but the presenting sheet is also dismissed on iOS 18.4, iOS 18.5, iOS 26 beta 1 and 2. If I tap on “Cancel” from the familyActivityPicker, the sheet is also dismissed on iOS 18.4, iOS 18.5, iOS 26 beta 1 and 2.
The same code works perfectly fine on iOS 18.0, iOS 18.1, iOS 18.2 and iOS 18.3.
Is this a known-issue?
If opened the feedback FB18369821 for this.
Regards,
Axel
Topic:
App & System Services
SubTopic:
General
Tags:
SwiftUI
Family Controls
Managed Settings
Screen Time
When using the writingToolsBehavior API on a TextField and the app compiled with the iOS 26 SDK is run on an iOS 18 device, the app crashes with a symbol not found error.
It only crashes on the release build configuration and not on debug.
dyld[5274]: Symbol not found: _$s7SwiftUI17EnvironmentValuesV21_writingToolsBehaviorAA07WritingfG0VSgvg Referenced from: <1306655E-6DF7-3B2A-94A3-7202149E82F3> /private/var/containers/Bundle/Application/88E47904-4884-4279-9E96-0EC366970389/WritingToolsTest.app/WritingToolsTest Expected in: <165D3305-401E-37C2-8387-C1BFB54CFFDE> /System/Library/Frameworks/SwiftUI.framework/SwiftUI
Feedback ID: FB17980516
Hi,
I'm trying to create a custom bottom toolbar for my app and want to use same fade-blur effect as iOS uses under navigation and tab bars. Having trouble doing that.
Here is what I tried:
Screenshot 1: putting my custom view in a toolbar/ToolBarItem(placement: .bottomBar). This works only in NavigationStack, and it adds a glass pane that I do not want (I want to put a custom component there that already has correct glass pane)
Screenshot 2: using safeAreaBar or safeAreaInset in any combination with NavigationStack and/or .scrollEdgeEffectStyle(.soft, for: .bottom). Shows my component correctly, but does not use fade-blur.
Can you please help me to find out the correct way of doing that? Thanks!
^ Screenshot 1
^ Screenshot 2
Test code:
struct ContentView2: View {
var body: some View {
NavigationStack {
ScrollView(.vertical) {
VStack {
Color.red.frame(height: 500)
Color.green.frame(height: 500)
}
}
.ignoresSafeArea()
.toolbar() {
ToolbarItem(placement: .bottomBar) {
HStack {
Text("bottom")
Spacer()
Text("text content")
}
.bold().padding()
.glassEffect().padding(.horizontal)
}
}
}
}
}