Well, they sold 77.3m this quarter compared to 78.3m last quarter. The whole pie is shrinking, but by a tiny amount. But they made $7b more revenue from that. So it worked out well for them.
Last quarter was 14 weeks vs the normal 13 so it's more like it's flat or a tiny bit up than shrinking.
And the smartphone market as a whole is shrinking too, and more than 1%. Context, in this cases, matters a lot. Id say sales of iPhone this Q have been really good, considering X was a very risky proposition (high price, casts shadows over 8)