Apple's iPhone revenue jumped by almost 22% in the three months to June, but its forecast for the current quarter fell short of analysts' expectations.