Created
March 11, 2024 11:11
-
-
Save aheze/9d667b916c2f631392ec8193e0721a4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
let imageNames = ["A", "B", "C"] | |
var body: some View { | |
ScrollView { | |
VStack { | |
ForEach(imageNames, id: \.self) { imageName in | |
PostView(imageName: imageName) | |
} | |
} | |
} | |
} | |
} | |
struct PostView: View { | |
var imageName: String | |
var body: some View { | |
VStack { | |
Text("Test") | |
Color.clear | |
.overlay { | |
Image(imageName) | |
.resizable() | |
.aspectRatio(contentMode: .fill) | |
} | |
.clipped() | |
.frame(height: 200) | |
HStack { | |
Button("Like") {} | |
Button("Dislike") {} | |
Button("Comment") {} | |
Button("Share") {} | |
} | |
} | |
} | |
} |
Author
aheze
commented
Mar 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment