Bumble Inc. interview question

Refactor this ObjC code into Swift