generated from StanfordSpezi/SpeziTemplateApplication
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chat interface hosting web components (#20)
Successfully loaded a web placeholder (google) in chat interface # *Swift Chat Interface* ## ♻️ Current situation & Problem *New branch that hosts an interactive React web view within the SwiftUI interface* ## ⚙️ Release Notes *Added WebView under Chat as a SwiftUI Wrapper* *Modified ChatView under Chat to host desired website. Currently I put localhost for Prisma web as a placeholder, which works.* `if let url = URL(string: "https://www.google.com/")` *Need additional work on formatting.* 1. Chat interface should not zoom in after typing initial message. 2. Ensuring consistency across iPads and iPhones. 3. Next step is implementing user authentication. ## 📚 Documentation *Please reference in-line documentation.* <img width="278" alt="image" src="https://github.com/CS342/2024-Prisma/assets/153574461/a233e587-8d99-464e-8902-c5d13fbfa2d7"> ## ✅ Testing *All tests passed.* *Additional tests to be added for web performance.* ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md). --------- Co-authored-by: Matthew Jörke <[email protected]>
- Loading branch information
1 parent
f577d2d
commit b665da2
Showing
4 changed files
with
46 additions
and
12 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// This source file is part of the Stanford Prisma Application based on the Stanford Spezi Template Application project | ||
// | ||
// SPDX-FileCopyrightText: 2023 Stanford University | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
import SwiftUI | ||
import WebKit | ||
|
||
struct WebView: UIViewRepresentable { | ||
var url: URL | ||
|
||
func makeUIView(context: Context) -> WKWebView { | ||
let webView = WKWebView() | ||
webView.scrollView.isScrollEnabled = true | ||
return webView | ||
} | ||
|
||
func updateUIView(_ uiView: WKWebView, context: Context) { | ||
let request = URLRequest(url: url) | ||
uiView.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