Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
1 vote
1 answer
77 views

I'm building an iOS Widget (WidgetKit) with a 2×2 button grid using GeometryReader to calculate row heights. The buttons should fill their containers completely and have equal heights, like Apple's ...
LevelOne2k's user avatar
0 votes
3 answers
2k views

I'm trying to create a Next button (as a right chevron) in the toolbar that looks identical to the iOS 26 back button (with the left chevron) in the new Liquid Glass style. But all my solutions ...
Andy's user avatar
  • 125
0 votes
1 answer
85 views

I observed a weird behavior and I believe it's a bug in SwiftUI but maybe it's not or someone knows a way to fix it. By default, overlays have the same size as the view they are attached to in SwiftUI....
Mischa's user avatar
  • 17.5k
0 votes
0 answers
50 views

When checking a checkbox Button in List: Click/tap events don't trigger the expected response The associated action button only activates with a press+slide What could be causing this interaction ...
arterzz's user avatar
  • 31
1 vote
0 answers
142 views

I am writing an application and have a structure similar to the following: ScrollView { VStack { Button(action: { print("hello") }) { Text("...
user2826739's user avatar
1 vote
1 answer
132 views

I have an app with SampleData of country names displayed in a list with the searchable modifier. I also have button on the bottom right of the screen. This is all within the NavigationStack: ...
fbablu's user avatar
  • 13
0 votes
1 answer
359 views

I am learning SwiftUI and currently building a custom button. What I am trying to achieve is, when the button is disabled its opacity should be 0.5 but not the title. The title opacity should be 0.9 ...
thus's user avatar
  • 1,595
-1 votes
1 answer
81 views

Snapshot of Code and Preview in Xcode Attached is an image with the button and code for reference. Here's also the code in case you'd like to test this out yourself: struct ContentView: View { var ...
eiro's user avatar
  • 3
0 votes
2 answers
417 views

The button text does not change colors properly when switching between light and dark mode. In light mode it shows up as a black button with white text. in dark mode it just shows a white button with ...
dingomingo's user avatar
0 votes
2 answers
161 views

I'd like to make the. box surrounding my rounded button match the background but it's darkened. I would also like to eliminate the dark circle below the button, which looks like it must be generated ...
Phil Smith's user avatar
0 votes
1 answer
39 views

The following block works: Main File import SwiftUI struct Home: View { @State private var ToDoItems: [ToDoItem] = [ToDoItem(title: "Task", description: "Need to do", urgent: ...
Simon's user avatar
  • 1
2 votes
1 answer
120 views

The button is not tappable as I move it to the extended line of the title. If I move it to somewhere else, it works but I want to place it on the line of Title. But whenever I do it, it does not ...
YJ Kim's user avatar
  • 31
2 votes
0 answers
108 views

I'm attempting to recreate a button that simulates the behavior of a NavigationLink inside a List in SwiftUI. However, when tapping the button wrapped inside the List, the listRowBackground color ...
Maximillian's user avatar
0 votes
2 answers
149 views

I have the text "Groups" and I want to use NavigationLink to connect it to my GroupsPage subpage and take the user there when they click the Groups text. Edit: This is how it looks with the ...
AppleDev3's user avatar
1 vote
1 answer
181 views

My code is like this: List { Button(action: {}, label: { Text("Button") }) Button(action: {}, label: { Text("...
stul's user avatar
  • 82
1 vote
1 answer
769 views

I pieced together this code for a watch app and it kind of works but it's not perfect. (1) The fill does not match exactly, it starts outside the bounds of the buttons view but I can't figure out how ...
GarySabo's user avatar
  • 6,830
0 votes
0 answers
40 views

I want to navigate to ChatScreen() based on conditions, when click on right group, print statement is showing "group found" but its not navigating: List(viewModel.danceGroups) { group in ...
Deepanshu Kashyap's user avatar
0 votes
2 answers
116 views

enum ActiveSheet: Identifiable { case first, second var id: Int { return hashValue } } struct ContentView: View { @State var activeSheet: ActiveSheet? var body: some ...
Kunal's user avatar
  • 3
2 votes
1 answer
2k views

I have a SwiftUI app with a complex dashboard view consisting of several other nested custom SwiftUI views containing SwiftUI buttons. I want to prevent that these different buttons can be pressed ...
mahega's user avatar
  • 3,371
0 votes
1 answer
325 views

I have a quite simple case, a view displays another one when a button is pressed. The label on the second view is at the top of the view, which is working fine, unless I try to animate the button when ...
Eric's user avatar
  • 682
0 votes
0 answers
858 views

I use ButtonStyle, for button style. But when I updated button from enable to disable, and change thread, the button change without animation. //I have ButtonStyle: struct WizardButtonStyle: ...
Medoed's user avatar
  • 1
1 vote
1 answer
579 views

I am making log in button for log in page. I have this problem: outside (below, right or left) of the button area, button still gets clicked. How I fix this? I want this button to get clicked when I ...
User007's user avatar
  • 11
3 votes
2 answers
4k views

I am using a Form in SwiftUI based on a tutorial from YouTube, and I have placed some components inside it. However, when I tap the button, it doesn't show the tap animation (For example, when I tap a ...
NoobOfCpp's user avatar
0 votes
1 answer
812 views

I created a view showing a list of Button. These buttons are displaying a date. This view is instantiated in my HomeView. My need is that whenever the user taps one of the button, the date displayed ...
user avatar
3 votes
1 answer
5k views

I've seen people using AttributedString and .link to link to something, but I need it to run a function, not open a browser link. I want something like this in SwiftUI, with wrapping, etc. Terms of ...
Learning SwiftUI's user avatar
1 vote
2 answers
632 views

For some reason my background is showing over my text label. I have the background as white and text as red, but for some reason the white background covers the text. I am referring to the "Tap ...
Pastor J.G Seigle's user avatar
3 votes
4 answers
4k views

I've a simple button that work on simulator as expected, the shape changes with click; struct ButtonTest: View { @State var isLiked = true var body: some View { VStack { ...
kelalaka's user avatar
  • 5,706
-1 votes
1 answer
256 views

I can't dynamically add items to List. SwiftUI. import SwiftUI struct UpdateList : View { var updates = updateData @ObservedObject var store = UpdateStore(updates: updateData) **Update func ...
user avatar
1 vote
1 answer
526 views

My goal is to have the user click a button that then gives them a choice of yes or cancel, this works fine. Is yes is selected it should move to the Camera View. I am getting the error: Result of '...
Steve's user avatar
  • 1,171
0 votes
1 answer
670 views

I have five buttons in swiftUI, that are meant to increase or decrease a displayed score, based on the response to an alert with two options, triggered on button press. When pressing the button ...
Griffin-Reding's user avatar
0 votes
1 answer
146 views

I am trying to achieve a Scrollview with buttons that have rounded corners and a custom color. Button(shoppingListItem.text) { removeFromShoppingList(itemId: shoppingListItem.item_id) } .overlay( ...
AntonSack's user avatar
  • 1,047
2 votes
1 answer
2k views

I am new to SwiftUI and iOS. What I am trying to achieve is to add a buttonStyle to all the buttons inside my app, while keeping the function that each button calls when pressed. This is my code so ...
GeorgeHTS's user avatar
0 votes
0 answers
282 views

I am trying to design a button in swiftUI that will call 1 of the built in menu items (mac only). I know how to replace built in menu item & force it to share the same functionality with a button, ...
rbkopelman's user avatar
4 votes
2 answers
8k views

I want to make a custom DisclosureGroup that has the same functionality as the default DisclosureGroup but allows me to change the color text or even put an image instead of a string. Because ...
Anas Alhalabi's user avatar
2 votes
1 answer
161 views

I would like my favorites button to switch colors based on if the user favorites or unfavorites a character. I am able to change the text from "Favorite" to "Favorited" and change ...
Kevin's user avatar
  • 27
3 votes
0 answers
2k views

I have been looking around but couldn't find the solution so lets hope someone can help me. I have a ScrollView with a LazyVStack in it. Then I have a list of 'cells'. Simplified it looks something ...
Saren Inden's user avatar
  • 3,660
0 votes
1 answer
192 views

My code currently shows two buttons next to each other, one button being countries and the other being states. I want to make it so that once a button is pressed, a new set of buttons will appear. For ...
Swifty's user avatar
  • 45
0 votes
1 answer
358 views

If I have a string that I will place inside of a SwiftUI button label, how can I determine how much width I need to allow the button to consume such that the text in the button will not be truncated ...
pinglock's user avatar
  • 1,351
-2 votes
1 answer
567 views

Displaying a list from API. I want to show list based on date. There are three buttons in my view : Previous Day, Last Three Days, and a button providing calendar to chose dates.(Havent implemented ...
tintin's user avatar
  • 405
0 votes
1 answer
931 views

So I am making a simple restaurant bill splitting app and I have a button that I want to highlight when the user clicks on it. I also want the other buttons to be not highlighted. In UIKit it would be ...
Tomas's user avatar
  • 179
0 votes
0 answers
119 views

I tried to implement lock/unlock button, but it was hard to make. In my case, I used two Image. One is Rectangle with a lock, another is just a rectangle. And using ZStack, made them as a one button. /...
Tempnixk's user avatar
3 votes
2 answers
956 views

I am new to swiftui. I am making a login screen in which I have to use log in with apple and gmail buttons. I am using a custom view to design the button. Here is the code for that custom button view: ...
Taimoor Arif's user avatar
  • 1,230
0 votes
2 answers
1k views

func setupButtonUI() { if let detailsImage = UIImage(named: "detalji_icon") { setImage(detailsImage, for: .normal) contentHorizontalAlignment = .left contentVerticalAlignment = ....
Suncica's user avatar
  • 29
0 votes
1 answer
697 views

I am trying to create a situation in a SwiftUI Mac app where when I click a Button inside a parent view, only the Button's action is trigger—not any of the tap gestures attached to its parent. Here is ...
Clifton Labrum's user avatar
1 vote
1 answer
1k views

I have created a @StateObject from where a Login page is presented: @StateObject var loginViewModel = //LoginViewModel Name and There is a Button inside Vstack like this VStack{ Button(action : {...
Ae Ri's user avatar
  • 250
3 votes
1 answer
792 views

In SwiftUI you can set font tracking (spacing between letters) on a Text View using the tracking View modifier: Text("Hello, World!") .tracking(10) If you have a Button and apply your ...
shim's user avatar
  • 10.3k
0 votes
2 answers
2k views

I have a set of buttons to show for the user and I used CollectionView to align the buttons. Each button is a Vstack with an Image and Text components. The tap is reactive only on the image but not on ...
Dinakar's user avatar
  • 1,208
0 votes
1 answer
657 views

I am attempting the configure the text field and button in my openweathermap app to be in its own view other than the main content view. In TextFieldView, the action of the button is set up to call an ...
JS_is_awesome18's user avatar
1 vote
0 answers
185 views

Here is some SwiftUI code in a running app I am working on: Button(action: action) { Image(systemName: img) .imageScale(.large) } .simultaneousGesture(LongPressGesture()...
Michel's user avatar
  • 11.9k
2 votes
0 answers
274 views

How do I get the default highlighted color of a Button? For example, when I tap the button rendered by the code below, the row background color turns light gray, specifically red: 209, green: 209, and ...
ma11hew28's user avatar
  • 128k