Swift获取当前项目名的方法

guard let info = Bundle.main.infoDictionary,
      let projectName = info["CFBundleExecutable"] as? String else { return }

let nameSpace = projectName.replacingOccurrences(of: "-", with: "_")
print(nameSpace)

猜你喜欢

转载自blog.csdn.net/qq_37269542/article/details/131643139