print(indexPath.length) // 4 print(indexPath.indexAtPosition(0)) // 1 print(indexPath.indexAtPosition(1)) // 4 print(indexPath.indexAtPosition(2)) // 3 print(indexPath.indexAtPosition(3)) // 2 // Get with pointer var indexesPtr = UnsafeMutablePointer<Int>.alloc(indexPath.length) indexPath.getIndexes(indexesPtr) let indexes = [Int](UnsafeBufferPointer(start: indexesPtr, count: indexPath.length)) indexes.forEach { value in print(value) // 1 4 3 2 }