在我的 Objective-C View Controller 中,我需要推送到下一个 Swift View Controller ,我的基本项目 - obj c,添加 swift 文件后,Xcode 生成 Bridging-Header.h,但我没有看到 -swift.h 文件
热衷于从 obj-c View 插入 swift View 吗?
-(void)longTapInDaClub:(UILongPressGestureRecognizer *)longTap {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"mail" bundle:nil];
nextView *view = (nextView *) [stb instantiateViewControllerWithIdentifier:"next"];
[nextView getIdSample: _idSample];
[self.navigationController pushViewController:view animated:YES];
}
nextView - 是 Swift View Controller
最佳答案
我解决了问题 - 在项目设置 -> build设置 -> 产品模块名称 -> 并输入没有特殊字符和数字字符的有效名称 - 重建项目并#import“moduleName-swift.h”
关于objective-c - 如何将 Objective C View Controller 推送到 Swift View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26211475/