Skip to content

Commit b68bc26

Browse files
committed
Use dictionary literals in example app
1 parent c4cb6ab commit b68bc26

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Example Apps/ExampleApp-OSX/AppDelegate.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ - (void)_createBridge {
3838
NSLog(@"objc got response! %@", responseData);
3939
}];
4040

41-
[_bridge callHandler:@"testJavascriptHandler" data:[NSDictionary dictionaryWithObject:@"before ready" forKey:@"foo"]];
41+
[_bridge callHandler:@"testJavascriptHandler" data:@{ @"foo":@"before ready" }];
4242
}
4343

4444
- (void)_createObjcButtons {
@@ -64,7 +64,7 @@ - (void)_sendMessage {
6464
}
6565

6666
- (void)_callHandler {
67-
NSDictionary* data = [NSDictionary dictionaryWithObject:@"Hi there, JS!" forKey:@"greetingFromObjC"];
67+
is data = @{ @"greetingFromObjC": @"Hi there, JS!" };
6868
[_bridge callHandler:@"testJavascriptHandler" data:data responseCallback:^(id response) {
6969
NSLog(@"testJavascriptHandler responded: %@", response);
7070
}];

Example Apps/ExampleApp-iOS/ExampleAppDelegate.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2626
NSLog(@"objc got response! %@", responseData);
2727
}];
2828

29-
[_bridge callHandler:@"testJavascriptHandler" data:[NSDictionary dictionaryWithObject:@"before ready" forKey:@"foo"]];
29+
[_bridge callHandler:@"testJavascriptHandler" data:@{ @"foo":@"before ready" }];
3030

3131
[self renderButtons:webView];
3232
[self loadExamplePage:webView];
@@ -58,7 +58,7 @@ - (void)sendMessage:(id)sender {
5858
}
5959

6060
- (void)callHandler:(id)sender {
61-
NSDictionary* data = [NSDictionary dictionaryWithObject:@"Hi there, JS!" forKey:@"greetingFromObjC"];
61+
id data = @{ @"greetingFromObjC": @"Hi there, JS!" };
6262
[_bridge callHandler:@"testJavascriptHandler" data:data responseCallback:^(id response) {
6363
NSLog(@"testJavascriptHandler responded: %@", response);
6464
}];

0 commit comments

Comments
 (0)