The iPhone’s strength has helped to offset supply chain challenges, a global pandemic and recessionary fears.