File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -35,22 +35,21 @@ DALL-E and DALL-E 2 are deep learning models developed by OpenAI to generate dig
3535### 3. Add ** OpenAIAsyncImage** to your code
3636
3737``` swift
38- OpenAIAsyncImage (prompt : .constant (" sun" ))
39- .frame (width : 125 , height : 125 )
38+ OpenAIAsyncImage (prompt : .constant (" sun" ))
4039```
4140or with custom ** ViewBuilder**
4241
4342``` swift
44- OpenAIAsyncImage (prompt : $imageText, size : .dpi1024 ){ state in
45- switch state{
46- case .loaded (let image) :
47- image
48- .resizable ()
49- .scaledToFill ()
50- case .loadError (let error) : Text (error.localizedDescription )
51- case .loading : ProgressView ()
43+ OpenAIAsyncImage (prompt : $imageText, size : .dpi1024 ){ state in
44+ switch state{
45+ case .loaded (let image) :
46+ image
47+ .resizable ()
48+ .scaledToFill ()
49+ case .loadError (let error) : Text (error.localizedDescription )
50+ case .loading : ProgressView ()
51+ }
5252 }
53- }
5453```
5554
5655| Param | Description |
@@ -71,4 +70,4 @@ OpenAIAsyncImage(prompt: $imageText, size: .dpi1024){ state in
7170[ OpenAI AsyncImage SwiftUI example] ( https://github.com/The-Igor/openai-async-image-swiftui-example )
7271
7372
74- ![ OpenAI AsyncImage SwiftUI] ( https://github.com/The-Igor/openai-async-image-swiftui/blob/main/image/sun_11.png )
73+ ![ OpenAI AsyncImage SwiftUI] ( https://github.com/The-Igor/openai-async-image-swiftui/blob/main/image/sun_11.png )
You can’t perform that action at this time.
0 commit comments