Skip to content

Commit 1e71b44

Browse files
add/finish adding moar docs
1 parent e0ca1b3 commit 1e71b44

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

Sources/Apollo/Bundle+Helpers.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ extension Bundle {
2323
return self.bundleValue(forKey: String(kCFBundleIdentifierKey))
2424
}
2525

26+
/// The build number of this bundle (kCFBundleVersion) as a string, or nil if not present.
2627
var buildNumber: String? {
2728
return self.bundleValue(forKey: String(kCFBundleVersionKey))
2829
}
2930

31+
/// The short version string for this bundle, or nil if not present.
3032
var shortVersion: String? {
3133
return self.bundleValue(forKey: "CFBundleShortVersionString")
3234
}

Sources/ApolloWebSocket/WebSocketTask.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ import Apollo
44
import Foundation
55
import Starscream
66

7+
/// A task to wrap sending/canceling operations over a websocket.
78
final class WebSocketTask<Operation: GraphQLOperation>: Cancellable {
89
let sequenceNumber : String?
910
let transport: WebSocketTransport
1011

11-
init(_ ws: WebSocketTransport, _ operation: Operation, _ completionHandler: @escaping (_ result: Result<JSONObject, Error>) -> Void) {
12+
/// Designated initializer
13+
///
14+
/// - Parameter ws: The `WebSocketTransport` to use for this task
15+
/// - Parameter operation: The `GraphQLOperation` to use
16+
/// - Parameter completionHandler: A completion handler to fire when the operation has a result.
17+
init(_ ws: WebSocketTransport,
18+
_ operation: Operation,
19+
_ completionHandler: @escaping (_ result: Result<JSONObject, Error>) -> Void) {
1220
sequenceNumber = ws.sendHelper(operation: operation, resultHandler: completionHandler)
1321
transport = ws
1422
}
@@ -19,7 +27,7 @@ final class WebSocketTask<Operation: GraphQLOperation>: Cancellable {
1927
}
2028
}
2129

22-
// unsubscribe same as cancel
30+
// Unsubscribes from further results from this task.
2331
public func unsubscribe() {
2432
cancel()
2533
}

Sources/ApolloWebSocket/WebSocketTransport.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ public class WebSocketTransport {
6262

6363
/// Designated initializer
6464
///
65-
/// - Parameter request: <#request description#>
66-
/// - Parameter clientName: <#clientName description#>
67-
/// - Parameter clientVersion: <#clientVersion description#>
68-
/// - Parameter sendOperationIdentifiers: <#sendOperationIdentifiers description#>
69-
/// - Parameter reconnectionInterval: <#reconnectionInterval description#>
70-
/// - Parameter connectingPayload: <#connectingPayload description#>
71-
/// - Parameter requestCreator: <#requestCreator description#>
65+
/// - Parameter request: The connection URLRequest
66+
/// - Parameter clientName: The client name to use for this client. Defauls to `Self.defaultClientName`
67+
/// - Parameter clientVersion: The client version to use for this client. Defaults to `Self.defaultClientVersion`.
68+
/// - Parameter sendOperationIdentifiers: Whether or not to send operation identifiers with operations. Defaults to false.
69+
/// - Parameter reconnectionInterval: How long to wait before attempting to reconnect. Defaults to half a second.
70+
/// - Parameter connectingPayload: [optional] The payload to send on connection. Dfaults to an empty `GraphQLMap`.
71+
/// - Parameter requestCreator: The request creator to use when serializing requests. Defaults to an `ApolloRequestCreator`.
7272
public init(request: URLRequest,
7373
clientName: String = WebSocketTransport.defaultClientName,
7474
clientVersion: String = WebSocketTransport.defaultClientVersion,

0 commit comments

Comments
 (0)