标签:
class IndexViewController: UIViewController{} let className = "IndexViewController" let bundlePath = NSBundle.mainBundle().bundlePath let bundleFullName = bundlePath.componentsSeparatedByString("/").last let bundleName = bundleFullName?.componentsSeparatedByString(".").first let clazz = NSClassFromString(bundleName! + "." + className)! as! UIViewController.Type let object = clazz.init() // let object1 = Index() 普通方法
标签:
原文地址:http://www.cnblogs.com/threeday/p/5265744.html