I downloaded a plist file from over the internet via a URLSession. As a result, I have the data (of type Data
) of the plist file.
How can I get the bundle-version out of the file? Note that this does not work because the file is downloaded over the internet.
I already used Google to do some research, but I wasn't able to find anything about this. There was XMLParser, which could be used to parse xml files, but those files don't have a key and a value in a separated tag.
The plist looks like following:
<?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">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>***</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>url</key>
<string>***</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>url</key>
<string>***</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>***</string>
<key>bundle-version</key>
<string>***</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>***</string>
</dict>
</dict>
</array>
</dict>
</plist>
How can I parse the bundle-version with Swift?