I've just seen an advert for a Fiat featuring Apple CarPlay, what is the difference between using that and using your phone while driving? Or am I right in assuming one is legal and one isn't?

Put another way it is illigal to put my phone in a holder in front of me, but it's ok to use that?