clang_format_code'd files previously parsed wrong

pull/19703/head^2
Tony Lu 5 years ago
parent 825ce5cef3
commit b2e8417400
  1. 2
      src/objective-c/examples/watchOS-sample/watchOS-sample-WatchKit-Extension/ExtensionDelegate.h
  2. 80
      src/objective-c/examples/watchOS-sample/watchOS-sample-WatchKit-Extension/ExtensionDelegate.m
  3. 2
      src/objective-c/examples/watchOS-sample/watchOS-sample-WatchKit-Extension/InterfaceController.h
  4. 13
      src/objective-c/examples/watchOS-sample/watchOS-sample-WatchKit-Extension/InterfaceController.m

@ -18,6 +18,6 @@
#import <WatchKit/WatchKit.h> #import <WatchKit/WatchKit.h>
@interface ExtensionDelegate : NSObject <WKExtensionDelegate> @interface ExtensionDelegate : NSObject<WKExtensionDelegate>
@end @end

@ -21,51 +21,61 @@
@implementation ExtensionDelegate @implementation ExtensionDelegate
- (void)applicationDidFinishLaunching { - (void)applicationDidFinishLaunching {
// Perform any final initialization of your application. // Perform any final initialization of your application.
} }
- (void)applicationDidBecomeActive { - (void)applicationDidBecomeActive {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. // Restart any tasks that were paused (or not yet started) while the application was inactive. If
// the application was previously in the background, optionally refresh the user interface.
} }
- (void)applicationWillResignActive { - (void)applicationWillResignActive {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Sent when the application is about to move from active to inactive state. This can occur for
// Use this method to pause ongoing tasks, disable timers, etc. // certain types of temporary interruptions (such as an incoming phone call or SMS message) or
// when the user quits the application and it begins the transition to the background state. Use
// this method to pause ongoing tasks, disable timers, etc.
} }
- (void)handleBackgroundTasks:(NSSet<WKRefreshBackgroundTask *> *)backgroundTasks { - (void)handleBackgroundTasks:(NSSet<WKRefreshBackgroundTask *> *)backgroundTasks {
// Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one. // Sent when the system needs to launch the application in the background to process tasks. Tasks
for (WKRefreshBackgroundTask * task in backgroundTasks) { // arrive in a set, so loop through and process each one.
// Check the Class of each task to decide how to process it for (WKRefreshBackgroundTask *task in backgroundTasks) {
if ([task isKindOfClass:[WKApplicationRefreshBackgroundTask class]]) { // Check the Class of each task to decide how to process it
// Be sure to complete the background task once youre done. if ([task isKindOfClass:[WKApplicationRefreshBackgroundTask class]]) {
WKApplicationRefreshBackgroundTask *backgroundTask = (WKApplicationRefreshBackgroundTask*)task; // Be sure to complete the background task once youre done.
[backgroundTask setTaskCompletedWithSnapshot:NO]; WKApplicationRefreshBackgroundTask *backgroundTask =
} else if ([task isKindOfClass:[WKSnapshotRefreshBackgroundTask class]]) { (WKApplicationRefreshBackgroundTask *)task;
// Snapshot tasks have a unique completion call, make sure to set your expiration date [backgroundTask setTaskCompletedWithSnapshot:NO];
WKSnapshotRefreshBackgroundTask *snapshotTask = (WKSnapshotRefreshBackgroundTask*)task; } else if ([task isKindOfClass:[WKSnapshotRefreshBackgroundTask class]]) {
[snapshotTask setTaskCompletedWithDefaultStateRestored:YES estimatedSnapshotExpiration:[NSDate distantFuture] userInfo:nil]; // Snapshot tasks have a unique completion call, make sure to set your expiration date
} else if ([task isKindOfClass:[WKWatchConnectivityRefreshBackgroundTask class]]) { WKSnapshotRefreshBackgroundTask *snapshotTask = (WKSnapshotRefreshBackgroundTask *)task;
// Be sure to complete the background task once youre done. [snapshotTask setTaskCompletedWithDefaultStateRestored:YES
WKWatchConnectivityRefreshBackgroundTask *backgroundTask = (WKWatchConnectivityRefreshBackgroundTask*)task; estimatedSnapshotExpiration:[NSDate distantFuture]
[backgroundTask setTaskCompletedWithSnapshot:NO]; userInfo:nil];
} else if ([task isKindOfClass:[WKURLSessionRefreshBackgroundTask class]]) { } else if ([task isKindOfClass:[WKWatchConnectivityRefreshBackgroundTask class]]) {
// Be sure to complete the background task once youre done. // Be sure to complete the background task once youre done.
WKURLSessionRefreshBackgroundTask *backgroundTask = (WKURLSessionRefreshBackgroundTask*)task; WKWatchConnectivityRefreshBackgroundTask *backgroundTask =
[backgroundTask setTaskCompletedWithSnapshot:NO]; (WKWatchConnectivityRefreshBackgroundTask *)task;
} else if ([task isKindOfClass:[WKRelevantShortcutRefreshBackgroundTask class]]) { [backgroundTask setTaskCompletedWithSnapshot:NO];
// Be sure to complete the relevant-shortcut task once youre done. } else if ([task isKindOfClass:[WKURLSessionRefreshBackgroundTask class]]) {
WKRelevantShortcutRefreshBackgroundTask *relevantShortcutTask = (WKRelevantShortcutRefreshBackgroundTask*)task; // Be sure to complete the background task once youre done.
[relevantShortcutTask setTaskCompletedWithSnapshot:NO]; WKURLSessionRefreshBackgroundTask *backgroundTask = (WKURLSessionRefreshBackgroundTask *)task;
} else if ([task isKindOfClass:[WKIntentDidRunRefreshBackgroundTask class]]) { [backgroundTask setTaskCompletedWithSnapshot:NO];
// Be sure to complete the intent-did-run task once youre done. } else if ([task isKindOfClass:[WKRelevantShortcutRefreshBackgroundTask class]]) {
WKIntentDidRunRefreshBackgroundTask *intentDidRunTask = (WKIntentDidRunRefreshBackgroundTask*)task; // Be sure to complete the relevant-shortcut task once youre done.
[intentDidRunTask setTaskCompletedWithSnapshot:NO]; WKRelevantShortcutRefreshBackgroundTask *relevantShortcutTask =
} else { (WKRelevantShortcutRefreshBackgroundTask *)task;
// make sure to complete unhandled task types [relevantShortcutTask setTaskCompletedWithSnapshot:NO];
[task setTaskCompletedWithSnapshot:NO]; } else if ([task isKindOfClass:[WKIntentDidRunRefreshBackgroundTask class]]) {
} // Be sure to complete the intent-did-run task once youre done.
WKIntentDidRunRefreshBackgroundTask *intentDidRunTask =
(WKIntentDidRunRefreshBackgroundTask *)task;
[intentDidRunTask setTaskCompletedWithSnapshot:NO];
} else {
// make sure to complete unhandled task types
[task setTaskCompletedWithSnapshot:NO];
} }
}
} }
@end @end

@ -16,8 +16,8 @@
* *
*/ */
#import <WatchKit/WatchKit.h>
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <WatchKit/WatchKit.h>
@interface InterfaceController : WKInterfaceController @interface InterfaceController : WKInterfaceController

@ -24,7 +24,6 @@
@end @end
@implementation InterfaceController { @implementation InterfaceController {
GRPCCallOptions *_options; GRPCCallOptions *_options;
RMTTestService *_service; RMTTestService *_service;
@ -35,10 +34,9 @@
// Configure interface objects here. // Configure interface objects here.
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init]; GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
_options = options; _options = options;
_service = [[RMTTestService alloc] initWithHost:@"grpc-test.sandbox.googleapis.com" _service = [[RMTTestService alloc] initWithHost:@"grpc-test.sandbox.googleapis.com"
callOptions:_options]; callOptions:_options];
} }
@ -54,12 +52,10 @@
} }
- (IBAction)makeCall { - (IBAction)makeCall {
RMTSimpleRequest *request = [RMTSimpleRequest message]; RMTSimpleRequest *request = [RMTSimpleRequest message];
request.responseSize = 100; request.responseSize = 100;
GRPCUnaryProtoCall *call = [_service unaryCallWithMessage:request GRPCUnaryProtoCall *call =
responseHandler:self [_service unaryCallWithMessage:request responseHandler:self callOptions:nil];
callOptions:nil];
[call start]; [call start];
} }
@ -72,6 +68,3 @@
} }
@end @end

Loading…
Cancel
Save