From b2c1bb26cc0c0e288049e6eb9a52c02fe7925763 Mon Sep 17 00:00:00 2001 From: Michael Rebello Date: Thu, 13 Jun 2019 23:43:19 -0700 Subject: [PATCH] docs: add a few inline clarifications (#85) Signed-off-by: Michael Rebello Signed-off-by: JP Simard --- mobile/examples/objective-c/hello_world/ViewController.mm | 2 ++ mobile/examples/swift/hello_world/ResponseValue.swift | 1 + mobile/examples/swift/hello_world/ViewController.swift | 1 + 3 files changed, 4 insertions(+) diff --git a/mobile/examples/objective-c/hello_world/ViewController.mm b/mobile/examples/objective-c/hello_world/ViewController.mm index ec3f597d607b..02a67017cca7 100644 --- a/mobile/examples/objective-c/hello_world/ViewController.mm +++ b/mobile/examples/objective-c/hello_world/ViewController.mm @@ -8,6 +8,7 @@ #pragma mark - ResponseValue +/// Represents a response from the server. @interface ResponseValue : NSObject @property (nonatomic, strong) NSString* body; @property (nonatomic, strong) NSString* serverHeader; @@ -84,6 +85,7 @@ - (void)handleResponse:(NSHTTPURLResponse*)response data:(NSData*)data { return; } + // Deserialize the response, which will include a `Server` header set by Envoy. ResponseValue* value = [ResponseValue new]; value.body = body; value.serverHeader = [[response allHeaderFields] valueForKey:@"Server"]; diff --git a/mobile/examples/swift/hello_world/ResponseValue.swift b/mobile/examples/swift/hello_world/ResponseValue.swift index 16947fd47f60..a03924003f17 100644 --- a/mobile/examples/swift/hello_world/ResponseValue.swift +++ b/mobile/examples/swift/hello_world/ResponseValue.swift @@ -1,3 +1,4 @@ +/// Represents a response from the server. struct Response { let body: String let serverHeader: String diff --git a/mobile/examples/swift/hello_world/ViewController.swift b/mobile/examples/swift/hello_world/ViewController.swift index c45d2ec0b549..bba6f04023e0 100644 --- a/mobile/examples/swift/hello_world/ViewController.swift +++ b/mobile/examples/swift/hello_world/ViewController.swift @@ -56,6 +56,7 @@ final class ViewController: UITableViewController { NSLog("Response:\n\(data.count) bytes\n\(body)\n\(headers)") + // Deserialize the response, which will include a `Server` header set by Envoy. let value = Response(body: body, serverHeader: headers["Server"] ?? "") DispatchQueue.main.async { self.responses.append(value)