casatwy / CTMediator

The mediator with no regist process to split your iOS Project into multiple project.
Other
4k stars 776 forks source link

用swift 写的Target_NoTargetAction 就调用不了哟 #54

Open wangkeshuai opened 5 years ago

wangkeshuai commented 5 years ago

用swift 写的Target_NoTargetAction 就调用不了哟

casatwy commented 4 years ago

无法复现?

Resoulte commented 3 years ago

@wangkeshuai 怎么解决的啊

IsLuoYe commented 2 years ago

因为在swift里使用NSClassFromString需要加上项目名:NSClassFromString("(workName).(className)") 我的解决方办法是:swift和OC进行混编,Target_NoTargetAction用OC写,然后在OC的代码里再进行一次跳转。

`

import "Target_NoTargetAction.h"

import

@implementation Target_NoTargetAction

-(void)Action_response:(NSDictionary )params{ NSMutableDictionary dic = [NSMutableDictionary dictionaryWithDictionary:params]; dic[kCTMediatorParamsKeySwiftTargetModuleName] = @"workName"; [[CTMediator sharedInstance] performTarget:@"Target" action:@"action" params:dic shouldCacheTarget:NO]; }

@end `

wangkeshuai commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。