The Iranian foreign ministry spokesman has confirmed media reports about an exchange of message between Tehran and Washington over a prisoner swap.