I have this one view that seems to be much lower than it is supposed to be. Can someone please tell me what I am doing wrong?
var body: some View {
NavigationView {
VStack {
Button("Share") {
let text = "Help me pick where we get dinner tonight by clicking on this link: pickt://join/\(Utilities.code) if you have Pickt installed or downloading Pickt, opening it, clicking join party and entering the code: \(Utilities.code)"
let activityVC = UIActivityViewController(activityItems: [text], applicationActivities: nil)
UIApplication.shared.windows.first?.rootViewController?.present(activityVC, animated: true, completion: nil)
}
Button("Stop Searching") {
if yes.list.count > 0 {
showfinalview()
// showFinal = true
}
}
ZStack {
CardStack(
direction: LeftRight.direction,
data: data,
onSwipe: { card, direction in
print("Swiped \(card.name) to \(direction)")
// print("yelp list = \(Restaurants.viewModels)")
if direction == .right {
yes.list.append(RestaurantListViewModel(name: card.name, imageUrl: card.imageUrl, id: card.id, rating: card.rating, url: card.url))
// print("yes, list = \(yes.list)")
let imgUrl = "\(card.imageUrl)"
db.collection("parties").document(Utilities.code).updateData([
"yesName" : FieldValue.arrayUnion([card.name]),
"yesImg" : FieldValue.arrayUnion([imgUrl]),
"yesId" : FieldValue.arrayUnion([card.id]),
"yesRating" : FieldValue.arrayUnion([card.rating]),
"yesUrl" : FieldValue.arrayUnion([card.url])
])
}else {
print("no")
}
// print("list = \(String(describing: Restaurants.mock.last?.name))")
if card.name == data.last?.name {
showfinalview()
// showFinal = true
}
},
content: { restaurants, direction, _ in
CardViewWithThumbs(restaurants: restaurants, direction: direction)
}
)
.padding(.all)
.scaledToFit()
.frame(alignment: .top)
}
}
.fullScreenCover(isPresented: $showFinal, content: {
Final_Restaurant_View(data: yes.list)
})
}
.navigationTitle("Restaurants")
.navigationBarTitleDisplayMode(.inline)
}
Here is a link to the image https://drive.google.com/file/d/16HIhPCrXtybbh9JD7QRbc5ccBVj9Dhiq/view?usp=sharing
Thanks in advanced!