Search results for

swiftui

16,583 results found

Post

Replies

Boosts

Views

Activity

Request Review alert is unresponsive in iOS 26.1
Try this simple code: import SwiftUI import StoreKit struct ReviewView: View { @Environment(.requestReview) var requestReview var body: some View { Button(Leave a review) { requestReview() } } } When the Review Alert shows, the Not Now button is disabled for some reason!? It was always tappable in all iOS versions that I remember. And there is no way to opt out, unless the user taps on the stars first. Is it a bug or a feature? Thanks for looking into it!
5
0
934
Nov ’25
NavigationStack Back Button obscured in MacOS
A MacOS SwiftUI app using WindowGroup with a NavigationStack results in having the navigation title overlay the back button. Note that this does not occur if a tabbed interface is used. The work around is simply to hide the navigation bar back button and add a tool bar item that is custom back button. I found a fix on this forum, and it was similar to: #if os(macOS) .navigationBarBackButtonHidden(true) .toolbar { ToolbarItem(placement: .navigation) { Button(action: { dismiss() }) { Label(Back, systemImage: arrow.left.circle) } } } #endif modifying the NavigationLink targets and where the dismiss() function was provided by: @Environment(.dismiss) private var dismiss Is there any means to sign up for a notification to inform me that this bug has been fixed?
Topic: UI Frameworks SubTopic: SwiftUI
2
0
136
Nov ’25
CoreNFC: NFCTagReaderSession fails with “Session invalidated unexpectedly” (after enabling NFC Scan, paid team, and custom dev profile)
Device: iPhone [model], iOS 18.6.2 Xcode: 16.0.x Team: Individual paid Apple Developer Program (not Personal Team), shows as my full name in Xcode I’m trying to use CoreNFC via NFCTagReaderSession in a small SwiftUI app (part of a larger project). So far I’ve done: • Enrolled in the Apple Developer Program (individual). • Confirmed that in Certificates, Identifiers & Profiles → Identifiers, my App ID for com.<…> has Near Field Communication Tag Reading enabled. • Created an iOS App Development provisioning profile for that App ID, including: • my Apple Development certificate • my iPhone device • Downloaded the profile, double-clicked it, and set it in Xcode under Signing & Capabilities with: • Team = my full-name team • “Automatically manage signing” off, using the custom profile. • Added the NFC Scan capability in Signing & Capabilities. • Added Privacy - NFC Scan Usage Description (NFCReaderUsageDescription) in Info.plist with a non-empty string. The app builds and runs on device
1
0
200
Nov ’25
Need Step-by-Step Instructions for Submitting React Native/Expo App to TestFlight & App Store (Individual Account)
Hello - I’m the Account Holder for an individual Apple Developer Program account. I’m working with freelance junior developers who are building my app in React Native mainly in TypeScript (.tsx) with some JavaScript, with code in GitHub. The app currently runs in Expo Go now. I’ve been directed to this forum for step-by-step guidance. Specifically I need clear, sequential instructions I can give my developers (and what I personally must do on my Mac) so they can produce a properly signed iOS build for TestFlight (internal testing), and Upload that build to App Store Connect and then submit the release to the App Store. Context: This is an individual developer account (not an organization). I am the only person with a Mac. I added them as developers but was told I need to be the one to upload the final build (is this true, and if so, what do they send me to do that, and when they send it to me, can you please tell me exactly what I need to do from there?) I was told about Swift Playground, possible SwiftUI
1
0
67
Nov ’25
NSButton + TtGC6AppKit18_NSCoreHostingViewVS_12AppKitButton - Image Alignment Changed/Broken in Minor macOS 26.1 Update
I just updated to macOS 26.1. I have a pure AppKit app (I guess that's not possible anymore but as close to a pure AppKit app as you can get). I use NSButton with the glass bezel style and SF symbol images. It looks like the minor OS update brought layout changes because now some of these buttons are scaling the symbol image much larger than was being done on macOS 26. The image can sometimes draw outside the glass 'bezel'. It looks like using the 'info' symbol in a button results in much larger image scaling than it did on the previous Tahoe for some SF Symbols. With the glass bezel style and a SF Symbol image how am I supposed to consistently make the button look good? With certain symbols I have to use imageScaling NSImageScaleProportionallyUpOrDown and on others I have to use NSImageScaleProportionallyDown. If I'm using a system image shouldn't it just do the right thing? Is trial and error the only way to tell? That's what I was doing before but it seems that the minor 26.1 update changed things. Additio
1
0
84
Nov ’25
Swift version wrong in Xcode 26.2 beta
Release notes of Xcode 26.2 https://developer.apple.com/documentation/xcode-release-notes/xcode-26_2-release-notes state that Swift 6.2.3 is shipped with it. But when trying to check the Swift version with #if swift(>= 6.2.3) it returns false. Running swiftc -version returns swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.3.3.2 clang-1700.6.3.2) As you can see, there is a mismatch between the marketing version 6.2 and the build version 6.2.3.3.2. Being able to check for the 6.2.3 version is important for my team, because we are impatiently awaiting the change to the tabviewbottomaccessory modifier https://developer.apple.com/documentation/swiftui/view/tabviewbottomaccessory%28isenabled:content:%29 so that it can be hidden when not needed. Without this fix we have the issue that the accessory shows even without content in iOS 26.1.
0
0
108
Nov ’25
Modal presentation of SwiftUI view with TextField leads to frozen UI, missing keyboard and memory leak
Hello, I’m trying to present my custom SwiftUI dialog with text field in UIKit with modalPresentationStyle = .overFullScreen, but it leads to the UI being completely frozen once I select the TextField and memory constantly leaking. The minimal reproducible code is: class ModalBugViewController: UIViewController { var hostingController: UIHostingController! struct Content: View { @State private var text = var body: some View { ZStack { Color.black.opacity(0.5).ignoresSafeArea() VStack { TextField(Test, text: $text) .textFieldStyle(.roundedBorder) .padding() } } } } override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .clear hostingController = UIHostingController(rootView: Content()) addChild(hostingController) view.addSubview(hostingController.view) hostingController.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ hostingController.view.topAnchor.constraint(equalTo: view.topAnchor), hostingController.view.bottomAnchor.constraint(equalTo: view.
1
0
124
Nov ’25
SwiftUI navigationTransition Regression on iOS 26 (Source View Disappears + Flicker/Misaligned Geometry)
Summary I’m experiencing two issues with SwiftUI’s navigationTransition(.zoom) on iOS 26.0 and 26.1 that break previously smooth transitions. These issues appear both on real devices and Simulator. The same code works correctly on iOS 18. Issue 1 - Source View Disappears After Drag-Dismiss When using .navigationTransition(.zoom(sourceID:..., in:...)), the source view disappears completely after the transition finishes. This only happens when the detail view is dismissed via drag (interactive dismiss). When the view is dismissed by tapping the back button, the source view remains visible as expected. Reproduced on: iOS 26.0, iOS 26.0.1 (17A400), iOS 26.1 (Simulator + physical device) Issue 2 — Flickering and Geometry Mismatch During Transition Compared to iOS 18 behavior, the outgoing view and incoming view no longer share consistent geometry. Current behavior on iOS 26: The disappearing view flickers during the drag-dismiss interaction. The source and destination views no longer align geometrically.
Topic: UI Frameworks SubTopic: SwiftUI
1
0
172
Nov ’25
Reply to In the process of using xcode, I encountered a problem and urgently needed help.
What most likely has happened is Apple made changes to the user interface in Xcode 26 and the tutorial you are following has not been updated for Xcode 26. You can file a request for Apple to update the tutorial. In Xcode choose Help > Provide Feedback to send the request. I have not gone through the tutorial so I can't tell you how to go through the tutorial in Xcode 26. I recommend taking the 100 Days of SwiftUI at Hacking with Swift. https://www.hackingwithswift.com/100/swiftui This course is geared towards beginners. Hacking with Swift also has a dedicated forum for the course (https://www.hackingwithswift.com/forums/100-days-of-swiftui) to ask questions when you run into problems with the course. The forums at Hacking with Swift are more beginner-friendly than Apple's forums.
Nov ’25
PhotosPickerItem.itemIdentifier always nil
I'm using the SwiftUI Photos Picker to select videos from the users Photos library and then opening the video using the PhotosPickerItem. I'm looking for a way to allow the user to open the same video on their other devices as the app uses SwiftData and CloudKit to provide access to a recently watched list of videos. The URL from the PhotosPickerItem appears to be device specific and so I was looking to see if I can use the itemIdentifier and then the init that takes the itemIdentifier to create the PhotosPickerItem on the other devices. The itemIdentifier however is always nil and so wouldn't be able to be used in this way. Is there an alternative approach whereby the users can open a video using a PhotosPickerItem and that item would be viewable on their other devices with an item identifier or a URL that is device agnostic. This approach should also not involve copying the video into other storage as it would simply expand the use of the users iCloud storage, providing a less than ideal user exper
1
0
283
Nov ’25
Reply to Correctly initializing observable classes in modern SwiftUI
If you’re performing any significant work on your state’s default value or instantiating Observable objects, we recommend handling that differently for optimal performance. For example: struct MyView: View { @State private var object = MyObject() var body: some View { ContentView(object) } } That's not the best for performance, because MyObject will be instantiated eagerly every time MyView is initialized, which is expensive since it allocates a new object, Instead defer the creation of the object using callbacks like, ,task, .onAppear or .onChange(of:). For example: struct MyView: View { @State private var object: MyObject? var body: some View { ContentView(object) .task { object = MyObject() } } } If the model needs to be part and owned by the view, then use @State. If the model needs to be global to your appliction use @Environment. Please review WWDC23 Session: Discover Observation in SwiftUI and Managing model data in your app
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’25
refreshable modifier causes misaligned button tap targets in ScrollView
I have a ScrollView with several Buttons and a .refreshable modifier. As soon as I pull to refresh and the refresh indicator appears, the tap targets no longer match the visible button positions. For example, tapping button A triggers button B’s action, as if the hit-testing region didn’t move along with the content. This only happens while the refresh indicator is shown. Before pulling to refresh, everything is correct and afterwards as well. Tested on iOS 18 and 26 (Xcode 16.4, Xcode 26). Here is a minimal reproducible example: import SwiftUI struct ContentView: View { var body: some View { ScrollView { VStack { Button(Button A) { print(A) } .buttonStyle(.borderedProminent) Button(Button B) { print(B) } .buttonStyle(.borderedProminent) Button(Button C) { print(C) } .buttonStyle(.borderedProminent) Button(Button D) { print(D) } .buttonStyle(.borderedProminent) Button(Button E) { print(E) } .buttonStyle(.borderedProminent) } .frame(maxWidth: .infinity) } .refreshable { try? await Task.sleep(for: .sec
2
0
96
Nov ’25
In the process of using xcode, I encountered a problem and urgently needed help.
In the Swift UI tutorial on the official website of apple developers, https://developer.apple.com/tutorials/swiftui/creating-and-combining-views, Step 2 in Section 2, through Command-Control-click, the full menu in Figure 1 cannot appear, but the style of Figure 2 appears, and the Show SwiftUI Inspector option is missing, see Figure 2. Similarly, in Step 6 of Section 2, Control-clicking on the Text declaration in the code editor, the options in the red box in Figure 3 cannot appear, and It is the style of Figure 4, and all the options in the red box of Figure 3 are missing. There is no one in Show Coding Tooks. I am using Macbook air 2020 M1, macOS is the latest Tahoe 26.1, and the xcode version is 26.1. The project files used in the learning tutorial are downloaded directly from the above link. Thank you very much for your help to a beginner, which is very urgent for me. I look forward to your reply and sincerely thank you again.
1
0
120
Nov ’25
Reply to Module dependency cycle errors in Xcode 26
I'm having a real tough time replicating the error in some brand new packages (even though they seem essentially the same) but I have been able to isolate the issue in my two custom packages to where I can sort of see when the error exists. I have a package A that has a dependency on package B (which has two products). If I include a single Swift file in both packages with no source code it works but if I just add a single import SwiftUI statement to both package A and package B's singular file the error presents itself. I see the following note also attached in the build error: note: Swift Overlay dependency of 'SwiftUI' on 'UIKit' via Clang module dependency: 'SwiftUI.swiftmodule -> SwiftUI.pcm -> UIKit.pcm' (in target '' from project '')
Nov ’25
Drawing a PaperMarkup synchronously
The PaperMarkup class in PaperKit allows for an asynchronous function called .draw(in:, frame:) that we should call as: await paperMarkup.draw(in: context.cgContext, frame: rect) In PencilKit the PKDrawing that we can get from a PKCanvasView allows for .image(from: ,scale:) to be called synchronously. This allows me to easily render into a PKDrawing as a UIImage or a SwiftUI Image to, for example, render a thumbnail on screen. When trying to incorporate PaperKit in my project I noticed that I often need the drawing to be rendered synchronously (like I would with PKDrawing) but I can't find the way to accomplish this within PaperKit's current functionality. Is there any way to call .draw(...) in PaperKit synchronously? Feedback: FB20993683
2
0
104
Nov ’25