How to … code this action in Swift.