Post

Replies

Boosts

Views

Activity

Reply to How to pass data from a TextField to a List (SwiftUI)
Most parts get cleared, but it seems you have touched your code since then. You're correct, as I was revamping some views and disregarded important parts. That's entirely my fault. I think it's time for you to start your new thread to solve such another thing. I agree, I feel I've strayed away from what I've been trying to solve...I will start another thread to expand. Edit: Here is the new thread: https://developer.apple.com/forums/thread/670536
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’20
Reply to How to pass data from a TextField to a List (SwiftUI)
The disabled modifier is disabling it entirely, even if I add a value to the TextFields. I need some way to change that.  There's another bug happening with this, as well. Though when initially putting in the info, it doesn't enable the Create button, nor does it update the card preview (CardView) and navigationTitle. But when dismissing it and tapping the add button again, it shows that information and enables the Create button. On another note, I figured out a way to show the cardInfo data in the list, but it's not the way I want it. I want some way to make it so the Create button executes the onAdd function...and it seems finished from what I've tested. I've changed it so AddView shows as a Sheet, so it's no longer a NavigationLink. All I need to do is call onAdd, but that function is embedded in CardsView, where the List is located. I want to call that function from AddView, but it's only available in CardsView.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’20
Reply to How to pass data from a TextField to a List (SwiftUI)
Sorry for the late reply. Where is the button? Where is the list? In AddView, the "Create" button is located at the bottom. Here it is with all its modifiers: Button(action: {}) { Text("Create") .bold() }.disabled(self.cardInfo.name.isEmpty	self.cardInfo.id.isEmpty	self.cardInfo.cname.isEmpty) .foregroundColor(.white) .padding() .padding(.horizontal, 100) .background(Color.accentColor) .cornerRadius(10) The disabled modifier is disabling it entirely, even if I add a value to the TextFields. I need some way to change that. The || dividers aren't showing because it screws up the code block. On my second thing, there is no action specified. That's what I'd like to replace with something to have the now completed (and, correct me if I'm wrong) cardInfo to pass through CardRow and end up in the List that is located in CardsView: List { ForEach(cards) { cards in NavigationLink(destination: CardFullView(cname: cardsInfo.newCard.cname)) { CardRow(cname: cardsInfo.newCard.cname, name: cardsInfo.newCard.name, id: cardsInfo.newCard.id) } } .onDelete(perform: onDelete) .onMove(perform: onMove) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’20