2

I would like to add a variable in plist string. It is possible to do so?

e.g. in item 0 in an array. The string is "Today is XXXXX" In my swift file, I was able to load the plist and the String. But how can I insert my variable into that plist string? How should I put in my plist and what to code in my swift file?

Thanks

Clarence
  • 1,951
  • 2
  • 34
  • 49

1 Answers1

0
var myDict: NSDictionary?
if let path = NSBundle.mainBundle().pathForResource("Config", ofType: "plist") {
    myDict = NSDictionary(contentsOfFile: path)
}
if let dict = myDict {
    // Use your dict here
}
pradip kikani
  • 627
  • 6
  • 14