Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import SwiftUI
- struct DrinkItem : View {
- var drink:Drink
- var body: some View {
- VStack(alignment: .leading, spacing: 16.0) {
- Image(drink.imageName)
- .resizable()
- .renderingMode(.original)
- .aspectRatio(contentMode: . fill)
- .frame(width: 300, height: 170)
- .cornerRadius(10)
- .shadow(radius: 10)
- VStack() {
- Text (drink.name)
- .color(.primary)
- .font(.headline)
- Text(drink.description)
- .font(subheadline)
- .color(.secondary)
- .multilineTextAlignment(.leading)
- .lineLimit(2)
- .frame(height: 40)
- }
- }
- }
- }
- #if DEBUG
- struct DrinkItem_Previews : PreviewProvider {
- static var previews: some View {
- DrinkItem(drink: drinkData[0])
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement