Hello there!
I would like to set an image as the background of my project in SwiftUI, but I have no idea how it is done.
Could anyone help me to figure out this?
I am using Swift Playgrounds and SwiftUI framework.
Hello there!
I would like to set an image as the background of my project in SwiftUI, but I have no idea how it is done.
Could anyone help me to figure out this?
I am using Swift Playgrounds and SwiftUI framework.
Use a ZStack:
For a color,
var body: some View {
ZStack {
Color.purple
.ignoresSafeArea()
For an image:
var body: some View {
ZStack {
Image("my image")
.ignoresSafeArea()