If you still want to use an Octree in your Swift project, you may check out Jaap Wijnen's implementation for the Swift Algorithm Club: https://github.com/kodecocodes/swift-algorithm-club/tree/master/Octree
For me, this solved the problem!