0

Hi I'm trying to use raptureXML in swift project. Anyone know how to call this function in swift?

[rootXML iterate:@"players.player" usingBlock: ^(RXMLElement *e) {
    NSLog(@"Player #%@: %@", [e attribute:@"number"], [e child:@"name"].text);
}]; 
rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • Here is a en example on how to use a block (with a closure in Swift): http://stackoverflow.com/questions/26554643/ios-how-to-use-nsmutablestring-in-swift Similar kind of call, you just have to adapt it to your raptureXML method. – Larme Sep 05 '16 at 13:33

1 Answers1

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

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