Apple outperformed peers during the tech selloff as strong iPhone demand and restrained AI spending boosted shares.