Restart App
Main Objectives
- Advanced App Design: Using Swift UI
- Complex Swift UI Gestures: Custom button with complex gestures
- Parallax Effect : Using multiple movements in the opposite direction(parallax effect) we can ad depth to the onboarding screen
Onboarding Screen
How to build the onboarding screen
1.Create a swft UI file called "onboardingView"
- Once the file is created add the following code
struct OnboardingView: View {
//MARK: - Property
@AppStorage("onboarding") var isOnboardingViewActive: Bool = true
//MARK: -BODY
var body: some View {
ZStack {
Color("ColorBlue")
.ignoresSafeArea(.all, edges: .all)
VStack(spacing: 20) {
}
}
This will only add the blue background.
- Make comments we will need a Header and footer properties
Spacer() VStack(spacing: 0){ Text("Share") .font(.system(size: 60)) .fontWeight(.heavy) .foregroundColor(.white) Text(""" It's not how much we give but how much love we put into giving. """) .font(.title3) .fontWeight(.light) .foregroundColor(.white) .multilineTextAlignment(.center) .padding(.horizontal,10) } //MARK: -CENTER ZStack { ZStack { Circle() .stroke(.white.opacity(0.2),lineWidth: 40) .frame(width: 260, height: 260, alignment: .center) Circle() .stroke(.white.opacity(0.2), lineWidth: 80) .frame(width: 260, height: 260, alignment: .center) }//:ZSTACK Image("character-1") .resizable() .scaledToFit() }//:CENTER Spacer() }
}