Method in Swift extension of an Objective-C class can not be access from .m
file
Swift扩展Objective-C类的方法无法从.m文件访问
I have a bridge header:
我有一个桥头:
extension foViewController {
public func gome()
{
print("Hi");
}
}
I can't call method like [self gome];
in viewdidload
of .m
file
我不能称之为[自我国美]的方法;在.m文件的viewdidload中
1 个解决方案
#1
2
TO access swift files in objective c classes we have to add other import
要访问目标c类中的swift文件,我们必须添加其他导入
example project name is "De"
示例项目名称为“De”
then add #import "De-Swift.h"
然后添加#import“De-Swift.h”
then only we can access swift files in objective c
那么我们只能访问目标c中的swift文件
#1
2
TO access swift files in objective c classes we have to add other import
要访问目标c类中的swift文件,我们必须添加其他导入
example project name is "De"
示例项目名称为“De”
then add #import "De-Swift.h"
然后添加#import“De-Swift.h”
then only we can access swift files in objective c
那么我们只能访问目标c中的swift文件