1,OC项目在导入swift文件前 先按照系统提示创建桥接文件
2,在 targets -> Build Settings -> Packaging 中设置Defines Module 为YES
3,在桥接文件中导入OC文件的头文件
//#import "MyViewController.h"
#import <UIKit/UIKit.h>
@interface MyViewController:UIViewController
@end
4,在swift文件中调用oc
let vc = MyViewController()
self.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(vc, animated: true)
self.hidesBottomBarWhenPushed = false
本文只是简单实现了swift如何调用oc文件,更深层次的内容以后会持续更新。