14. Swift 命名空间.png

https://www.jianshu.com/p/8589dd2e11ed
https://www.jianshu.com/p/839f6dd27dbc
https://blog.csdn.net/ws_752958369/article/details/79880230

命名空间

  1. let namespace = Bundle.main.infoDictionary!["CFBundleExecutable"] as! String
  2. let clazzName = namespace + "." + "ViewController"
  3. let clazz: AnyClass? = NSClassFromString(clazzName)
  4. let controller = clazz as! UIViewController.Type
  5. print(namespace, clazzName) // swift-011 swift-011.ViewController

https://www.jianshu.com/p/5de6f700194b
https://swifter.tips/namespace/
https://www.jianshu.com/p/2a1b5e982858