Posts

Post not yet marked as solved
2 Replies
I just saw in WWDC video you have to do: TableColumn("Rank") { model in Text("\(model.rank)") } Help documentation is deceiving.
Post not yet marked as solved
3 Replies
I never did get this to work. Ended up implementing my own button code.
Post not yet marked as solved
3 Replies
Post not yet marked as solved
1 Replies
Any solutions? Apple? I am getting the feeling the SwiftUI for mac is not ready at all...
Post marked as solved
1 Replies
import SwiftUI struct Search: Identifiable { let id: UUID let text: String } struct SearchBox: View { @State var searchParam: String = "" @State var stuff = [Search]() @State var showList = false init() { // To remove only extra separators below the list: UITableView.appearance().tableFooterView = UIView() // To remove all separators including the actual ones: UITableView.appearance().separatorStyle = .none } var body: some View { var binding = Binding<String>( get: { self.searchParam }, set: { self.stuff.append( Search(id: UUID(), text: $0) ) self.searchParam = $0 withAnimation { self.showList = self.stuff.count > 0 } }) return VStack(spacing: 0.0) { TextField("Search", text: binding ) .font(.title) .padding() .background(Color.white) if stuff.count > 0 { List { Text("foo") } .transition(.slide) } } } struct SearchBox_Preview: PreviewProvider { static var previews: some View{ SearchBox() } } }I had to change my state in a withAnimation block. That allowed the animation to happen.