我有一个用Swift编写的CustomViewController类和一个用Objective C编写的CustomNavigationController类.我正在尝试将CustomNavigationController作为属性添加到我的CustomViewController中.我已添加#import "CustomNavigationController.h"到我的桥接标题中.
在我的CustomViewController中,我有:
class CustomViewController: UIViewController {
var navController: CustomNavigationController?
...
//init methods
...
override func viewDidLoad() {
super.viewDidLoad()
//Set up Navigation Controller
navController = self.storyboard.instantiateViewControllerWithIdentifier("CustomNavigationController") as CustomNavigationController!
}
Run Code Online (Sandbox Code Playgroud)
在我尝试构建和运行之前没有错误...我得到"未知类型名称'CustomNavigationController';你的意思是'UINavigationController'?"
有谁知道它为什么不识别这种类型?