Skip to content

Commit 38f96bd

Browse files
committed
update comments
1 parent 61595a3 commit 38f96bd

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

Sources/openai-async-image-swiftui/enum/ImageState.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public enum ImageState{
1717
/// Loaded
1818
case loaded(Image)
1919

20-
/// There's an error happend while fetching
20+
/// There's an error happened while fetching
2121
case loadError(Error)
2222

2323
}

Sources/openai-async-image-swiftui/model/Output.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct Output: Decodable{
1717
/// Set of images
1818
let data: [Base64]
1919

20-
/// Fist image from the recieved data set
20+
/// Fist image from the received data set
2121
var firstImage : String?{
2222
data.first?.b64_json
2323
}

Sources/openai-async-image-swiftui/net/OpenAIImageEndpoint.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
/// Set of specs for acces to OpenAPI image resource
10+
/// Set of specs for access to OpenAPI image resource
1111
@available(iOS 15.0, macOS 12.0, *)
1212
public struct OpenAIImageEndpoint: IOpenAIImageEndpoint{
1313

Sources/openai-async-image-swiftui/viewModel/OpenAIDefaultLoader.swift

+6-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public final class OpenAIDefaultLoader : IOpenAILoader{
2323
/// Http async client
2424
private let client : Http.Proxy<JsonReader, JsonWriter>?
2525

26-
/// Set of params for making requsts
26+
/// Set of params for making requests
2727
private let endpoint : IOpenAIImageEndpoint
2828

29-
/// - Parameter endpoint: Set of params for making requsts
29+
/// - Parameter endpoint: Set of params for making requests
3030
public init(endpoint : IOpenAIImageEndpoint) {
3131

3232
self.endpoint = endpoint
@@ -67,7 +67,10 @@ public final class OpenAIDefaultLoader : IOpenAILoader{
6767
return try imageBase64(from: result.value)
6868

6969
}
70-
70+
71+
/// Decode base64 to Data
72+
/// - Parameter output: Received format from the endpoint
73+
/// - Returns: Decoded data
7174
private func decodeBase64(from output: Output) throws -> Data?{
7275
guard let base64 = output.firstImage else {
7376
throw AsyncImageErrors.returnedNoImages

0 commit comments

Comments
 (0)