记录一下swift中NSClassFromString正确的使用方法
func pgcompanyTextFTapOne(_ sender:Any?){
//第一步:获取项目名称
let clsName = Bundle.main.infoDictionary!["CFBundleExecutable"] as? String
print(clsName!)
//第二步:拼接参数字符串 项目名+.+需要加载的类的名称
let vcView = NSClassFromString(clsName! + "." + "PGCompanyListViewController") as! PGCompanyListViewController.Type
//第三步:调用初始化方法
let vc = vcView.init()
//第四步执行跳转
self.navigationController?.pushViewController(vc, animated: true)
}