41,767 questions
1
vote
1
answer
178
views
Why is my iOS App not showing full Screen?
I am new to swift IOS development by making hello world I tried to summarize my problem. I am unable to make app in full screen need help.
I even added Launch Screen.
I am attaching screen shots. ...
-2
votes
0
answers
28
views
How to completely remove the horizontal “ghost lines” inside List with Section and custom rows?
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 ...
5
votes
2
answers
530
views
Resize cursors are missing in `NSCursor`
I'm writing a resizable view in SwiftUI on macOS. Drag its edge can change its size. I'd like to show according cursor when dragging different edges. So I looked up Apple NSCursor documentation, ...
0
votes
0
answers
21
views
How does NSItemProvider handle NSAttributedString?
let provider = NSItemProvider()
if model.type == .rich {
if let attr = NSAttributedString(
with: model.data,
type: model.pasteboardType
...
0
votes
0
answers
47
views
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 ...
1
vote
0
answers
49
views
iOS 26.1: In TabView, NavigationStack animation breaks when intercepting tab selection to show fullScreenCover
I'm trying to show a fullScreenCover when the user taps the third tab instead of actually switching to that tab. The issue is that resetting selectedTab = oldValue in onChange breaks the ...
8
votes
3
answers
3k
views
How to add separators between the elements in a Picker?
I'm trying to create a SwiftUI Picker in MacOS that looks like the ones in Xcode or other Mac Apps. To be more specific, I'm trying to add that separator line between the elements in the picker.
Like ...
1
vote
0
answers
55
views
Using @Environment inside a ViewModifier causes a deep SwiftUI crash — is my theme setup fundamentally wrong?
I use a custom AppTheme type and inject it via a custom EnvironmentKey. Views can access the theme using @Environment(\.appTheme) or override it explicitly.
While this work fine in most cases it ...
0
votes
1
answer
71
views
Custom bottom sheet shows brief flicker/fade of underlying view when expanding/collapsing (iOS 15)
I’m building a reusable custom bottom sheet component in SwiftUI because my app supports iOS 15, so I can’t use .sheet with detents yet. Functionally everything works the sheet opens and closes but I’...
1
vote
1
answer
106
views
List view bottom edges not being clipped ios 26
before updating to iOS 26 my list was looking fine but now it has abnormal paddings and because I am using fixed height, I had to increase the height from 40 to 60 to fit the text.
There are currently ...
3
votes
2
answers
64
views
Using .presentationBackground(_: Style), but default sheet background is still visible
I wanted to try out the new .presentationBackground modifier from iOS 16.4+ for a clear background in a Sheet. Stack Overflow posts like this suggest it's possible.
But the presentationBackground just ...
1
vote
1
answer
50
views
Vertical paging using TabView breaks layout in SwiftUI
I'm working on vertical paging, using TabView. I put player code in TabView and rotate it to show vertical paging, but UI breaks.
Vertical Pager
struct EpisodeVerticalPager: View {
let episodes: ...
1
vote
1
answer
49
views
.alert inside .fullScreenCover is immediately dismissed when used inside specific view hierachy
I have created a reusable ModalDialog view that presents modal content via .fullScreenCover. Inside this dialog, a button triggers a SwiftUI .alert.
This works fine in many situations. However, in a ...
Advice
0
votes
2
replies
43
views
CloudKit data initial share sheet in Swift UI and iOS 26
Let's use a basic todo app as an example - sharing a todo list. I have a share button (square with up arrow) that when the user taps I want the initial share sheet to appear. If I have to create and ...
3
votes
4
answers
4k
views
Clipping a resized image using aspectRatio scaling SwiftUI
At the end of the day, I'm trying to scale to fill an image into a height of X (439px in my case) and then clip it using a RoundedRectangle.
post.picture
.resizable()
.aspectRatio(contentMode: ...
1
vote
2
answers
2k
views
How to draw circle stroke with rounded border
I would like to draw a circle in SwiftUI where its border has subtle rounded corners. I think the picture is worth more than a 1000 words in this case.
So far I'm able to draw circles with "...
1
vote
1
answer
62
views
Custom strokeStyle lineCap with corner radius [duplicate]
I want to be able to give these ends a corner radius of 5 instead of sharp square ends.
lineCap only supports .round, .butt and .square
How can I create a custom corner radius for the lineCap?
Here is ...
1
vote
2
answers
1k
views
In Swift how to resolve warning about main actor-isolated conformance cannot be used in nonisolated context?
I have the code below which I'm using in a SwiftUI view. When I compile this in Xcode 26.0.1 with iOS 26 I get this warning on the line that calls decode:
Main actor-isolated conformance of 'Post' to ...
0
votes
0
answers
47
views
UIKitViewController in Compose Multiplatform loses state on device rotation
I am building a Kotlin Multiplatform app where I want to use shared UI with Compose for both Android and iOS. However, I need some native views with their own state for certain parts of the app, so I’...
0
votes
2
answers
95
views
How to create an image carousel that auto-sizes based on it's content?
I’m trying to build an image carousel similar to the one in the App Store, but I'm a facing a lay-out issue.
The carousel should:
Automatically adjust its height based on its content
Automatically ...
2
votes
1
answer
322
views
Adopting both NavigationSplitView and TabView depending on Window/Screen Width [closed]
I’m building a Files-style SwiftUI app and my primary goal is to adopt both:
NavigationSplitView on wider (regular) widths (iPad/macOS), and
TabView + NavigationStack on narrow (compact) widths (...
1
vote
1
answer
37
views
Realm Database Operations Causing UI Hangs and Scroll Lag During Extensive Read/Write (iOS 16, SwiftUI)
I have severe UI hang issues whenever my sync worker is running. The app experiences:
Screen navigation freezes
Scroll lag and stuttering
Unresponsive UI during data synchronization
The root cause is ...
2
votes
1
answer
67
views
Remote notification tap not handled when app is killed
I’m running into an issue with remote push notifications on iOS.
When the app is in background or inactive, tapping a notification correctly triggers:
userNotificationCenter(_:didReceive:...
3
votes
2
answers
9k
views
How to size a view relative to its parent when the parent is inside a scrollview?
I'm trying to dynamically size some views which end up being placed inside of a scrollview. Here is the simplest sample code I can think of:
struct RootView: View {
var body: some View {
...
14
votes
5
answers
23k
views
How to change the NavigationView.toolbar's background color?
Any idea on how to apply a specific background color to the bottom toolbar?
NavigationView {
List {
....
}
.toolbar {
ToolbarItem(placement: .bottomBar) {
...
0
votes
0
answers
299
views
How to disable effect Liquid Glass on Tabview?
I can’t remove the Liquid Glass / translucent blur background from the TabView (iOS 15+).
I want the tab bar to be fully transparent so my custom background image shows through.
Instead, the tab bar ...
1
vote
1
answer
74
views
How to present the new Game Center dashboard from within a SwiftUI app
I’m integrating achievements and leaderboards into my SwiftUI app and would like to present the Game Center dashboard directly from within SwiftUI. However, it seems the only supported way to show the ...
-3
votes
0
answers
46
views
White capsule behind Button [duplicate]
Upgraded to iOS 26.1 and now getting a white capsule behind my StyleSheet buttons:
The View code is:
ToolbarItem(placement: .topBarLeading) {
Button {
...
25
votes
4
answers
9k
views
Is there any way to create/extract an array of Views using @ViewBuilder in SwiftUI
I'm trying to create a simple struct that accepts an array of Views and returns an ordinary VStack containing those Views except they all are stacked diagonally.
Code:
struct LeaningTower<Content: ...
8
votes
5
answers
5k
views
How to present accurate star rating using SwiftUI?
I need to present accurate star rating like 3.1, 4.8 using SwiftUI.
The desired result should be like this:
2
votes
3
answers
2k
views
Changing the color of the starting screen
I am developing a SwiftUI app that uses its own color scheme and does not use the .light or .dark schemes.
Every time it launches, a white screen shows for one second or two, while the app loads, ...
Advice
1
vote
2
replies
32
views
SwiftUI onDelete() modifier
I’m trying to learn iOS swift UI development working through some of the Apple tutorials I came across this piece of code. I don’t understand how the onDelete modifier works. This may be more of a ...
Advice
0
votes
1
replies
58
views
How can I achieve the same search behaviour as in iOS 26 Wallet app?
So in iOS 26, the search field changed a bit where it can be at the bottom. While other apps have the search in the nav bar, wallet has it in the toolbar, so when it's pressed it changes to a ...
1
vote
2
answers
61
views
Increase height AND tappable area of TextField?
I'm having a difficult time trying to figure out how to increase both the height AND the tappable area of a TextField.
I've tried these three solutions, and none have worked for me. I still can't tap ...
2
votes
1
answer
91
views
Incorrect display of the TabBar when selecting a tab with scroll view inside
I'm trying to implement a tab bar on iOS 26 like the Music or Health apps on iPhone.
On a white background this is not noticeable, but when changing the background color to dark at the start of the ...
-1
votes
1
answer
70
views
How to reduce top padding of NavigationBar to match native Apple apps? [closed]
When I use navigationTitle in SwiftUI, the top padding becomes too large. However, in Apple’s own apps the top area is noticeably smaller and more compact. How can I achieve the same native look with ...
0
votes
1
answer
53
views
Floating button that shows on top of sheets?
I have the following code which shows a blue background and a persistent sheet that always shows.
In the top left, I want to add a back button that floats above BOTH the blue background and sheet, and ...
1
vote
1
answer
58
views
Coloring the SwiftUI Toggle in macOS26 no longer works
on macOS26 / 26.1 Tahoe the Toggle stopped being colored / tinted by using modifier
.tint(toggleColor())
it just remains with the current system color... e.g. blue or the tint central to the whole ...
0
votes
0
answers
66
views
Strange background flicker when using .glassEffect in a horizontal ScrollView
I am trying to apply .glassEffect to some controls that are in a horizontal scroll view in a bottom .safeAreaBar.
No matter what I try, there is a persistent pesky flickering of the background that I ...
1
vote
1
answer
226
views
Any one gotten SwiftUI SignInWithAppleButton to work on tvOS
I am trying to use the SignInWithAppleButton for SwiftUI to work with tvOS? I am getting an issue where the request and completion blocks are not being called and there is no error in any log that I ...
1
vote
1
answer
125
views
Compilation Error with ToolbarContent Extension
I created an extension on ToolbarContent in order to simplify code when using new SDKs technologies.
public extension ToolbarContent {
@available(iOS 17, macOS 13, *)
@ToolbarContentBuilder
...
1
vote
1
answer
56
views
How to create a SwiftUI Menu with multiple Pickers without extra dividers?
I'm trying to create a SwiftUI Menu containing two Picker to control content and sort. However, I cannot replicate menu appearance shown in my reference screenshot.
No matter which approach I try, I ...
83
votes
7
answers
80k
views
How to access safe area size in SwiftUI?
I want to manually set the frame height of a view in SwiftUI to the size of the safe area of the screen. It's easy to get the bounds of the screen (UIScreen.main.bounds), but I can't find a way to ...
1
vote
1
answer
82
views
How to dynamically update an existing AVComposition when users add a new custom video clip?
I’m building a macOS video editor that uses AVComposition and AVVideoComposition.
Initially, my renderer creates a composition with some default video/audio tracks:
@Published var composition: ...
54
votes
20
answers
40k
views
Show/Hide Password - How can I add this feature? [closed]
I've looked through the forums but I'm seeing mixed answers especially ones from an old Xcode version.
I only decided to add this after already typing up the code I have in this:
How could I go about ...
-3
votes
1
answer
50
views
Text Layout Inconsistency with maxHeight and fixedSize
I'm experiencing inconsistent layout behavior with SwiftUI Text when using maxHeight constraints combined with fixedSize().
I have a long text string that behaves differently depending on the ...
2
votes
1
answer
81
views
SwiftData update causes render with initial data overwriting changes
I'm working on a SwiftUI app using SwiftData, and I'm very new to both frameworks, and swift in general to be honest. I'm trying to create a webview that embeds a monaco editor that will then send the ...
0
votes
1
answer
81
views
Segmented control has design bugs in Navigation Bar with Liquid Glass
When I put a SwifUI segmented control in a navigation bar, liquid glass seems to be making it render incorrectly. The capsule has vertical clipping and the sides show layered backgrounds.
Here is my ...
2
votes
1
answer
59
views
How to use NavigationStack with path and multiple enum type destinations in SwiftUI
I want to use NavigationStack with a custom navigation path array supporting multiple destination types. For example:
enum A: Hashable { ... }
enum B: Hashable { ... }
NavigationStack(path: $...
1
vote
3
answers
2k
views
Update iOS Google Maps mapStyle on environment colorScheme change (dark mode)
When changing device settings between light mode and dark mode my Google Maps mapStyle is not updating. The other views successfully toggle to the selected mode, it's just the map that doesn't change.
...