Post

2 followers Follow
0
Avatar

Newbie trying PKTItem.fetchItemsInAppWithID using Swift

Hello, I'm having a hard time figuring out how to use PKTItem.fetchItemsInAppWithID while coding in swift? The examples are written in Objective C and I can't figure out what the swift equivalent would be? Could someone post an example how to get a list of all items and their fields using swift?

Michael Mashlan

Please sign in to leave a comment.

1 comment

0
Avatar

On the top of my head it would be something like:

PKTItem.fetchItemsInAppWithID(1234, offset: 0, limit: 30).onComplete { (result, error) in
    guard let items = result as? [PKTItem] else {
        // handle error
    }

    for item in items {
        // do something with item
    }
}
Romain Briche 0 votes