The US has carried out attacks on three nuclear sites in Iran, in what Donald Trump called a “spectacular military success”.