This is (should be) the exact equivalent of the Cilia code in Swift: