Attempt to covert ik2048 to swift code