Hello
I have previously created a plist file using Objective C
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>ipaddress</key>
<string>192.168.10.101</string>
<key>ipport</key>
<string>12345</string>
<key>upsname</key>
<string>S 2000 (Port 1)</string>
<key>upsport</key>
<string>1</string>
</dict>
<dict>
<key>ipaddress</key>
<string>192.168.10.102</string>
<key>ipport</key>
<string>12345</string>
<key>upsname</key>
<string>S 3000 (Port 2)</string>
<key>upsport</key>
<string>2</string>
</dict>
<dict>
<key>ipaddress</key>
<string>192.168.10.103</string>
<key>ipport</key>
<string>12345</string>
<key>upsname</key>
<string>S 2000 (Port 3)</string>
<key>upsport</key>
<string>3</string>
</dict>
</array>
</plist>
--------------
I now use Swift and I have created an array of dictionaries that matches following print:
[{
ipaddress = "192.168.10.101";
ipport = 12345;
upsname = "S 2000 (Port 1)";
upsport = 1;
}, {
ipaddress = "192.168.10.102";
ipport = 12345;
upsname = "S 3000 (Port 2)";
upsport = 2;
}, {
ipaddress = "192.168.10.103";
ipport = 12345;
upsname = "S 2000 (3)";
upsport = 3;
}]
Which function may I use to transform this array in a plist file as above ?
Thanks for your help