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
0 votes
2 answers
110 views

I have a form being loaded inside a navigation stack and I'm showing an image and title in the first form section with the code below: Form { Section { VStack { Image("...
ShadesJeff's user avatar
1 vote
1 answer
133 views

In my ongoing quest to understand the layout in a form, I decided to see if I can emulate the sidebar in the new Icon Composer app. I am focusing now on the rows with a title, switch and TextField. ...
koen's user avatar
  • 5,862
0 votes
0 answers
69 views

I need view like this in order to have fixed size form with scrollable capability. I have disclosure groups, buttons and textfields inside form. struct ContentView: View { var body: some View { ...
spt025's user avatar
  • 2,324
1 vote
1 answer
32 views

I am writing a .grouped-styled Form on macOS. For each section in the form, this form style puts a box/border surrounding it, almost like a .insetGrouped-styled List on iOS. While this is desirable ...
Sweeper's user avatar
  • 291k
0 votes
1 answer
51 views

I`ve adapt official Apple tutorial app for my needs. There is a ContentListView that displays a list of recipes on one side and a form to edit the selected recipe on the other. The form includes a ...
Captain_Apollo's user avatar
0 votes
1 answer
188 views

I am trying to display a form as a sheet that contains some data entry items. I want to display the navigation title in .inline display mode. But there is a large gap between the navigation bar title ...
user26789740's user avatar
3 votes
1 answer
68 views

This is my code: Form { Section {} // regular section no background Section { // <--- want this section to have a background color Text("Hello") } .background(Gradient(...
Yuda's user avatar
  • 45
0 votes
0 answers
643 views

I hope you're all doing well. I am new to SwiftUI and I have been working on a form UI in SwiftUI. From a UI perspective, it looks correct, but I'm facing some issues. When I fill in some values in ...
Priya M.'s user avatar
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
1 vote
1 answer
649 views

The idea is to use a Settings View in my App using a Form. However, it seems the Form itself pushes all NavigationLinks from the List view onto the navigation stack (at once). The typical (correct?) ...
RG128's user avatar
  • 211
4 votes
1 answer
1k views

I'm not able to change the background color of a Form in SwiftUI for iOS < 16. It always takes default form backgroundcolor depending on which color scheme is selected in the iPhone settings. All ...
floro's user avatar
  • 41
1 vote
1 answer
1k views

See the code below (BTW, List has the same issue): enum Value: String, Equatable { case a = "a" case b = "b" } struct ContentView: View { @State var value: Value = .a ...
rayx's user avatar
  • 1,780
1 vote
1 answer
147 views

Is there possibility to change background color of this view? Note: I dont want to change form sections color, i want to change background color of view. `.background(Color.red) does not effect. init()...
Raycon's user avatar
  • 13
0 votes
2 answers
595 views

I am fairly new to iOS development. I am trying to update the property "cars" in the "Sire" model using a stepper. Whenever I press on + or - from the stepper controls, it changes ...
Mostafa Nasef's user avatar
0 votes
1 answer
445 views

I have this space between the top of the screen and my text input box. How can I reduce this space? I don't want to bring the input box up too far as it will be obstructed by the notch. However, I ...
PhpCoder223's user avatar
-1 votes
2 answers
2k views

I have A SwiftUI view which is a standard form and in canvas it has the built in IOS form style which is the look I desire. However this form is being used a SideBar embedded in a ...
OverD's user avatar
  • 2,652
0 votes
1 answer
169 views

I have a form with 2 buttons. Now I would like to have a little space between these two buttons. Exactly like in this example: Does anyone know how to implement this? I appreciate any help!
SwiftUI_Max's user avatar
0 votes
2 answers
102 views

I would like to place 2 buttons one below the other with a bit space in a form. Just like in this example: Currently it looks like this: With this code: Form { Section { ...
SwiftUI_Max's user avatar
-2 votes
2 answers
589 views

I want to create a certain amount of TextFields on a view based on the number the user inputs. For Example, if the user inputs 5 I would like to display 5 TextFields on the view. I was thinking about ...
ppraveen's user avatar
3 votes
1 answer
2k views

I would like a single item inside SwiftUI Form to run from side to side, without having Form's default margins. Unfortunately, whatever I do (like ading a wider .frame, negative horizontal padding, or ...
Tomáš Kafka's user avatar
1 vote
0 answers
1k views

I would like to make my list in a form editable and sortable with the editMode. I've already tried using .environment(.editMode, .constant(.active)) on the list or on the ForEach loop, but ...
SwiftUI_Max's user avatar
0 votes
1 answer
1k views

I want to display a picker with segmented style inside a form. Form { Section { Picker("Picker", selection: $selectedOption) { Text("Option 1") ...
Mischa's user avatar
  • 17.5k
0 votes
1 answer
588 views

I'm trying to conditionally render two Forms based on the selection from a segmented picker. It all works fine when there's no animations, but the moment I add them in, the first Form seems to break. ...
JustAnotherCarGuy's user avatar
2 votes
1 answer
473 views

New to SwiftUI. I have a simple form with two Section(). In one of the section, I have put BarChartView() from SwiftUICharts() as shown below. The Bar chart does not fit in the section, needed help ...
learner's user avatar
  • 505
0 votes
1 answer
322 views

I have been trying to animate the transition between 2 views that contain Form views in SwiftUI. However the layout breaks only when the animation applies. This is a fully reproducible example. (Only ...
gh123man's user avatar
  • 1,414
1 vote
1 answer
863 views

EDIT: After running @Yrb's code below, I realized the ForEach loop was a red herring. The actual issue here is that .focused will simply close the keyboard if you attempt to focus a field that is ...
LLooggaann's user avatar
0 votes
1 answer
368 views

In iOS 14 I've following code which prefills all textfields from the coredata model struct EditSimpleSearchView: View { @Environment(\.managedObjectContext) private var viewContext @...
user4150758's user avatar
0 votes
1 answer
60 views

I am creating a game where I have a value of highscore which I want to save each time it is updated even if I exit the app. I have already the value of highscore which updates eveyrtime the score > ...
Adal Chang's user avatar
1 vote
2 answers
1k views

I want to create a ViewModifier, which when applied to a VStack it makes its style look like a List inside a Form, as presented in the image below. I have multiple custom scenarios where Lists don't ...
Liviu's user avatar
  • 172
0 votes
1 answer
349 views

Newbie SwiftUI Dev here. I want to create a scheduling app in SwiftUI and I would like to create a button in navigation bar which change calendar's scope. From .week to month and return. struct ...
razvan2003's user avatar
0 votes
1 answer
1k views

I want when I scroll up the Text ("Hello") will stay fixed, and the text "Welcome " will move up to be on the same line as Text("Hello"). Hope you can give me some ...
David's user avatar
  • 57
1 vote
1 answer
3k views

I'm trying to get something similar to the following using SwiftUI and Picker() But when I try to use Section(header: ) I get the following: Form { Picker("S", selection: $sensor) { ...
Joe Scotto's user avatar
  • 11.1k
1 vote
1 answer
710 views

I've been messing with this for quite some time now and cannot for the life of me figure out where this little white line is coming from. I tried setting .padding(0) and using a .frame() but nothing ...
Joe Scotto's user avatar
  • 11.1k
6 votes
5 answers
7k views

I'm trying to get a circle on top with the form content down below, right above my TabBar. I can somewhat force this by using .frame() but I'm not a big fan of that. It seems like there should be a ...
Joe Scotto's user avatar
  • 11.1k
1 vote
1 answer
660 views

I have a trouble trying to put my Picker inside NavigationLink child struct. MyProblem As you see after some transition (Main Page -> Testing Page -> Picker) and choosing any pickers desire ...
Isaac's user avatar
  • 508
9 votes
0 answers
401 views

I am having a problem on a simple Form{}. Automatic Keyboard Avoidance is not working. Below is a small form with a TextEditor(). When run, the keyboard sits on top the input field, requiring the user ...
Kent's user avatar
  • 1,374
6 votes
0 answers
547 views

Hi there I have a tricky problem to solve with SwiftUI in Xcode 12.4 (iOS 14): given I have a Form with numerous sections and TextEditors, this form having a .toolbar modifier (bottom bar) with some ...
pprochazka72's user avatar
1 vote
1 answer
3k views

The following SwiftUI form will render the section its header and contents incorrectly. The section header should be capitalized and have a background color. The rows should be marked up like a list, ...
Bart van Kuik's user avatar
2 votes
1 answer
3k views

I have three files: AddAssignment, ViewAssignment and Task. A button is clicked on AddAssignment.swift which successfully appends form data to an array inside of Task.swift. However, in a file ...
fesari's user avatar
  • 33
6 votes
1 answer
8k views

I am having trouble debugging an issue with input from textfields. Information: -MacOs Monterey Version 12.0 Beta 21A5284e -Xcode 13.0 beta 3 13A5192j -Physical phone IOS 15.0 19A297e Issue ...
Inb4cookies's user avatar
1 vote
1 answer
355 views

even though the binding properties in fileMover are set to true. file mover is not getting executed. Below is the sample code i have used. Any leads will be helpful. Thanks in advance. var body: ...
sharath kumar's user avatar
9 votes
1 answer
7k views

I want pass data on dismissing of presentViewController to previous screen. Here I would like to use block to pass data to previous screen as UIKitApp. But I'm not getting idea to pass data. What are ...
Jessy's user avatar
  • 167
1 vote
2 answers
1k views

What is wrong with the following test code ? When I enter a character into the field, the didSet goes into a recursive loop. If the inout + & are removed, the code functions as expected with ...
altimes's user avatar
  • 470
0 votes
0 answers
121 views

Not able to get SwiftUI Form content size. I am trying to get full size of a SwiftUI Form which has more content than screen size, that makes it scrollable. Using GeometryReader only gives the screen ...
gagan sharma's user avatar
3 votes
2 answers
1k views

I have an edit view that is presented by a NavigationLink. It takes a recipe, which is held in a manager that has an array of them. App Code (copy pasta should run): import SwiftUI @main struct ...
raphael's user avatar
  • 447
0 votes
1 answer
931 views

I am new to SwiftUI (iOS App Ver 14.x) as I normally use Xamarin. In this case I need to have the application specifically written in SwiftUI. (I am aware that some stuff still needs UIKit). I have ...
William Humphreys's user avatar
2 votes
3 answers
797 views

I have a TextField as search box.I want to make it autosearch i.e whenever i will enter a letter in the TextField, i should get the result without press a enter.Here is my code: TextField("Search&...
Santanu's user avatar
  • 347
2 votes
1 answer
971 views

in the UIKit I catch the button sender (which button is clicked) via code let colorVC = UIColorPickerViewController() colorVC.delegate = self clickedButton = sender present(...
KakhaBoo's user avatar
1 vote
0 answers
477 views

I want to use mdc components in my SwiftUI app. I created a class with protocol UIViewRepresentable, but I would like to modify the height to some constant or maybe remove inner padding. func ...
Bumaza's user avatar
  • 113
0 votes
1 answer
1k views

I’m new to swift UI and programming in general. I’ve learnt the basics so far and now I want to be able to setup a simple form in my app. I can design the form no problem. But I’m not sure what ...
Kevon Brown's user avatar