diff options
Diffstat (limited to 'tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.m')
-rw-r--r-- | tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.m | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.m b/tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.m new file mode 100644 index 000000000..985a08a1d --- /dev/null +++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.m @@ -0,0 +1,48 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#import "ViewController.h" + +@interface ViewController () <WCSessionDelegate> + +@end + +@implementation ViewController + +- (void)session:(WCSession *)session activationDidCompleteWithState:(WCSessionActivationState)activationState error:(NSError *)error { + +} + +- (void)sessionDidBecomeInactive:(WCSession *)session { + +} + +- (void)sessionDidDeactivate:(WCSession *)session { + +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + + if ([WCSession isSupported]) { + WCSession *session = [WCSession defaultSession]; + session.delegate = self; + [session activateSession]; + } +} + +- (IBAction)applyButtonClicked:(id)sender { + if ([[WCSession defaultSession] isReachable]) { + NSDictionary *dictionary = @{ + @"host" : [self.hostNameTextField text], + @"port" : [self.portTextField text] + }; + + [[WCSession defaultSession] sendMessage:dictionary + replyHandler:^(NSDictionary *replyHandler) {} + errorHandler:^(NSError *error) {}]; + } +} + +@end |