detect when the USB cable is plugged into arduino leonardo

Hi everyone, I have an arduino leonardo running from a battery but I want to detect when the USB cable is plugged in, like read the VBUS or UVCC pin or maybe I have to put a wire from VUSB to a digital pin?

thanks in advance