Swift: workaround for closure as protocol