A. Inbar A. Inbar - 2 months ago 17
iOS Question

NSBundle.mainBundle().bundleIdentifier! + ".\(self.rawValue)" in swift 3.0?

How can I write the code:

NSBundle.mainBundle().bundleIdentifier! + ".\(self.rawValue)"


in Swift 3.0?
Edit: Never mind,I figured it.

Answer
Bundle.main.bundleIdentifier! + ".\(self.rawValue)"

NS prefix is omitted in swift 3

Working code examples:-

let rawValue = "Testing stackoverflow"
let stringValue1 = Bundle.main.bundleIdentifier! + "test"
let stringValue2 = Bundle.main.bundleIdentifier! + "\(rawValue)"

enter image description here