회원가입 페이지
This commit is contained in:
38
SodaLive/Sources/Common/BaseView.swift
Normal file
38
SodaLive/Sources/Common/BaseView.swift
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// BaseView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/08/09.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct BaseView<Content: View>: View {
|
||||
|
||||
let content: Content
|
||||
|
||||
@Binding var isLoading: Bool
|
||||
|
||||
init(isLoading: Binding<Bool> = .constant(false), @ViewBuilder content: () -> Content) {
|
||||
self._isLoading = isLoading
|
||||
self.content = content()
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
Color.black.ignoresSafeArea()
|
||||
|
||||
content
|
||||
|
||||
if isLoading {
|
||||
LoadingView()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct BaseView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
BaseView(isLoading: .constant(false)) {}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user