Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
44 views

In macOS Sonoma, my SwiftUI code performs smooth, expected animations when List contents change — both when using @FetchRequest with a changing predicate and when filtering manually via Picker ...
user10711707's user avatar
2 votes
1 answer
163 views

I'm curious, have you noticed how Pickers have different internal padding when in a Form vs not? Of course, there are many controls that have special looks within the context of a Form. But I would ...
Curious Jorge's user avatar
3 votes
1 answer
108 views

My app uses the SwiftUI Picker, and I'd like to test that it only contains the expected choices. When I try to extract the choices in XCTest, I get back an extra entry, Choose an option, Option 1, i.e....
Pabtuz's user avatar
  • 43
0 votes
1 answer
96 views

I am trying to display the picker and the selected emoji on the screen. Here is the ContentView: struct ContentView : View { @StateObject private var viewModel = ContentViewModel() @State ...
Kelsey Zhou's user avatar
0 votes
0 answers
270 views

I am working on a small todo app project with SwiftUI/Swift in Xcode 15.4. I have a model like this: @Model class Category { var catTitle: String = "" var catEmoji: String = "" ...
helloimbrando's user avatar
0 votes
1 answer
503 views

I am fairly new to SwiftUI and trying to figure out how to achieve trailing alignment for the Picker view selection. Eg for UIKit, in a normal UITableView cell, you can have a Right Detail cell with a ...
Abhinav Singh's user avatar
0 votes
1 answer
71 views

I'm interested in creating menu similar to one displayed in the screenshot below. This menu is accessible via Rules settings of Mail.app. I'm interested in colouring the symbol on the left hand side. ...
Konrad's user avatar
  • 18.8k
0 votes
0 answers
135 views

I use a custom font throughout my app (font is correctly setup). I'd like the SwiftUI Picker appearance to use the same custom font. Here's a simpler sample code where the text should be in bold but ...
invalidArgument's user avatar
0 votes
2 answers
127 views

I can't for the life of me figure out why my first picker is not changing. It is stuck displaying "Option A" always no matter what I pick. The other pickers work just fine. struct ...
j3Googs's user avatar
0 votes
1 answer
394 views

How can I adjust the width of the list displayed when the user taps a picker? Note that I don't need to adjust width of the picker itself - only what is displayed over it. For example, consider a ...
Edward Brey's user avatar
  • 42.1k
1 vote
2 answers
111 views

I’m trying to build an extension on a SwiftUI Picker, but I’m getting the following error inside the content closure when trying to compile: Cannot convert return expression of type 'ForEach<Data, ...
ospr's user avatar
  • 1,681
0 votes
1 answer
163 views

What I'm Looking For I'm hoping someone can help me understand what's going on and why SwiftUI is behaving the way it is in this scenario. What I was trying to do I was originally trying to create a ...
MarlonJames's user avatar
1 vote
1 answer
2k views

I am finding to create picker menu with self contain search bar view and once user enter any character as per result of search filter picker menu will automatically reloads in SwiftUI. Below is the ...
Bhimashankar's user avatar
1 vote
1 answer
615 views

struct PlainTextPicker<T: Hashable>: View { @Binding var selection: T? let defaultString: String? var options: [T] var toLabel: (T) -> String // body Menu { ...
SeongHyeon LIm's user avatar
0 votes
1 answer
2k views

I have been brainstorming ideas for implementing a button dropdown view similar to what you see in a default Picker. I have been experimenting with this in general to find a way to overlay a view on ...
Matt Braniff's user avatar
2 votes
0 answers
173 views

The following WatchOs App example is very short, but already not functioning as it is expected, when using Digital Crown (full code): import SwiftUI struct ContentView: View { let array = [&...
Duckjd's user avatar
  • 87
0 votes
1 answer
211 views

I created a simple Picker like so: struct ContentView: View { private let options = ["Action", "Comedy", "Drama", "Horror", "Zombie"] @State ...
batman's user avatar
  • 2,501
0 votes
0 answers
162 views

I have a Picker that's just listing a bunch of strings, but when I switch from a longer string to a shorter string, it does this weird animation because it's confining the long string to the size of ...
Alec Coyner's user avatar
0 votes
2 answers
117 views

Running into an issue using a Picker against an enum. Trying to create a workout app, where each Day (type, 7) of the ExercisePlan needs assigned to a DayType (enum). Then I'd build out the ability to ...
Nick Molargik's user avatar
0 votes
1 answer
219 views

I have a picker (segmented). I need onTap and onChange both on it. onTap works but onChange doesn't work. If I remove tap, just the onChange code works. I need both because I am prefilling question....
user3748400's user avatar
0 votes
2 answers
3k views

I want to display the selection when using a picker in menu like in the reminders app for Sort By and I cannot for the life of me figure out how to do it. This is what I want: https://i.sstatic.net/...
Alec Coyner's user avatar
0 votes
1 answer
579 views

Why can't I select items from this picker view? The difference here is my selection array consist two different Structs('CustomOptionOne' and 'CustomOptionTwo') that conforms to the same protocol '...
Prasad De Zoysa's user avatar
0 votes
1 answer
1k views

I need to make an input field in which I use standard SwiftUI Picker. Here is my view: struct CustomPickerRowView<Content:View>: View { let icon: String let picker: () -> ...
Kaloyan Stefanov's user avatar
0 votes
1 answer
380 views

this is my main file getting error in picker not able to select the value from picker getting error in first picker import SwiftUI struct MainView: View { @ObservedObject private var ...
Smit Patel's user avatar
3 votes
1 answer
1k views

Using SwiftUI how can I customize the checkmark icon of the selected flavor in this simple Picker? struct ContentView: View { var flavors = ["orange", "strawberry", "lemon&...
subsp4ce's user avatar
1 vote
1 answer
130 views

I have two structures. One of these structures Idea has a field that stores an instance of the other structure Option. In turn, Option has a list of IDs of Idea structures associated with it. I ...
Boris Ryabov's user avatar
0 votes
1 answer
1k views

I am aware there are other questions about this, but none of them answer the question. There are two slightly different cases that are resulting in the same behaviour: using an enum for the Picker ...
Qwertytops's user avatar
1 vote
1 answer
1k views

In my app, i am trying to display: SegmentedPicker on top of the screen, Then List, Then a simple button on bottom-right of the screen using safeAreaInset, and then a tabBar using TabView My problem ...
Bhanuteja's user avatar
  • 801
0 votes
1 answer
1k views

I have a SwiftUI inline picker in a list. It works fine however when I enclose it in a section, an empty row appears on top of each section with an inline picker. Is there anyway to remove this ...
alionthego's user avatar
0 votes
0 answers
510 views

I'm currently trying to achieve a horizontal picker view where the user can select its avatar shirt. The rotation and adjustments of the picker works fine but my selected picker view cell size does ...
uncleX's user avatar
  • 11
-2 votes
1 answer
360 views

This is my code: import SwiftUI struct VPickerView<T: Hashable>: View { private let elements: [T] private let selection: Binding<T> init(elements: [T], selection: Binding&...
Bartłomiej Semańczyk's user avatar
0 votes
0 answers
189 views

Given this Struct who conforms to Relationable protocol struct RomanticRelation: Relationable{ typealias Relationship = RomanticRelationType typealias Relation = RomanticRelation var ...
David.C's user avatar
  • 454
3 votes
1 answer
360 views

As you can see in the attached image, the picker options are not aligned automatically to the right-hand side for RTL languages, and also flipped. The picker is nothing fancy either, the standard way....
CrisAhmad's user avatar
2 votes
1 answer
251 views

I post the minimum code to reproduce the behavior. Tested on latest macOS and Xcode. The picker in this example is just a wrapper for the default picker and conforms to Equatable (this is a must to ...
Affinity's user avatar
0 votes
0 answers
87 views

Here I'm trying to create the first little app that helps to convert a value from one unit of measurement to another. The first conversion picker helps me to select data for the second picker(from ...
Anstasia Kotova's user avatar
1 vote
1 answer
344 views

I'm building a WatchOS-app (SwiftUI) with multiple pickers, but as soon as I add them to a ScrollView I can no longer simply tap a picker to select it. When I tap a picker the first picker on the ...
kattsmurf's user avatar
0 votes
2 answers
53 views

I am trying to setup a picker, simple. I am successfully fetching an array of projects from firebase and populating the picker with the names of the projects. The problem that I am having is that I ...
IgnacioHernandezR's user avatar
0 votes
2 answers
191 views

I have pretty much same question as here: SwiftUI Picker onChange or equivalent?, but .onChange won't solve it exactly I need. I have wrote a question in that link, but I was told to ask a new ...
Marcel M.'s user avatar
4 votes
2 answers
4k views

Is there a good way to hide the up down arrows in the picker default style. I am using ios 16. It seems that the older version does not have such arrows. Also, is there a setting to set the picker's ...
Watson's user avatar
  • 53
2 votes
2 answers
1k views

I have a Picker with menu style presenting a label with an icon and text. When applying a padding to any views containing the picker, the picker will behave as though there is not enough space and run ...
Kris Gellci's user avatar
  • 9,747
1 vote
1 answer
2k views

Basically I am using Menu Picker Style for display a set of numbers. I prefer it over Menu because it doesn't have checkmark in front of the selected item and because I need to change the text of the ...
Boyan Pavlov's user avatar
3 votes
2 answers
2k views

I found 2 unexpected (for me) behaviors of Picker in SwiftUI. The default style for Picker on iOS inside the List view seems to be .menu and it does not take any tint color at all (fair enough). ...
Ryba's user avatar
  • 133
0 votes
0 answers
208 views

I have a background in .NET backend and I have decided to learn swift. It is going very well, but I have a few issues in SwiftUI. My problem right now is with the picker. My goal is to pick an item ...
Anders's user avatar
  • 99
1 vote
0 answers
31 views

I have a list which is already containing different values. For each List postitions I have made a button which leads to a sheet View which contains a Picker to change the value of minutes and seconds....
Pascal Pfeifer's user avatar
10 votes
4 answers
2k views

We have an application with some 'chat' functionality where questions are asked and the user can answer with some predefined options: for every question a new view is presented. One of those options ...
Vama's user avatar
  • 260
12 votes
4 answers
8k views

I am using Picker with option for no selection, in iOS15 it is working fine, but in iOS16 it has a default value, how can I remove this default value, I don't need to show the text to the right of the ...
GorCat's user avatar
  • 254
0 votes
1 answer
222 views

Hello, I would like to take some advice on my requirement. I have a parent view which has a child view and that has one more child view. Basically, I would like to pass the binded value to the parent ...
DILIP KOSURI's user avatar
0 votes
2 answers
2k views

Picker with a choice of names. If ‘other’ is selected a TextField appears. User enters something into the TextField and the user entered value needs to also be reassigned to the Picker variable. I've ...
darkenney's user avatar
1 vote
1 answer
201 views

I have an ObservableObject class that fetches the remote data based on month and year value. Initially it works fine because I use current month and year values however I want to update and re run the ...
Samin Jilani's user avatar
1 vote
0 answers
1k views

In SwiftUI, Segmented Pickers (Pickers with SegmentedPickerStyle()) ) come default with a blur in the background of each item. Is there a way to remove this? As you can see, option2 has a gray blur ...
Stoic's user avatar
  • 1,269