Here is the content:
struct layout: View {
var data: RestaurantListViewModel
var body: some View {
HStack {
URLImage(data.imageUrl) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
.frame(maxWidth: 30, maxHeight: 30)
.padding()
}
Text(data.name)
.padding()
HStack {
(rating logic)
}
Button(action: {
print("opening site pressed")
if let url = URL(string: data.url) {
UIApplication.shared.open(url)
}
}) {
// Text("More Info")
Image("yelp logo")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(maxWidth: 30)
}
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: