-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jongnan
committed
Aug 2, 2024
1 parent
ec10b84
commit 7b940ba
Showing
3 changed files
with
95 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// WebView.swift | ||
// DesignSystem | ||
// | ||
// Created by 김종윤 on 8/2/24. | ||
// | ||
|
||
import SwiftUI | ||
import WebKit | ||
|
||
public struct WebView: UIViewRepresentable { | ||
let url: URL? | ||
|
||
public init(url: URL?) { | ||
self.url = url | ||
} | ||
|
||
public func makeUIView(context: Context) -> some WKWebView { | ||
return WKWebView() | ||
} | ||
|
||
public func updateUIView(_ webView: UIViewType, context: Context) { | ||
if let url = url { | ||
let request = URLRequest(url: url) | ||
webView.load(request) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters