Swift raptureXML

时间:2016-09-05 13:28:41

标签: ios objective-c swift

您好我试图在swift项目中使用raptureXML。有谁知道如何在swift中调用这个函数?

[rootXML iterate:@"players.player" usingBlock: ^(RXMLElement *e) {
    NSLog(@"Player #%@: %@", [e attribute:@"number"], [e child:@"name"].text);
}]; 

1 个答案:

答案 0 :(得分:0)

   xmlElement.iterate("players.player", usingBlock: {
        e in

        print(e.atribute("name"))
    });