我有一个用 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!
}
在我尝试构建和运行之前没有错误......我得到“未知类型名称'CustomNavigationController';你的意思是'UINavigationController'吗?”
有谁知道为什么它不识别类型?