Hello, I'm having a problem with the .glasseffect modifier in a view of a SwiftUI application. I have a list that starts with a static element, followed by several dynamic entries, and then another static element. I've applied the .glasseffect modifier to all the elements, and it works fine except for the first static element. I think I've figured out what's causing it. This element contains two date pickers, and if I comment one out, it works. As soon as both are present, I get a BAD_ACCESS_ERROR. Oddly enough, this only happens on the tablet. Everything runs normally in the simulator. If I remove the .glassmodifier and use a normal background, it still works. Is this a bug, or is it against Liquid Glass to have two date pickers in a stack and then use the .glasseffect modifier?
Search results for
swiftui
16,583 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi everyone, I’m trying to reproduce the layout Apple Music uses for playlists, where there is header content above the table (artwork, title, buttons), and when you scroll, everything scrolls together—the header and table rows move as a single scrollable region. Here’s an example of what I’m trying to achieve: I’m using SwiftUI’s Table view and I haven’t found a clean way to place custom content above the table while keeping everything inside the same scroll view. Is there currently a recommended way to achieve Apple Music–style scrollable header + table content using SwiftUI? Thanks!
I’m running Xcode 26.1.1 (17B100) with deployment target iOS 18.0+, and I’m seeing a consistent and reproducible issue on real devices (iPhone 13 Pro, iPhone 15 Pro): Problem The first time the user taps into a TextField or a SwiftUI .searchable field after app launch, the app freezes for 30–45 seconds before the keyboard appears. During the freeze, the device console floods with: XPC connection interrupted Reporter disconnected. { function=sendMessage, reporterID=XXXXXXXXXXXX } -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard customInfoType = UIEmojiSearchOperations After the keyboard finally appears once, the issue never happens again until the app is force-quit. This occurs on device Reproduction Steps Minimal reproducible setup: Create a new SwiftUI app. Add a single TextField or .searchable modifier. Install Firebase (Firestore or Analytics is enough). Build and run on device. Tap the
Topic:
UI Frameworks
SubTopic:
SwiftUI
I just wanted to say thank you to the team that added coding assistance (Chat-GPT) to Xcode. I'm just learning SwiftUI and I love how it made suggestions to improve my app and shows me what it does and explains why it does what it does.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hi Carina, here's the requested information: 1) Sample of training data: See attached sample.json sample.json **2) AdapterTrainingConfiguration ** config3 = AdapterTrainingConfiguration( epochs=6, learning_rate=1e-4, batch_size=2, # Try increasing if memory allows gradient_accumulation_steps=4, # Reduce accordingly enable_activation_checkpointing=True, precision='bf16-mixed', max_sequence_length=4095, compile_model=False ) train_adapter( train_data=TRAIN_FILE, eval_data=VALID_FILE, config=config3, checkpoint_dir='/content/drive/MyDrive/checkpoints' ) 3) at inference time (from my unit tests) https://github.com/MAOShea/Hello-World-Tools-Adapter-SwiftUI/blob/main/Hello%20World%20ToolsTests/LanguageModelComparisonTests.swift struct SessionFactory { static func createSession( modelType: ModelType, systemPrompt: SystemPromptVersion ) throws -> LanguageModelSession { let tools = [WriteUbersichtWidgetToFileSystem()] switch modelType { case .base: let instructions = systemPrompt.prompt return LanguageMode
Topic:
Machine Learning & AI
SubTopic:
Foundation Models
Hi, does anyone know how to enable creating or configuring Near NFC Reader in SwiftUI? I've already added the capability, the permissions in info.plist, the entitlement, and the SwiftUI code, but without success. Here's the example code: class PaymentT2PViewModel: NSObject, ObservableObject { @Published var paymentT2PUIState: PaymentT2PUIState // MARK: - NFC Properties @Published var nfcMessage: String = .empty @Published var isNFCReading: Bool = false private var nfcSession: NFCTagReaderSession? init(paymentT2PUIState: PaymentT2PUIState) { self.paymentT2PUIState = paymentT2PUIState super.init() ) } func startNFCReading() { print(INICIO: startNFCReading llamado) guard NFCTagReaderSession.readingAvailable else { print(ERROR: NFC NO disponible en este dispositivo) Task { @MainActor in self.nfcMessage = NFC no disponible en este dispositivo } return } print(NFC disponible, creando sesión...) nfcSession = NFCTagReaderSession( pollingOption: [.iso14443, .iso15693, .iso18092], delegate: self, queu
I literally just bought a new mac studio for the sole purpose of writing a mac desktop app. The very first thing I tried on day one was to write a simple sidebar with customizable toolbar. and it crashed instantly. I'm really shocked this is a know issue and Apple has completely ignored it. Yes, I tried the remove: .sidebar hack, but the toolbar has so many bugs and it's impossible to add the toggle sidebar button and get it working with the customizer. everything goes crazy. Sample app I prepared thinking someone might give this some attention: https://github.com/sgehrman/SwiftUIAppBugs Apple developers have always been treated poorly. And Cocoa was also full of bugs. I had hoped swiftUI would finally work.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
I'm working through various coding tutorials and have encountered the same warning numerous times. First, I must say that the symbolic breakpoint message is most unhelpful as I am developing in SwiftUI, not UIKit and have no idea where to place that breakpoint. Second, I did some experiments and found that one place the warning was coming from using the Button initializer with titleKey and systemImage parameters. A Button without systemImage did not cause the warning. I found that if instead I used the Button initializer with action and label parameters and added an Image using systemName for the label, there was no warning.
Topic:
Community
SubTopic:
Apple Developers
Hi, I have put together a pair of unit tests that run the same scenario against two separate language models: the Apple Foundation base model, my fine-tuned adapter model. While both are able to successfully complete a first prompt/reply turn, the LanguageModelSession that is running against the adapter model runs out of context window in turn 2. A very important nuance is that while both models operate with the same system prompt: a) for the unit test running against the base model, the system prompt is passed as instructions when instantiating the LanguageModelSession b) in the unit test running against the adapter model, the system prompt is baked into the training data. Here's the link to the analysis of the behaviour of the two tests and how they differ (compiled by Claude, as you'll no doubt detect from the superb over-confidence on display that is typical of AI agents) : https://github.com/MAOShea/Hello-World-Tools-Adapter-SwiftUI/blob/main/SUPPORT_REQUEST_TranscriptStorageDifference.md The tw
Topic:
Machine Learning & AI
SubTopic:
Foundation Models
I'm also experiencing this issue, but I'm not using Charts. It's when navigating back to my Home tab on macOS only. This works fine on iOS. import SwiftData import SwiftUI struct ContentView: View { @Environment(.modelContext) private var modelContext @Query private var publications: [Publication] @State private var publicationError: EncodedPublicationError? @State private var showErrorAlert = false @State private var selectedTab = 0 var body: some View { NavigationStack { TabView(selection: $selectedTab) { ScrollView { FeaturedView() RecentlyOpenedView() Spacer(minLength: 20) RecentlyUpdatedView() Spacer(minLength: 60) } .tag(0) .tabItem { Label(Home, systemImage: house.fill) } LibraryView() .tag(1) .tabItem { Label(Library, systemImage: books.vertical.fill) } QuestionView() .tag(2) .tabItem { Label(Answers, systemImage: text.bubble.fill) } SearchView() .tag(3) .tabItem { Label(Search, systemImage: magnifyingglass) } } .navigationTitle(navigationTitle) .tabViewStyle(.sidebarAdaptable) .refreshable {
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Hi everyone, I am encountering an issue where my Live Activity (Dynamic Island) suddenly became invalid and failed to launch. It was working perfectly before, and I haven't modified any code since then. My Environment: Xcode: 26.1.1 Device iOS: 26.1 Testing: I also tested on iOS 18, but the Live Activity fails to start there as well. Here is my code: Live Activity Manager (Start/Update/End): func startLiveActivity() { // Initial static data let attributes = SimpleIslandAttributes(name: Test Order) // Initial dynamic data let initialContentState = SimpleIslandState(message: Preparing...) // Adapting for iOS 16.2+ new API (Content) let activityContent = ActivityContent(state: initialContentState, staleDate: nil) do { let activity = try Activity.request( attributes: attributes, content: activityContent, pushType: nil // Set to nil as remote push updates are not needed ) print(Live Activity Started ID: (activity.id)) } catch { print(Failed to start: (error.localizedDescription)) } } // 2. Update Live Activity fun
This is still a thing. I have a UIToolbar with some buttons in it. They are are created in Interface Builder. One is hidden. At runtime, something happens and I set hidden = NO to show that one button that is hidden and nothing happens. I see UIToolbar is now a wrapper on top of SwiftUI on iOS 26 so while this is disappointing this type of bug isn't really shocking. @N. Holzschuch Thanks for sharing. Setting the items like it's iOS 15.0 does the trick. I tried just resetting the property with a copy of the .items array but it didn't work. Adding a dummy bar button item then removing it seems to be required.
Topic:
UI Frameworks
SubTopic:
General
Thanks for the reply! Just to clarify, even though the main app is built with Flutter, the Live Activity and widget extension are fully native Swift/SwiftUI and built in Xcode. The issue seems to be on the ActivityKit/WidgetKit side rather than the Flutter side. I’ve gone through Apple’s Live Activity tutorial and everything works except the actual UI rendering (Dynamic Island shows a black capsule even though the regions contain simple Text/Image views with no errors). I’m mainly hoping someone who’s run into a similar ActivityKit rendering issue can point out anything I may be missing in the widget extension setup. Any insights are appreciated!
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
It appears to be correctly signed. Automatically manage signing is checked, my standard team is set. With those settings, as soon as I assign an app group in Xcode 26.1, it changes to an Xcode managed provisioning profile and my valid Apple Development certificate and does not let me change them. I also checked the build with codesign -dv --verbose=4 and in ~/Library/Developer/Xcode/UserData/Provisioning Profiles to verify and that the profiles update, e.g., when I change the Info.plist. I also tried setting up a fresh sample project from the standard multiplatform SwiftUI app template in Xcode and did not change anything in Signing & Capabilities except setting the app group for the app and download extension. Same minimal app just calling AssetPackManager.shared.assetPack(withID:), same result: on iOS it works, on macOS the URL override is not permitted.
Topic:
Developer Tools & Services
SubTopic:
General
Tags:
Yeah, SwiftUI is the officially recommended UI framework for watchOS app development. This is mentioned in TN3157. I don't see any system-provided API that provides a view behaving like Photos. That's something you need to implement in your app. Regarding the best practices, folks who have something to say may weigh in, but I think the ask is quite broad. I guess you might go ahead to create a prototype, and follow up here if you see any specific issue along the path. Best, —— Ziqiao Chen Worldwide Developer Relations.
Topic:
UI Frameworks
SubTopic:
SwiftUI