mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-29 14:10:47 +08:00
fix(ios): fix component method parameter type error
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
HIPPY_EXPORT_VIEW_PROPERTY(text, NSString)
|
||||
|
||||
RENDER_COMPONENT_EXPORT_METHOD(changeColor:(nonnull NSNumber *)reactTag
|
||||
color:(__unused NSString *)color) {
|
||||
color:(NSString *)color) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry){
|
||||
UIView *view = viewRegistry[reactTag];
|
||||
if (view == nil || ![view isKindOfClass:[MyView class]]) {
|
||||
|
||||
@@ -30,7 +30,7 @@ HIPPY_EXPORT_VIEW_PROPERTY(onFooterReleased, HippyDirectEventBlock)
|
||||
HIPPY_EXPORT_VIEW_PROPERTY(onFooterPulling, HippyDirectEventBlock)
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooter : (nonnull NSNumber *)reactTag) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooter:(nonnull NSNumber *)reactTag) {
|
||||
[self.renderContext addUIBlock:^(id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, __kindof UIView *> *viewRegistry) {
|
||||
HippyRefresh *refreshView = viewRegistry[reactTag];
|
||||
[refreshView refreshFinish];
|
||||
@@ -39,7 +39,7 @@ RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooter : (nonnull NSNumber *)reactTag
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooterWithOptions : (nonnull NSNumber *)reactTag options:(NSDictionary *)options) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooterWithOptions:(nonnull NSNumber *)reactTag options:(NSDictionary *)options) {
|
||||
[self.renderContext addUIBlock:^(id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, __kindof UIView *> *viewRegistry) {
|
||||
HippyRefresh *refreshView = viewRegistry[reactTag];
|
||||
[refreshView refreshFinishWithOption:options];
|
||||
@@ -48,7 +48,7 @@ RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooterWithOptions : (nonnull NSNumber
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(expandPullFooter : (nonnull NSNumber *)reactTag) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(expandPullFooter:(nonnull NSNumber *)reactTag) {
|
||||
[self.renderContext addUIBlock:^(id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, __kindof UIView *> *viewRegistry) {
|
||||
HippyRefresh *refreshView = viewRegistry[reactTag];
|
||||
[refreshView refresh];
|
||||
|
||||
@@ -29,7 +29,7 @@ HIPPY_EXPORT_VIEW_PROPERTY(onHeaderReleased, HippyDirectEventBlock)
|
||||
HIPPY_EXPORT_VIEW_PROPERTY(onHeaderPulling, HippyDirectEventBlock)
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(expandPullHeader : (nonnull NSNumber *)reactTag) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(expandPullHeader:(nonnull NSNumber *)reactTag) {
|
||||
[self.renderContext addUIBlock:^(id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, __kindof UIView *> *viewRegistry) {
|
||||
HippyRefresh *refreshView = viewRegistry[reactTag];
|
||||
[refreshView refresh];
|
||||
@@ -38,7 +38,7 @@ RENDER_COMPONENT_EXPORT_METHOD(expandPullHeader : (nonnull NSNumber *)reactTag)
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(collapsePullHeader : (nonnull NSNumber *)reactTag) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(collapsePullHeader:(nonnull NSNumber *)reactTag) {
|
||||
[self.renderContext addUIBlock:^(id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, __kindof UIView *> *viewRegistry) {
|
||||
HippyRefresh *refreshView = viewRegistry[reactTag];
|
||||
[refreshView refreshFinish];
|
||||
@@ -47,7 +47,7 @@ RENDER_COMPONENT_EXPORT_METHOD(collapsePullHeader : (nonnull NSNumber *)reactTag
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(collapsePullHeaderWithOptions : (nonnull NSNumber *)reactTag options:(NSDictionary *)options) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(collapsePullHeaderWithOptions:(nonnull NSNumber *)reactTag options:(NSDictionary *)options) {
|
||||
[self.renderContext addUIBlock:^(id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, __kindof UIView *> *viewRegistry) {
|
||||
HippyRefresh *refreshView = viewRegistry[reactTag];
|
||||
[refreshView refreshFinishWithOption:options];
|
||||
|
||||
@@ -50,7 +50,7 @@ HIPPY_EXPORT_VIEW_PROPERTY(horizontal, BOOL)
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(scrollToIndex:(nonnull NSNumber *)hippyTag
|
||||
xIndex:(__unused NSNumber *)xIndex
|
||||
yIndex:(__unused NSNumber *)yIndex
|
||||
yIndex:(NSNumber *)yIndex
|
||||
animation:(nonnull NSNumber *)animation) {
|
||||
[self.renderContext addUIBlock:
|
||||
^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry){
|
||||
@@ -66,9 +66,9 @@ RENDER_COMPONENT_EXPORT_METHOD(scrollToIndex:(nonnull NSNumber *)hippyTag
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(scrollToContentOffset:(nonnull NSNumber *)hippyTag
|
||||
x:(nonnull NSNumber *)x
|
||||
y:(nonnull NSNumber *)y
|
||||
animation:(nonnull NSNumber *)animation) {
|
||||
x:(nonnull NSNumber *)x
|
||||
y:(nonnull NSNumber *)y
|
||||
animation:(nonnull NSNumber *)animation) {
|
||||
[self.renderContext addUIBlock:
|
||||
^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry){
|
||||
HippyBaseListView *view = (HippyBaseListView *)viewRegistry[hippyTag];
|
||||
|
||||
@@ -120,15 +120,15 @@ RENDER_COMPONENT_EXPORT_METHOD(getContentSize:(nonnull NSNumber *)hippyTag
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(scrollTo:(nonnull NSNumber *)hippyTag
|
||||
offsetX:(CGFloat)x
|
||||
offsetY:(CGFloat)y
|
||||
offsetX:(NSNumber *)x
|
||||
offsetY:(NSNumber *)y
|
||||
animated:(BOOL)animated) {
|
||||
[self.renderContext addUIBlock:
|
||||
^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry){
|
||||
UIView *view = viewRegistry[hippyTag];
|
||||
if (view == nil) return ;
|
||||
if ([view conformsToProtocol:@protocol(HippyScrollableProtocol)]) {
|
||||
[(id<HippyScrollableProtocol>)view scrollToOffset:(CGPoint){x, y} animated:animated];
|
||||
[(id<HippyScrollableProtocol>)view scrollToOffset:(CGPoint){[x floatValue], [y floatValue]} animated:animated];
|
||||
} else {
|
||||
// HippyLogError(@"tried to scrollTo: on non-HippyScrollableProtocol view %@ "
|
||||
// "with tag #%@", view, hippyTag);
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ HIPPY_EXPORT_VIEW_PROPERTY(autoplay, BOOL)
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(setPage:(nonnull NSNumber *)hippyTag
|
||||
pageNumber:(__unused NSNumber *)pageNumber) {
|
||||
pageNumber:(NSNumber *)pageNumber) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry){
|
||||
UIView *view = viewRegistry[hippyTag];
|
||||
|
||||
@@ -62,7 +62,7 @@ RENDER_COMPONENT_EXPORT_METHOD(setPage:(nonnull NSNumber *)hippyTag
|
||||
|
||||
// clang-format off
|
||||
RENDER_COMPONENT_EXPORT_METHOD(setPageWithoutAnimation:(nonnull NSNumber *)hippyTag
|
||||
pageNumber:(__unused NSNumber *)pageNumber) {
|
||||
pageNumber:(NSNumber *)pageNumber) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry){
|
||||
UIView *view = viewRegistry[hippyTag];
|
||||
if (view == nil || ![view isKindOfClass:[HippySmartViewPagerView class]]) {
|
||||
|
||||
@@ -45,12 +45,11 @@ HIPPY_EXPORT_VIEW_PROPERTY(onScroll, HippyDirectEventBlock)
|
||||
return [[HippyWaterfallView alloc] init];
|
||||
}
|
||||
|
||||
RENDER_COMPONENT_EXPORT_METHOD(refreshCompleted
|
||||
: (nonnull NSNumber *)reactTag status
|
||||
: (nonnull NSNumber *)status text
|
||||
: (nonnull NSString *)text duration
|
||||
: (nonnull NSNumber *)duration imageUrl
|
||||
: (nonnull NSString *)imageUrl) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(refreshCompleted:(nonnull NSNumber *)reactTag
|
||||
status:(nonnull NSNumber *)status
|
||||
text:(nonnull NSString *)text
|
||||
duration:(nonnull NSNumber *)duration
|
||||
imageUrl:(nonnull NSString *)imageUrl) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
||||
HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag];
|
||||
if (view == nil)
|
||||
@@ -62,7 +61,7 @@ RENDER_COMPONENT_EXPORT_METHOD(refreshCompleted
|
||||
}];
|
||||
}
|
||||
|
||||
RENDER_COMPONENT_EXPORT_METHOD(startRefresh : (nonnull NSNumber *)reactTag) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(startRefresh:(nonnull NSNumber *)reactTag) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
||||
HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag];
|
||||
if (view == nil)
|
||||
@@ -74,7 +73,8 @@ RENDER_COMPONENT_EXPORT_METHOD(startRefresh : (nonnull NSNumber *)reactTag) {
|
||||
}];
|
||||
}
|
||||
|
||||
RENDER_COMPONENT_EXPORT_METHOD(startRefreshWithType : (nonnull NSNumber *)reactTag type : (NSUInteger)type) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(startRefreshWithType:(nonnull NSNumber *)reactTag
|
||||
type:(NSNumber *)type) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
||||
HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag];
|
||||
if (view == nil)
|
||||
@@ -82,11 +82,11 @@ RENDER_COMPONENT_EXPORT_METHOD(startRefreshWithType : (nonnull NSNumber *)reactT
|
||||
if (![view isKindOfClass:[HippyWaterfallView class]]) {
|
||||
//HippyLogError(@"Invalid view returned from registry, expecting QBRNWaterfallView, got: %@", view);
|
||||
}
|
||||
[view startRefreshFromJSWithType:type];
|
||||
[view startRefreshFromJSWithType:[type unsignedIntegerValue]];
|
||||
}];
|
||||
}
|
||||
|
||||
RENDER_COMPONENT_EXPORT_METHOD(callExposureReport : (nonnull NSNumber *)reactTag) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(callExposureReport:(nonnull NSNumber *)reactTag) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
||||
HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag];
|
||||
if (view == nil)
|
||||
@@ -98,11 +98,10 @@ RENDER_COMPONENT_EXPORT_METHOD(callExposureReport : (nonnull NSNumber *)reactTag
|
||||
}];
|
||||
}
|
||||
|
||||
RENDER_COMPONENT_EXPORT_METHOD(scrollToIndex
|
||||
: (nonnull NSNumber *)reactTag xIndex
|
||||
: (nonnull NSNumber *)xIndex yIndex
|
||||
: (nonnull NSNumber *)yIndex animation
|
||||
: (nonnull NSNumber *)animation) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(scrollToIndex:(nonnull NSNumber *)reactTag
|
||||
xIndex:(nonnull NSNumber *)xIndex
|
||||
yIndex:(nonnull NSNumber *)yIndex
|
||||
animation:(nonnull NSNumber *)animation) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
||||
HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag];
|
||||
if (view == nil)
|
||||
@@ -114,11 +113,10 @@ RENDER_COMPONENT_EXPORT_METHOD(scrollToIndex
|
||||
}];
|
||||
}
|
||||
|
||||
RENDER_COMPONENT_EXPORT_METHOD(scrollToContentOffset
|
||||
: (nonnull NSNumber *)reactTag x
|
||||
: (nonnull NSNumber *)x y
|
||||
: (nonnull NSNumber *)y animation
|
||||
: (nonnull NSNumber *)animation) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(scrollToContentOffset:(nonnull NSNumber *)reactTag
|
||||
x:(nonnull NSNumber *)x
|
||||
y:(nonnull NSNumber *)y
|
||||
animation:(nonnull NSNumber *)animation) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
||||
HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag];
|
||||
if (view == nil)
|
||||
@@ -130,7 +128,7 @@ RENDER_COMPONENT_EXPORT_METHOD(scrollToContentOffset
|
||||
}];
|
||||
}
|
||||
|
||||
RENDER_COMPONENT_EXPORT_METHOD(startLoadMore : (nonnull NSNumber *)reactTag) {
|
||||
RENDER_COMPONENT_EXPORT_METHOD(startLoadMore:(nonnull NSNumber *)reactTag) {
|
||||
[self.renderContext addUIBlock:^(__unused id<HippyRenderContext> renderContext, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
||||
HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag];
|
||||
if (view == nil)
|
||||
|
||||
Reference in New Issue
Block a user