File tree 1 file changed +11
-12
lines changed
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
35
35
### 3. Add ** OpenAIAsyncImage** to your code
36
36
37
37
``` swift
38
- OpenAIAsyncImage (prompt : .constant (" sun" ))
39
- .frame (width : 125 , height : 125 )
38
+ OpenAIAsyncImage (prompt : .constant (" sun" ))
40
39
```
41
40
or with custom ** ViewBuilder**
42
41
43
42
``` 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
+ }
52
52
}
53
- }
54
53
```
55
54
56
55
| Param | Description |
@@ -71,4 +70,4 @@ OpenAIAsyncImage(prompt: $imageText, size: .dpi1024){ state in
71
70
[ OpenAI AsyncImage SwiftUI example] ( https://github.com/The-Igor/openai-async-image-swiftui-example )
72
71
73
72
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