All Questions
32 questions
0
votes
1
answer
75
views
Create specified number of items in a list detailed by array
I am wanting to enter a few details on one view.
click a button "Let's go"
and it take me to my next view. In the next view i am passing some this information along with doing some ...
0
votes
0
answers
32
views
I am trying to display an array of Int from Firebase but I keep getting an error and I am not sure why
List {
ForEach(0..<tables.count, id: \.self) { item in
Text("Table \(tables[tableNumber ?? 0].items): \(tables[item].items.formatted())")
}
}
I thought that this code ...
0
votes
1
answer
182
views
Cannot assign to property: 'quest' is a 'let' constant
I want to make a ToDo-App. So I made a List that takes the data from an Array.
The Array works with a struct and consists of a title (String) and a Boolean which checks if the "quest" is ...
0
votes
1
answer
384
views
How would I delete items from a list with a button inside that list?
SwiftUI
[This is the code for the list and my button]
ForEach(items, id: \.self) { current in
VStack(alignment: .leading) {
Text("\(current.task)")
...
-1
votes
1
answer
478
views
How to conform an Array to 'Identifiable'
I'm confused about how Identifiable arrays work. For instance, I have the following array returned as a response to a function:
Optional (["Jane", "John", "Eric", "...
1
vote
0
answers
1k
views
SwiftUI: ForEach difficulty. "Cannot convert value of type 'String' to expected argument type 'Binding<C>'"
Following the apple tutorial "Scrumdinger" app (https://developer.apple.com/tutorials/app-dev-training/creating-a-navigation-hierarchy) and receiving help from @Cheezzhead in my previous ...
0
votes
1
answer
1k
views
SwiftUI: Using ForEach to dynamically generate a List of array data within an array
Following the apple tutorial "Scrumdinger" app (https://developer.apple.com/tutorials/app-dev-training/creating-a-navigation-hierarchy) I've learned a great deal about displaying data within ...
1
vote
2
answers
768
views
SwiftUI - Sorting a structured array and show date item into a Section Header
I'm trying to show some section Header which is based on data in my structured array.
When I add a value in my array from my app I ask to enter a date. This one is save as a String cause I don't know ...
0
votes
1
answer
386
views
Make a searchable List from CSV file in Swift UI
After long time developing in Swift with storyboard I decide to move to Swift UI.
I make a small project to do that. This project is to simply read a CSV file and show some informations in a List and ...
0
votes
1
answer
458
views
Swift Accidental Infinite ForEach Loop
I'm trying to use a foreach loop to show multiple Elements in an [[String]] with the help of an incremented Index in a list. But when I want to generate the list the loop repeats infinity regardless ...
1
vote
1
answer
119
views
swiftui list for each cannot display the items in each array [closed]
im working on a project and i need to display some arguments from a custom view from a array in a list. But i get this error: Instance method 'appendInterpolation(_:formatter:)' requires that '[Int]' ...
0
votes
0
answers
103
views
Use value from Picker to populate list
Can I use value from Picker to populate List in SwiftUI
VStack{
Picker(selection: $selected) {
ForEach(0..<vm.cars.count, id: \.self){
Text(vm.cars[$0].make).tag($0)
...
0
votes
3
answers
223
views
Deleting item from Array once handled by a List in SwiftUI
I'm convinced I'm overthinking this and ending up in a loop of not being able to solve this issue. The short of it is I have an array which includes dates which I am displaying in a list in my main ...
1
vote
1
answer
54
views
SwiftUI: func .insert Error. Is it just that the func code syntax for the .insert is incorrect or should I consider another approach all together?
I have a func .insert error.
Is it just that the func code syntax for the .insert is incorrect or should I consider another approach all together?
import SwiftUI
struct SocialMediaSite: Identifiable {...
1
vote
1
answer
747
views
How do I display an array from this local JSON file as a SwiftUI list in a view?
For example, how do I display the descriptors for each record in a list, such as:
NUTTY, FRUITY
FATTY
FRUITY
(Note that I made descriptors optional in my model because the array might be empty)
Here ...