Search results for

swiftui

16,582 results found

Post

Replies

Boosts

Views

Activity

RequestReviewAction never triggering rating dialog
Hello, We are having an issue with the RequestReview API and were hoping to get some help. We know that there is no guarantee that the in-app review modal will show and we know that there are 3 circumstances in which it will definitely not appear: if the user has turned off in-app review/ratings in their settings if the user has submitted a review for that app on that device within the last 365 days if the user has been asked for a review >3 times in the last 365 days When testing our implementation, every single one of our testers did not receive the rating modal despite the fact that we had all our testers turn on the app rating setting and that we have never asked for reviews from our app before. So that seems suspicious. While it is possible that something is up with our code (and I have provided some snippets below) we are also concerned that apple maybe is suppressing it for another reason. We really want to go live with our app review code but unfortunately we are not able to get confidence that it
2
0
96
Dec ’25
SwiftUI Logo
I see the logo all over the internet, but the only Official logo I can find is the swift logo, the orange one, but the blue one I do not see a place to download it nor the usage guidelines. I have seen it on various Icon site like Icon8. I would like to use it on my reddit forum that is dedicated to SwiftUI but I want to be legal. Is it allowed to use and if so, where can you download the official verison?
Topic: Design SubTopic: General Tags:
0
0
689
Nov ’25
Canvas fails with "Runtime Linking Failure" in Swift Package
I have a view inside a Swift Package that relies on an external Swift Package. My Preview Canvas breaks as soon as I use code from the external package: import ComplexModule // From swift-numerics import SwiftUI struct MyView: View { // Commenting out this line will make Previews work let number: Complex = 123 var body: some View { Text(Hello World) } } #Preview { MyView() } This is part of the error the preview emits: == PREVIEW UPDATE ERROR: GroupRecordingError Error encountered during update group #33 ================================== | [Remote] JITError: Runtime linking failure | | Additional Link Time Errors: | Symbols not found: [ _$sSd10RealModule0A0AAMc, _$s13ComplexModule0A0VMn, _$s13ComplexModule0A0V14integerLiteralACyxG07IntegerD4TypeQz_tcfC ] | | ================================== | | | [Remote] LLVMError | | | | LLVMError: LLVMError(description: Failed to materialize symbols: { (static-MyTarget, { __replacement_tag$1 }) }) Did anyone else see this before?
1
0
115
Nov ’25
In SwiftUI, how to animate from an arbitrary corner radius to the corner radius of the display?
I am trying to implement a common UX/UI pattern: one view with rounded corners transitioning to a view that fills the screen (N.B. having the display's corner radius). I got this to work if both corner radiuses are equal to that of the display (see first GIF). However, I cannot seem to get it to work for arbitrary corner radiuses of the smaller view (i.e., the one that does not fill the screen). I expected the be able to combine ContainerRelativeShape with .containerShape (see code), but this left me with a broken transition animation (see second GIF). import SwiftUI struct ContentView: View { @Namespace private var animation @State private var selectedIndex: Int? var body: some View { ZStack { if let selectedIndex = selectedIndex { ContainerRelativeShape() .fill(Color(uiColor: .systemGray3)) .matchedGeometryEffect(id: square-(selectedIndex), in: animation) .ignoresSafeArea() .onTapGesture { withAnimation() { self.selectedIndex = nil } } .zIndex(1) } ScrollView { VStack(spacing: 16) { ForEach(0..<
1
0
123
Nov ’25
Reply to SwiftUI – How to completely remove the horizontal “ghost lines” inside List with Section and custom rows?
Thank you! Your explanation about .listRowSeparator(.hidden) being row-specific (and not global to the entire List) was exactly what I needed. I was only applying: .listRowSeparator(.hidden) .listSectionSeparator(.hidden) to the List itself, assuming it would hide all separators automatically — but as you pointed out, SwiftUI requires the modifier to be applied on every row. What I did to fix it I added: .listRowSeparator(.hidden) directly to each transaction row inside my custom content view: ForEach(...) { ... } .listRowSeparator(.hidden) Then I also added it to: the header Section for each day the top block inside ReportMensileView (statistics + month picker + total + picker) This ensured that every row rendered by the List has the separator explicitly hidden. Result All the “mysterious horizontal lines” immediately disappeared, without breaking: native List scrolling swipe-to-delete custom rounded card backgrounds grouped Sections Everything now renders perfectly clean. Thanks again for pointing
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’25
SwiftUI – How to completely remove the horizontal “ghost lines” inside List with Section and custom rows?
Hi everyone, I’m working on a screen that uses a single SwiftUI List composed of: a top block (statistics, month picker, year selector, total, Entrata/Uscita picker). a list of transactions grouped by day, each group inside its own Section. each row is a fully custom card with rounded corners (RoundedCornerShape) I’m correctly removing all separators using: .listRowSeparator(.hidden) .listSectionSeparator(.hidden) .scrollContentBackground(.hidden) .listStyle(.plain) Each row is rendered like this: TransazioneSwipeRowView(...) .listRowInsets(EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16)) .listRowBackground(Color.clear) However, I still see thin horizontal lines appearing between: the search bar and the top block the top block and the start of the list between rows inside the grouped section sometimes at the bottom of a Section These lines are NOT: Divider() system separators backgrounds row borders They seem to be “ghost lines” automatically generated by SwiftUI’s List when multipl
3
0
151
Nov ’25
SwiftUI Canvas
Hi everyone, I think this is a simple issue. I got the following error message PreviewDevice is ignored in a #Preview macro. Use the device picker at the bottom of the Canvas to change which device type is used for the preview. (from macro 'Preview') after this line: .previewDevice(PreviewDevice(rawValue: iPhone 17 Pro)) But in my Canvas I do not see the device picker. Thank you.
9
0
331
Nov ’25
How can I show a movable webcam preview above all windows in macOS without activating the app
I'm building a macOS app using SwiftUI, and I want to create a draggable floating webcam preview window Right now, I have something like this: import SwiftUI import AVFoundation struct WebcamPreviewView: View { let captureSession: AVCaptureSession? var body: some View { ZStack { if let session = captureSession { CameraPreviewLayer(session: session) .clipShape(RoundedRectangle(cornerRadius: 50)) .overlay( RoundedRectangle(cornerRadius: 50) .strokeBorder(Color.white.opacity(0.2), lineWidth: 2) ) } else { VStack(spacing: 8) { Image(systemName: video.slash.fill) .font(.system(size: 40)) .foregroundColor(.white.opacity(0.6)) Text(No Camera) .font(.caption) .foregroundColor(.white.opacity(0.6)) } } } .shadow(color: .black.opacity(0.3), radius: 10, x: 0, y: 5) } } struct CameraPreviewLayer: NSViewRepresentable { let session: AVCaptureSession func makeNSView(context: Context) -> NSView { let view = NSView() view.wantsLayer = true let previewLayer = AVCaptureVideoPreviewLayer(session: session) pre
0
0
337
Nov ’25
Attributes inspector in Xcode 26
It has been two years since I wrote my a SwiftUI app, and I wanted to start again in Xcode 26. I can no longer see the attributes inspector when I select an element in the canvas. This was an Xcode feature that was very helpful as I am still a novice. Has this feature been deprecated in Xcode 26? And if not, please help explain how I can find and use it.
3
0
339
Nov ’25
WebPage and WebView and status bar
I am using WebView and WebPage to display web pages. Some web pages have content fixed to the top of the screen (like apple.com). When this happens, content is under the status bar (like menu buttons), and I cannot tap them. My work around is to put the WebView in a VStack with the top being Color.clear.frame(height: 44). It isn't very elegant, especially since it is applied to all pages and not just pages with fixed content at the top. Is there a more Apple-y way to solve this? For example, Safari seems to detect these situations and puts something like Color.clear.frame(height: 44) in those cases but not other cases. Here is sample code: import SwiftUI import WebKit struct ContentView: View { @State private var page: WebPage init() { let configuration = WebPage.Configuration() page = WebPage(configuration: configuration) let url = URL(string: https://www.apple.com)! let request = URLRequest(url: url) page.load(request) } var body: some View { WebView(page) } } Here is a screenshot of Apple's page i
0
0
132
Nov ’25
Swift UI Custom Keyboard
How can I correctly display the cursor using a custom keyboard in SwiftUI without using UIKit? Currently, I'm encountering a conflict between the custom keyboard and the system keyboard in SwiftUI, resulting in both keyboards being displayed simultaneously. If I disable the system keyboard and then handle the custom keyboard, the cursor disappears. How can I resolve this issue?it?
0
0
81
Nov ’25
How to add view below navigation bar to extend scroll edge effect
Hello! What UIKit API enables you to add a view below the navigation bar and extend the scroll edge effect below it in iOS 26? safeAreaBar is how you do it in SwiftUI but I need to achieve this design in my UIKit app (which has a collection view in a view controller in a navigation controller). struct ContentView: View { let segments = [First, Second, Third] @State private var selectedSegment = First var body: some View { NavigationStack { List(0..<50, id: .self) { i in Text(Row (i + 1)) } .safeAreaBar(edge: .top) { Picker(Segment, selection: $selectedSegment) { ForEach(segments, id: .self) { Text($0) } } .pickerStyle(.segmented) .padding(.horizontal) .padding(.bottom, 8) } .navigationTitle(Title) .navigationBarTitleDisplayMode(.inline) } } }
3
0
425
Nov ’25
SwiftUI: Menu icon will missing if increase preferred text size
iOS simulator version 18.0+ I have a demo like this: Menu { Button { } label: { Text(Option 1) Image(systemName: star) } Button { } label: { Text(Option 2) Image(systemName: star) } } label: { Text(Menu) } And I used the tool Accessibility Inspector to modify the text size. Case 1: We could see the option title and the star icon. Case 2: But we could not see the icon, only the option title here Is this by design from Apple? Or does this need to be fixed? Does anyone know about my question?
0
0
67
Nov ’25
Reply to WidgetKit with Data from CoreData
A solution is not to rely on a Data Manager class and its associates but to use UserDefaults so that Widget's getTimeline method will be called when ContentView submits data to it. By this approach, you can update Widget's View. import SwiftUI import WidgetKit struct ContentView: View { var body: some View { VStack { Button { let task0 = TaskItem(id: UUID(), name: Dish washing, isComplete: false, dueDate: Date.now.addingTimeInterval(86400)) let task1 = TaskItem(id: UUID(), name: Bed making, isComplete: false, dueDate: Date.now.addingTimeInterval(86400 * 2)) saveTasksToWidget(tasks: [task0, task1]) } label: { Image(systemName: globe) .imageScale(.large) } .tint(.pink) .buttonStyle(.borderedProminent) } .padding() } private func saveTasksToWidget(tasks: [TaskItem]) { guard let sharedDefaults = UserDefaults(suiteName: group.abc) else { print(Failed to get shared UserDefaults.) return } do { let encoder = JSONEncoder() let encodedData = try encoder.encode(tasks) sharedDefaults.set(encodedData, forKey: wi
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’25
.glasseffect with multiple date pickers
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?
1
0
112
Nov ’25