我有一个用
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’?
有谁知道为什么它不认识类型?