Closed Seobe95 closed 7 months ago
PR 날릴 때 체크 리스트
어떤 종류의 PR인가요?
Issue Number: N/A
KindOfTerms
UIViewRepresentable
import SwiftUI import WebKit
enum KindOfTerms: String { case use = "use" case privacy = "privacy" }
struct TermsView: View { var kindOfTerms: KindOfTerms var body: some View { VStack { switch kindOfTerms { case .use: TermsWebView(urlToLoad: "https://lucky-sycamore-c73.notion.site/af168c49a93b4fa48830d5bc0512dcb5") case .privacy: TermsWebView(urlToLoad: "https://lucky-sycamore-c73.notion.site/12bd694d0a774d2f9c167eb4e7976876") } } .customNavigationBar( centerView: { switch kindOfTerms { case .use: Text("이용약관") case .privacy: Text("개인정보 처리방침") } }, leftView: { BackButton() }, rightView: { EmptyView() }, backgroundColor: .bgColor3 ) } }
struct TermsWebView: UIViewRepresentable { var urlToLoad: String
func makeUIView(context: Context) -> WKWebView { guard let url = URL(string: self.urlToLoad) else { return WKWebView() } let webView = WKWebView() webView.load(URLRequest(url: url)) return webView } func updateUIView(_ uiView: WKWebView, context: UIViewRepresentableContext<TermsWebView>) { }
}
--- # 가능하다면 추가해주세요 ## 변경 사항 스크린샷 혹은 화면 녹화 https://github.com/APP-iOS3rd/PJ3T2_Mymory/assets/79817557/be56eddf-8f77-45e2-a89c-121339c22e23 ## Test 여부 ### Test 정보 ```swift //예시 let testDatas: [TestData] = [.init(...),...]
PR 가이드라인
PR Checklist
PR 날릴 때 체크 리스트
PR Type
어떤 종류의 PR인가요?
연관되는 issue 정보를 알려주세요
Issue Number: N/A
PR 설명하기
어떻게 작동하나요? code 기반으로 설명해주세요
KindOfTerms
를 만들어 약관이 추가되더라도 편하게 관리할 수 있도록 작업했습니다.UIViewRepresentable
을 사용하여 웹뷰를 구성했습니다.enum KindOfTerms: String { case use = "use" case privacy = "privacy" }
struct TermsView: View { var kindOfTerms: KindOfTerms var body: some View { VStack { switch kindOfTerms { case .use: TermsWebView(urlToLoad: "https://lucky-sycamore-c73.notion.site/af168c49a93b4fa48830d5bc0512dcb5") case .privacy: TermsWebView(urlToLoad: "https://lucky-sycamore-c73.notion.site/12bd694d0a774d2f9c167eb4e7976876") } } .customNavigationBar( centerView: { switch kindOfTerms { case .use: Text("이용약관") case .privacy: Text("개인정보 처리방침") } }, leftView: { BackButton() }, rightView: { EmptyView() }, backgroundColor: .bgColor3 ) } }
struct TermsWebView: UIViewRepresentable { var urlToLoad: String
}
기타 언급해야 할 사항들