Last active
November 4, 2025 04:45
-
-
Save theoknock/dcfc2a4b7f488ecfacc02d274e689d39 to your computer and use it in GitHub Desktop.
Use the more fully featured ChatGPT web app on the macOS desktop.
This file contains hidden or 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
| // | |
| // ContentView.swift | |
| // WebBrowser2025-iPhone | |
| // | |
| // Created by Xcode Developer on 11/3/25. | |
| // | |
| import SwiftUI | |
| import WebKit | |
| struct ContentView: View { | |
| var body: some View { | |
| ZStack { | |
| Color(hex: "#212121") | |
| .ignoresSafeArea() | |
| WebView(url: URL(string: "https://chatgpt.com")) | |
| .padding(.top) | |
| } | |
| } | |
| } | |
| extension Color { | |
| init(hex: String) { | |
| let scanner = Scanner(string: hex) | |
| _ = scanner.scanString("#") | |
| var rgb: UInt64 = 0 | |
| scanner.scanHexInt64(&rgb) | |
| let r = Double((rgb >> 16) & 0xFF) / 255.0 | |
| let g = Double((rgb >> 8) & 0xFF) / 255.0 | |
| let b = Double(rgb & 0xFF) / 255.0 | |
| self.init(red: r, green: g, blue: b) | |
| } | |
| } | |
| #Preview { | |
| ContentView() | |
| .preferredColorScheme(ColorScheme.dark) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment