import Bencode
let url: URL = <path to torrent file>
let data = try! Data(contentsOf: url!)
do {
let result = try Bencode.decode(data: data)
if let announce = result.dictionary?["announce"]?.string {
print(announce)
}
if let announceList = result.dictionary?["announce"]?.list {
// announceList is [BencodeResult]
for item in announceList {
print(item.string!)
}
}
if let creationDate = result.dictionary?["creation date"]?.integer {
print(creationDate)
}
} catch BencodeDecodeError.invalidFormat {
} catch {
}
SwiftyBencode

Usage
BencodeResult
Decoding torrent file
Installation
Swift Package Manager