Skip to content

Latest commit

 

History

History
26 lines (24 loc) · 825 Bytes

other-features.md

File metadata and controls

26 lines (24 loc) · 825 Bytes

Custom Initial Loading Animation

 // OPTIONAL: Display loading screen during view initialization
    KinesteXAIFramework.createMainView(...)
    .overlay(
        Group {
            if showAnimation {
                Text("Aifying workouts...")
                    .foregroundColor(.black)
                    .font(.caption)
                    .frame(maxWidth: .infinity, maxHeight: .infinity)
                    .background(Color.white)
                    .scaleEffect(showAnimation ? 1 : 3)
                    .opacity(showAnimation ? 1 : 0)
                    .animation(.easeInOut(duration: 1.5), value: showAnimation)
            }
        }
    )
    .onChange(of: isLoading) { newValue in
        withAnimation(.easeInOut(duration: 2.5)) {
            showAnimation = !newValue
        }
    }