Skip to content

Instantly share code, notes, and snippets.

@theoknock
Last active November 4, 2025 04:45
Show Gist options
  • Select an option

  • Save theoknock/dcfc2a4b7f488ecfacc02d274e689d39 to your computer and use it in GitHub Desktop.

Select an option

Save theoknock/dcfc2a4b7f488ecfacc02d274e689d39 to your computer and use it in GitHub Desktop.
Use the more fully featured ChatGPT web app on the macOS desktop.
//
// 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