It's been said in a comment here on another equestion
Trump "withdrew" from JCPOA because he formally indeed did so. Iran "violates" JCPO because it did not formally withdraw from it, so is in fact violating it. Simple.
But is it that simple? According to Vox:
Trump’s Iran deal announcement was made in a Tuesday afternoon White House address, in which he announced that he would reimpose sanctions on Iran’s oil sector that had been lifted as part of the agreement. This put the US in violation of its obligations under the agreement, and thus constitutes a unilateral American withdrawal from the deal.
As an example of a different US behavior, Trump didn't simply and abruptly "withdraw" from the Paris agreement, but followed a procedure set out in the treaty itself, although he did announce his intention to do so well in advance.
Did the US invoke a specific clause in JCPOA that allows them to "withdraw"? If not, is there some general compact in international law (e.g. the Vienna Convention on the Law of Treaties) that one state can withdraw in anyway they like from a treaty, unless the treaty says otherwise?