From f5b07f4f4713cef71106d3e4073148e83c1511e1 Mon Sep 17 00:00:00 2001 From: Mark Lawley Date: Mon, 10 Nov 2025 12:40:41 -0500 Subject: [PATCH] Update documentation to remove method call syntax error and unnecessary try keyword --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e91c968..0ce4d6e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ import RealtimeAPI struct ContentView: View { @State private var newMessage: String = "" - @State private var conversation = try! Conversation() + @State private var conversation = Conversation() var messages: [Item.Message] { conversation.entries.compactMap { switch $0 { @@ -84,7 +84,7 @@ struct ContentView: View { } .navigationTitle("Chat") .navigationBarTitleDisplayMode(.inline) - .task { try! await conversation..connect(ephemeralKey: YOUR_EPHEMERAL_KEY_HERE) } + .task { try! await conversation.connect(ephemeralKey: YOUR_EPHEMERAL_KEY_HERE) } } func sendMessage() { @@ -105,11 +105,11 @@ import SwiftUI import RealtimeAPI struct ContentView: View { - @State private var conversation = try! Conversation() + @State private var conversation = Conversation() var body: some View { Text("Say something!") - .task { try! await conversation..connect(ephemeralKey: YOUR_EPHEMERAL_KEY_HERE) } + .task { try! await conversation.connect(ephemeralKey: YOUR_EPHEMERAL_KEY_HERE) } } } ```