Navigation Title no longer showing for first Tab in iOS/iPadOS 26 (Directives) in my app Starship SE Corps when running is Xcode 26 simulator and on iPad device itself running iPadOS 26 beta.
Launch app
Notice Navigation Title “Directives” is missing from top tab in Sidebar and Floating Tab View (iPad) and TabView (iOS).
Navigate to other tabs and Navigation Titles appear as expected.
Worked fine (as expected) in iOS/iPadOS 18.5, but broken in iOS/iPadOS 26.
Reference Feedback: FB17987650
SwiftUI
RSS for tagProvide views, controls, and layout structures for declaring your app's user interface using SwiftUI.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
In the small example below, I have set .preferredColorScheme(.dark). I am pushing a view that has a List. I have a custom background color.
When .scrollEdgeEffectStyle(.hard, for: .all) is used, the pushed view top and bottom safe areas flash black before being replaced by the blue background color.
If I change this to .scrollEdgeEffectStyle(.soft, for: .all), the issue goes away.
If I do not set preferredColorScheme(.dark), the issue also goes away.
I filled FB18465023, but wonder if I am just doing something wrong? Video of sample running: https://www.youtube.com/shorts/87rWqHtdmKw.
var body: some View {
NavigationStack {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
NavigationLink("Push New View") {
PushedView()
}
.buttonStyle(.glass)
.padding()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.ignoresSafeArea(.all)
.background(.blue)
}
.preferredColorScheme(.dark)
}
}
struct PushedView: View {
@State private var searchText = ""
var body: some View {
List {
ForEach(1...30, id: \.self) { index in
Label("Label \(index)", systemImage: "number.circle")
.listRowBackground(Color.blue)
}
}
// This causes the top and bottom safe areas to start off black before
// getting the blue background from below
.scrollEdgeEffectStyle(.hard, for: .all)
// This does not have the issue
// .scrollEdgeEffectStyle(.hard, for: .all)
.listStyle(.plain)
.background(.blue)
.searchable(text: $searchText, prompt: "Search labels...")
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button("Toolbar Button", systemImage: "questionmark") {
print("touched")
}
}
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
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 have a LIVE imessage sticker app with simple UI that is auto installed under the sticker section. And i am trying to rewrite the app but the new app, when testing, always publish under the imessage app category instead of under the sticker category.
here is the live app on app store: https://apps.apple.com/us/app/qoobee-agapi-stickers/id1176590163
Does anyone know how to get my imessage app published under the sticker category?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Hello. I want to use an icon created with Icon Composer to change the app icon in my iOS 26 app.
UIApplication.shared.setAlternateIconName("AppIcon")
This code works with the icon included in Assets.xcassets (AppIconOld) and the default icon specified in Info.plist (AppIcon.icon), but it does not work with another icon (AppIconRed.icon).
All icon names (AppIconOld, AppIcon, AppIconRed) are included in the “Alternate App Icon Sets” in Build Settings.
Also, I can’t display the .icon file as an image. If I use the old method to load it as a UIImage, the image is retrieved, but its appearance is not accurate.
Topic:
UI Frameworks
SubTopic:
SwiftUI
The default behavior on UIScrollView is that "canCancelContentTouches" is true.
If you add a UIButton to a UICollectionViewCell and then scroll (drag) the scroll view with a touch beginning on that button in that cell, it cancels ".touchUpInside" on the UIButton.
However, if you have a Button in a SwiftUI view configured with "contentConfiguration" it does not cancel the touch, and the button's action is triggered if the user is still touching that cell when the scroll (drag) completes.
Is there a way to forward the touch cancellations to the SwiftUI view, or is it expected that all interactivity is handled only in UIKit, and not inside of "contentConfiguration" in specific cases? This behavior seems to occur on all SwiftUI versions supporting UIHostingConfiguration so far.
I'm using GoogleMaps in my project.
Legacy preview works well but new preview (Xcode 16.3.1 beta) produces error. It doesn't seem to find Googlemaps.a.
== PREVIEW UPDATE ERROR:
FailedToLaunchAppError: Failed to launch ***
==================================
| [Remote] JITError
|
| ==================================
|
| | [Remote] CouldNotLoadInputStaticArchiveFile: Could not load static archive during preview: /Users/***/Library/Developer/Xcode/DerivedData/BOA-eiluspltxasszsfkpqrnnsxsjhth/Build/Products/Debug_BOA_Inhouse-iphonesimulator/GoogleMaps.a
| |
| | path: /Users/***/Library/Developer/Xcode/DerivedData/BOA-eiluspltxasszsfkpqrnnsxsjhth/Build/Products/Debug_BOA_Inhouse-iphonesimulator/GoogleMaps.a
| |
| | ==================================
| |
| | | [Remote] XOJITError
| | |
| | | XOJITError: arm64 slice of /Users/***/Library/Developer/Xcode/DerivedData/BOA-eiluspltxasszsfkpqrnnsxsjhth/Build/Products/Debug_BOA_Inhouse-iphonesimulator/GoogleMaps.a does not contain an archive
I don't think the .searchable in the bottom bar / glass look works when you have TabView that has NavStack.
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
}
}
Hello, im getting popping / crackling sounds from my Macbook Pro (M4 2024) speakers.
This happens when you do many certain tasks like click buttons or toggling switches when xcode has a simulator open and any background audio is playing, like spotify.
The speakers go crazy especially when starting the simulator in xcode with music in background.
Ive tried:
Using blackhole, and changing audio output in the simulator app
Deleting both .plist files form preferences file.
"coreaudiod" trick in terminal
restarting many times
different xcode versions and simulators and swift files
Nothing has worked. Any help?
I'm still unable to achieve the effects as shown.
The tinting of the buttons in a .toolbar. The iOS Beta 2 shows in Mail show at can be done.
The creation of a true clear glass container as use extensively in iOS26.
Hello there, I ran into a very strange layout issue in SwiftUI. Here's the View:
struct OnboardingGreeting: View {
/// ...
let carouselSpacing: CGFloat = 7
let carouselItemSize: CGFloat = 110
let carouselVelocities: [CGFloat] = [0.5, -0.25, 0.3, 0.2]
var body: some View {
ZStack(alignment: Alignment(horizontal: .center, vertical: .iconToCarouselBottom)) {
VStack(spacing: carouselSpacing) {
ForEach(carouselVelocities, id: \.self) { velocityValue in
InfiniteHorizontalCarousel(
albumNames: albums,
artistNames: artists,
itemSize: carouselItemSize,
itemSpacing: carouselSpacing,
velocity: velocityValue
)
}
}
.alignmentGuide(.iconToCarouselBottom) { context in
context[VerticalAlignment.bottom]
}
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .top)
LinearGradient(
colors: [.black, .clear],
startPoint: .bottom,
endPoint: .top
)
// Top VStack
VStack(spacing: 0) {
RoundedRectangle(cornerRadius: 18)
.fill(.red)
.frame(width: 95, height: 95)
.alignmentGuide(.iconToCarouselBottom) { context in
context.height / 2
}
Text("Welcome to Music Radar!")
.font(.title)
.fontDesign(.serif)
.bold()
Text("Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum Lorem Impsum")
.font(.body)
.fontDesign(.serif)
PrimaryActionButton("Next") {
// navigate to the next screen
}
.padding(.horizontal)
}
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
}
.ignoresSafeArea(.all, edges: .top)
.statusBarHidden()
}
}
extension VerticalAlignment {
private struct IconToCarouselBottomAlignment: AlignmentID {
static func defaultValue(in context: ViewDimensions) -> CGFloat {
context[VerticalAlignment.center]
}
}
static let iconToCarouselBottom = VerticalAlignment(
IconToCarouselBottomAlignment.self
)
}
At this point the view looks like this:
I want to push the Button in the Top VStack to the bottom of the screen and the red rounded rectangle to stay pinned to the bottom of the horizontal carousel (hence the custom alignment guide being introduced). The natural solution would be to add the Spacer(). However, for some reason when I do it, it results in the button going all the way down to outside of the screen, which means that the bottom safe area isn't being respected. Using the alignment parameter in the flexible frame also doesn't work the way I want it to. I suspect that custom alignment guide can cause this behavior but I can't find the way to fix it. Help me out, please.
I Implement a 'SubscriptionStoreView' using 'groupID' into a project (iOS is targeting 17.2 and macOS is targeting 14.1).Build/run the application locally (both production and development environments will work fine), however once the application is live on the AppStore in AppStoreConnect, SubscriptionStoreView no longer shows products and only shows 'Subscription Unavailable' and 'The subscription is unavailable in the current storefront.' - this message is shown live in production for both iOS and macOS targets. There is no log messages shown in the Console that indicate anything going wrong with StoreKit 2, but I haven't made any changes to my code and noticed this first start appearing about 5 days ago.
I expect the subscription store to be visible to all users and for my products to display. My application is live on both the iOS and macOS AppStores, it passed App Review and I have users who have previously been able to subscribe and use my application, I have not pushed any new changes, so something has changed in StoreKit2 which is causing unexpected behaviour and for this error message to display. As 'SubscriptionStoreView' is a view provided by Apple, I'm really not sure on the pathway forward other than going back to StoreKit1 which I really don't want to do.
Is there any further error information that can be provided on what might be causing this and how I can fix it? (I have created a feedback ticket FB13658521)
Our app was just rejected by Apple because they say the subscription management sheet never loads. It just spins indefinitely.
We're using StoreKit's manageSubscriptionsSheet view modifier to present the sheet, and it's always worked for us when testing in SandBox.
Has anyone else had this problem?
Given that it's Apple's own code that got us rejected, what's our path forward?
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)
}
}
}
}
With the new @Observable macro, it looks like every time the struct of a view is reinitialized, any observable class marked as @State in the struct also gets reinitialized. Moreover, the result of the reinitialization immediately gets discarded.
This is in contrast to @StateObject and ObservableObject, where the class would only be initialized at the first creation of the view. The initialization method of the class would never be called again between view updates.
Is this a bug or an expected behavior? This redundant reinitialization causes performance issues when the init method of the observable class does anything slightly heavyweight.
Feedback ID: FB13697724
In my app I have TabView PageTabViewStyle(indexDisplayMode: .never) style and I want to display banner view on the top of the screen which, when displayed, pushes all other content down. Basic view setup is:
struct ContentView: View {
@StateObject private var viewModel = ContentViewModel()
@State var selectedTab = 0
var body: some View {
return VStack(spacing: 0) {
if viewModel.showingBanner {
bannerView
}
TabView(selection: $selectedTab, content: {
ForEach(0..<3) { index in
tabContents(index)
.tag(index)
}
})
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
}
.ignoresSafeArea(edges: [.bottom])
}
func tabContents(_ index: Int) -> some View {
VStack {
Text("Hello, \(index)!")
.font(.system(size: 48, weight: .bold))
}
}
var bannerView: some View {
VStack {
Label("Banner", systemImage: "exclamationmark.triangle")
.font(.largeTitle)
.foregroundStyle(.white)
.padding(4)
}
.frame(maxWidth: .infinity)
.background(.red)
.onTapGesture {
withAnimation {
viewModel.showingBanner = false
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
withAnimation {
viewModel.showingBanner = true
}
}
}
}
}
The problem is that when banner view is added, tab view content jitters during animation. There's several workarounds that make jittering go away, but by using them I lose some functionality:
remove .ignoresSafeArea(edges: [.bottom]) - I need content to extend into safe area
don't use page tabViewStyle - I lose scrolling between tabs
Use plain ScrollView - I lose automatic binding to the selected tab
Am I missing something in my TabView or content setup that causes this issue or my only recourse is to switch to using ScrollView instead of TabView for my use case?
Topic:
UI Frameworks
SubTopic:
SwiftUI
I have an App Intent that conforms to ShowsSnippetView and returns a view that is shown in the Siri interface after the shortcut runs. The view simply consists of a VStack with a Text element, with no special styling. When my device is set to dark mode, the view doesn't adapt: the text is black, but the background of the Siri interface is a transparent dark gray, which makes the text almost unreadable. The text should be white in dark mode. The colorScheme environment value inside the view corresponds to light mode, even though the device is set to dark mode. This is most likely a bug in iOS.
I have a widget that runs well on iOS 18. It is configurable and implements AppIntentTimelineProvider on the Provider. On iOS 17 it will call the placeholder method 7 times and not call the timeline method. The configuration intent implements WidgetConfigurationIntent.
I've looked through the console logs and saw "ApplicationExtension record not found" but I'm not sure where to go from there. Why would the same widget work fine on iOS 18 and not 17? If I implement TimelineProvider and use a StaticConfiguration it works on iOS 17.
Any help / guidance would be appreciated.
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)
}
}
}
}
}