Skip to content

Instantly share code, notes, and snippets.

struct CardView: View {
var item: ItemData
var animation: Namespace.ID
var body: some View {
HStack {
Circle()
.frame(width: 75)
.foregroundColor(item.color)
.overlay {
import SwiftUI
struct RepeatingViews: View {
@State private var disappearEast: Bool = false
@State private var appearEast: Bool = false
@State private var moveEast: Bool = false
@State private var disappearSugarBeet: Bool = false
@State private var appearSugarBeet: Bool = false
@State private var moveSugarBeet: Bool = false
import SwiftUI
struct AddText: View {
@Environment(\.presentationMode) var presentationMode
@EnvironmentObject var dataViewModel: DataViewModel
@State var addSomeText: String = ""
var body: some View {
Form {
struct SelectedButton: View {
@State var tabButtons = tabs[0]
@Namespace var animation
var body: some View {
VStack {
HStack {
ScrollView(.horizontal, showsIndicators: false) {
ScrollViewReader { value in
LazyHStack(spacing: 20) {
import SwiftUI
struct TypeWriterEffect: View {
@State private var appearText: Bool = false
@State private var theText: String = ""
@State private var theSecondText: String = ""
let finishedText: String = "Hello there ☺️"
let secondFinishedText: String = "How are you this fine evening?"
struct AfterFiveIntroAnimation: View {
@State private var appearText = false
@State private var goLeft = false
@State private var goRight = false
@State private var showStartPageScreen = false
@Namespace var startPageAppear
var body: some View {
VStack {
import SwiftUI
struct AppleLoadingCursor: View {
@State private var showView: Bool = false
@State private var rotateCursor: Bool = false
var body: some View {
VStack {
ZStack {
if showView {
struct WithAnimationPaymentChallenge: View {
@State private var scalePayment: Bool = false
@State private var moveUpAndRight: Bool = false
@State private var moveDownAndRight: Bool = false
var body: some View {
VStack {
Text("Payment App")
.font(.largeTitle)
.fontWeight(.semibold)
@allfinlir
allfinlir / gist:cfb7f60c386f8ae6b99ee712b7bd7350
Created December 15, 2022 12:20
Onboarding page example
struct OnboardingInfoViewAnimation: View {
@State private var appearHeadingObjects: Bool = false
@State private var offsetHeadingObjects: Bool = false
@State private var removeHeadingImage: Bool = false
@State private var offsetImageandText: Bool = false
@State private var appearImageandText: Bool = false
var body: some View {
ZStack {
import SwiftUI
struct SelectedButton: View {
@State var tabButtons = tabs[0]
@Namespace var animation
var body: some View {
VStack {
HStack {
ScrollView(.horizontal, showsIndicators: false) {