Skip to content

Instantly share code, notes, and snippets.

View russell-archer's full-sized avatar
🏠
Working from home

Russell Archer russell-archer

🏠
Working from home
View GitHub Profile
@MatthewWaller
MatthewWaller / SwiftUI+ChatGPT.swift
Last active August 9, 2023 03:19
SwiftUI Meets ChatGPT
import SwiftUI
struct ContentView: View {
@StateObject var service = ChatGPTService()
@State var textResponse = ""
var body: some View {
VStack {
Text("Bot says: \(textResponse)")
Button {
Task {
@samsonjs
samsonjs / ContentView.swift
Created July 2, 2024 21:22
How to fix a Swift 6 warning: "Sending main actor-isolated value of type 'WebAuthenticationSession' with later accesses to nonisolated context risks causing data races; this is an error in the Swift 6 language mode"
// https://iosdev.space/@andy/112714337582288785
import AuthenticationServices
import SwiftUI
struct ContentView: View {
@State var url = URL(string: "https://example.net")!
@Environment(\.webAuthenticationSession) var webAuthenticationSession