Skip to main content
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
1 answer
87 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
1 vote
0 answers
143 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
0 votes
1 answer
360 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
0 votes
2 answers
418 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
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
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
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
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
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
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
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
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
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 vote
1 answer
527 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
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
0 votes
0 answers
285 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
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
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
-2 votes
1 answer
568 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
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
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
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
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
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