Here's how you can insert data into a plist file in Swift:
First, locate the path for your plist file. You can use the following code to get the path:
main.swift101 chars2 lines
Load the content of your plist file into an NSMutableDictionary
main.swift148 chars3 lines
Insert data into the NSMutableDictionary
main.swift60 chars2 lines
Write the updated NSMutableDictionary
contents back to your plist file
main.swift55 chars2 lines
Here's the complete code:
main.swift367 chars9 lines
gistlibby LogSnag