format OC code
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "DoricNativePlugin.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface DoricModalPlugin : DoricNativePlugin
|
||||
|
@@ -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"];
|
||||
});
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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"]];
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user