Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created December 30, 2020 17:45
Show Gist options
  • Save BetterProgramming/7df2e5f2c3685eb5454d2aa3cce26048 to your computer and use it in GitHub Desktop.
Save BetterProgramming/7df2e5f2c3685eb5454d2aa3cce26048 to your computer and use it in GitHub Desktop.
GeometryReader { geo in
ZStack {
VStack(spacing: 20) {
HStack {
Spacer()
Label(
title: { Text("A") },
icon: { Image(systemName: "a.circle.fill") }).font(.system(size: 50))
Spacer()
}.background(Color.green)
Image("image")
.resizable()
.scaledToFill()
.frame(width: 250, height: 400)
Spacer()
}.offset(x: self.currentSegment == 0 ? 0 : -geo.size.width, y: 0)
.animation(.default)
}
}.padding(.horizontal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment