format OC code

This commit is contained in:
pengfei.zhou
2019-10-12 14:48:19 +08:00
parent 820f1e9f8c
commit f9b599e7cf
43 changed files with 493 additions and 472 deletions

View File

@@ -7,6 +7,7 @@
#import <Foundation/Foundation.h>
#import "DoricNativePlugin.h"
NS_ASSUME_NONNULL_BEGIN
@interface DoricModalPlugin : DoricNativePlugin

View File

@@ -13,7 +13,7 @@ @implementation DoricModalPlugin
- (void)toast:(NSString *)message withPromise:(DoricPromise *)promise {
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"toast:%@",message);
NSLog(@"toast:%@", message);
[promise resolve:@"Resolved"];
});
}

View File

@@ -11,11 +11,11 @@
NS_ASSUME_NONNULL_BEGIN
@interface DoricPromise : NSObject
- (instancetype)initWithContext: (DoricContext *)context callbackId:(NSString *)callbackId;
- (instancetype)initWithContext:(DoricContext *)context callbackId:(NSString *)callbackId;
- (void)resolve:(id) result;
- (void)resolve:(id)result;
- (void)reject:(id) result;
- (void)reject:(id)result;
@end
NS_ASSUME_NONNULL_END

View File

@@ -8,16 +8,16 @@
#import "DoricPromise.h"
#import "DoricConstant.h"
@interface DoricPromise()
@property (nonatomic,strong) DoricContext *context;
@property (nonatomic,strong) NSString *callbackId;
@interface DoricPromise ()
@property(nonatomic, strong) DoricContext *context;
@property(nonatomic, strong) NSString *callbackId;
@end
@implementation DoricPromise
- (instancetype)initWithContext:(DoricContext *)context callbackId:(NSString *)callbackId {
if(self = [super init]) {
if (self = [super init]) {
_context = context;
_callbackId = callbackId;
}
@@ -25,10 +25,10 @@ - (instancetype)initWithContext:(DoricContext *)context callbackId:(NSString *)c
}
- (void)resolve:(id)result {
[self.context.driver invokeDoricMethod:DORIC_BRIDGE_RESOLVE, self.context.contextId, self.callbackId, result,nil];
[self.context.driver invokeDoricMethod:DORIC_BRIDGE_RESOLVE, self.context.contextId, self.callbackId, result, nil];
}
- (void)reject:(id)result {
[self.context.driver invokeDoricMethod:DORIC_BRIDGE_REJECT, self.context.contextId, self.callbackId, result,nil];
[self.context.driver invokeDoricMethod:DORIC_BRIDGE_REJECT, self.context.contextId, self.callbackId, result, nil];
}
@end

View File

@@ -14,7 +14,7 @@ - (void)render:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
__weak typeof(self) _self = self;
dispatch_async(dispatch_get_main_queue(), ^{
__strong typeof(_self) self = _self;
[self.doricContext.rootNode render:[argument objectForKey:@"props"]];
[self.doricContext.rootNode render:argument[@"props"]];
});
}