-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSplashScreenView.swift
51 lines (42 loc) · 1.08 KB
/
SplashScreenView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// SplashScreenView.swift
// News-24 Watch App
//
// Created by Devin Fernando on 2022-10-21.
//
import SwiftUI
struct SplashScreenView: View {
@State private var isActive = false
@State private var size = 0.8
@State private var opacity = 0.5
var body: some View {
if isActive{
ContentView()
}
else{
VStack{
VStack{
Image("splashicon")
}
.scaleEffect(size)
.opacity(opacity)
.onAppear{
withAnimation(.easeIn(duration: 1.2)){
self.size=1.5
self.opacity=1.0
}
}
}
.onAppear{
DispatchQueue.main.asyncAfter(deadline:.now() + 3.0){
self.isActive=true
}
}
}
}
}
struct SplashScreenView_Previews: PreviewProvider {
static var previews: some View {
SplashScreenView()
}
}