4

In Swift 3, We can get $(PRODUCT_BUNDLE_IDENTIFIER) from Bundle.main.bundleIdentifier.

For bundle name, we can access to info.plist and retrieve it as below.

Bundle.main.infoDictionary![kCFBundleNameKey as String] as! String

How to get $(PRODUCT_MODULE_NAME) string? I know that space will be replaced by _. But I want the string to be dependable, not hard-coded.

João Oliveira
  • 422
  • 3
  • 17
  • I found a workaround. If your class is in the same module, you can code `className.components(separatedBy: ".").first!` where `className` is a property of `NSObject`. – João Oliveira Jul 16 '16 at 19:17

0 Answers0