Jorge Canizales | 34b2629 | 2015-06-02 02:11:09 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * |
| 3 | * Copyright 2015, Google Inc. |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Redistribution and use in source and binary forms, with or without |
| 7 | * modification, are permitted provided that the following conditions are |
| 8 | * met: |
| 9 | * |
| 10 | * * Redistributions of source code must retain the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer. |
| 12 | * * Redistributions in binary form must reproduce the above |
| 13 | * copyright notice, this list of conditions and the following disclaimer |
| 14 | * in the documentation and/or other materials provided with the |
| 15 | * distribution. |
| 16 | * * Neither the name of Google Inc. nor the names of its |
| 17 | * contributors may be used to endorse or promote products derived from |
| 18 | * this software without specific prior written permission. |
| 19 | * |
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | * |
| 32 | */ |
| 33 | |
| 34 | #import <UIKit/UIKit.h> |
| 35 | #import <RouteGuide/RouteGuide.pbrpc.h> |
| 36 | |
| 37 | static NSString * const kHostAddress = @"http://localhost:50051"; |
| 38 | |
| 39 | #pragma mark Get Feature |
| 40 | |
| 41 | @interface GetFeatureViewController : UIViewController |
| 42 | @end |
| 43 | |
| 44 | @implementation GetFeatureViewController |
| 45 | |
| 46 | - (void)viewDidLoad { |
| 47 | [super viewDidLoad]; |
| 48 | |
| 49 | RTGRouteGuide *client = [[RTGRouteGuide alloc] initWithHost:kHostAddress]; |
| 50 | |
| 51 | RTGPoint *point = [RTGPoint message]; |
| 52 | point.latitude = 409146138; |
| 53 | point.longitude = -746188906; |
| 54 | |
| 55 | [client getFeatureWithRequest:point handler:^(RTGFeature *response, NSError *error) { |
| 56 | NSLog(@"Response: %@", response); |
| 57 | }]; |
| 58 | } |
| 59 | |
| 60 | @end |
| 61 | |
| 62 | #pragma mark List Features |
| 63 | |
| 64 | @interface ListFeaturesViewController : UIViewController |
| 65 | @end |
| 66 | |
| 67 | @implementation ListFeaturesViewController |
| 68 | |
| 69 | - (void)viewDidLoad { |
| 70 | [super viewDidLoad]; |
| 71 | // Do any additional setup after loading the view, typically from a nib. |
| 72 | } |
| 73 | |
| 74 | @end |
| 75 | |
| 76 | #pragma mark Record Route |
| 77 | |
| 78 | @interface RecordRouteViewController : UIViewController |
| 79 | @end |
| 80 | |
| 81 | @implementation RecordRouteViewController |
| 82 | |
| 83 | - (void)viewDidLoad { |
| 84 | [super viewDidLoad]; |
| 85 | // Do any additional setup after loading the view. |
| 86 | } |
| 87 | |
| 88 | @end |
| 89 | |
| 90 | #pragma mark Route Chat |
| 91 | |
| 92 | @interface RouteChatViewController : UIViewController |
| 93 | @end |
| 94 | |
| 95 | @implementation RouteChatViewController |
| 96 | |
| 97 | - (void)viewDidLoad { |
| 98 | [super viewDidLoad]; |
| 99 | // Do any additional setup after loading the view. |
| 100 | } |
| 101 | |
| 102 | @end |