After Apple (NASDAQ:AAPL) prereleased the financial results of its first quarter, the backlash was swift and severe. The stock slumped about 10% on the news that iPhone sales in emerging markets -- particularly in Greater China -- fell short of the company's modest growth goals. Investors have long been concerned about slowing iPhone sales, and this seemed to confirm their worst fears.

It shouldn't be any surprise, then, that when Apple released the full earnings report earlier this week and reassured shareholders that the sky wasn't falling, investors breathed a sigh of relief and shares rallied back nearly 7%. Let's take a look at the results to see what gave investors a dose of optimism.

A crowd gathering outside the Apple Store in Singapore

Image source: Apple.

The sky isn't falling...

For the first quarter, Apple reported revenue of $84.3 billion, a decline of 5% year over year, and down just 3% when adjusting for the impact of changes in foreign currency exchange rates. This was slightly higher than its revised guidance of $84 billion but far short of the low end of its original projections of $89 billion. The news wasn't all bad, however, as Apple reported record diluted earnings per share of $4.18, up 7.5% from the prior-year quarter.

Apple was quick to point out the growing diversity of its product line, for while iPhone sales declined 15% year over year, revenue from other products and services climbed 19%. Services reached an all-time high of $10.9 billion, an increase of 19% compared to the prior-year quarter. The company reported record sales of Macs, which improved 9% year over year, while sales from its recently renamed "wearables, home, and accessories" segment jumped 33% year over year. Revenue from the iPad grew 17% compared to the prior-year quarter.

The company also boasted new records in a variety of service categories, including the App Store, Apple Play, and cloud services. The strength of the App Store was the result of Apple's installed base of devices -- which grew to 1.4 billion -- coupled with record Christmas Day and Christmas-week sales.

Apple also began reporting gross margins for the first time, at the same time the company quit providing details for unit sales for its products. Gross margin for products was 34.3%, down from 36.1% in the prior-year quarter, the result of product mix. Services gross margin grew to 62.8%, up from 58.3% in the year-ago quarter.

...but China's economy is

Economic weakness in China was responsible for the entirety of the shortfall, according to Apple. On the conference call to discuss the results, Apple CEO Tim Cook said there were year-over-year declines across its product lines in China, hitting not only the iPhone, but the Mac and iPad as well. "Most of the shortfall relative to our original guidance and over 100% of our worldwide year-over-year revenue decline was driven by performance in Greater China," Cook said. In fact, the company reported record sales in many of its largest markets, including the United States, Canada, Mexico, Germany, Italy, Spain, and South Korea.

There was some good news out of China. Services revenue hit record levels in December, while sales of wearables grew 50% year over year. Apple is also adding new customers to its base there, as more than two-thirds of all customers in China who bought a Mac or an iPad during the quarter were purchasing the product for the first time.

A bottom corner of an iPhone X, showing the screen going all the way to the edge of the device

Image source: Apple.

Cook cited a number of factors that impacted iPhone sales overall. A strong dollar relative to other currencies made the iPhone more expensive (while also taking a toll on total revenue, knocking a full 2% off the top line due to unfavorable exchange rates). Additionally, carriers are increasingly unwilling to subsidize the iPhone, shifting more of the burden to customers. Meanwhile, many more iPhone owners than expected availed themselves of Apple's battery replacement program, causing them to temporarily put off buying a new iPhone.

A look ahead

For the upcoming second quarter, Apple is forecasting revenue in a range of $55 billion to $59 billion, a target which, if met, would represent a decline of between 3.4% and 10% year over year. Since all of the company's other segments are growing, this shows that Apple is expecting iPhone revenue to continue to decline. That isn't surprising, since several of the factors Apple cited that negatively affected iPhone sales will likely persist for some time.

Apple is still a great company that's producing tons of cash flow -- it generated $26.7 billion of operating cash flow this quarter -- and it's returning a large amount of capital to investors in the form of dividends and share repurchases.

It's increasingly clear that the days of heady iPhone growth are in the rearview mirror, but Apple still delivered plenty of positive news for investors.

Danny Vena owns shares of Apple. The Motley Fool owns shares of and recommends Apple. The Motley Fool has the following options: long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool has a disclosure policy.