Shares of Apple (AAPL -0.03%) have been on a tear this year. The stock is up an incredible 77% year to date. The market applauded the company's rapid growth in services and wearables and its return to top- and bottom-line growth as it exited fiscal 2019.

But has the stock's wild gain this year made shares no longer attractive? After all, Apple's price-to-earnings ratio has risen from about 13 at the beginning of the year to nearly 24 now. Has the Street's optimism for the tech company gone too far?

Here's a close look at what's behind Apple's recent impressive execution -- and why it's not time to sell the tech stock yet. Shares may even still be worth buying.

Apple CEO Tim Cook greets a customer at an Apple Store on the iPhone X launch day

Apple CEO Tim Cook. Image source: Apple.

Catalysts beyond iPhone

One of the primary reasons for the bullish run in Apple stock during 2019 likely has to do with the company's growth outside of iPhone. With meaningful growth in every segment except iPhone, the company is showing investors that it may not be as dependent on its smartphone segment as it was in the past.

Though iPhone revenue declined 14% year over year in fiscal 2019, combined revenue from the rest of Apple's segments increased by $17 billion, to nearly $118 billion. Even more important, several segments saw explosive growth. Apple's services revenue rose 16.5% year over year, to $46.3 billion. Revenue from the company's "wearables, home, and accessories" segment jumped 41% year over year.

Within Apple's wearables, home, and accessories segment is the tech giant's wildly successful wearables business (Apple Watch, AirPods, and Beats earphones). During fiscal Q4, wearables revenue grew at a rate "well over 50%," said Apple CEO Tim Cook.

Further, Apple is set up well in both services and wearables going into fiscal 2020. Next year, Apple will benefit from four new services launched during 2019: Apple News+, Apple Arcade, Apple Card, and Apple TV+. The tech giant started shipping the latest version of its Apple Watch in September and its AirPods Pro on Oct. 30. Both items have been serving as catalysts for Apple's wearables.

Not only do these new services create new revenue streams for Apple, but they bolster the "stickiness" of the company's overall ecosystem by giving customers more ways to become entrenched.

Valuing Apple stock

At first glance, Apple's $1.3 trillion market cap and its $280 stock price may be hard to wrap your mind around. But consider these tidbits:

  • Apple raked in $59 billion in free cash flow during fiscal 2019 alone.
  • Earnings per share were $11.89 during the period -- up from $9.21 two years ago. 
  • Apple's combined services and wearables, home, and accessories revenue accounted for 27% of fiscal 2019 revenue -- and that revenue was up 24% year over year.
  • Thanks to services' robust 64% gross profit margin, the segment accounted for 30% of Apple's gross profit in fiscal 2019 -- and that gross profit was up 22% year over year.
  • The tech giant has a net cash position of $98 billion.

Suffice it to say, Apple's fundamentals easily support the company's current stock price. And the valuation makes even more sense when viewed alongside the company's track record of execution and its powerful brand.

Sure, the stock may not be the bargain it was earlier this year. But this is a quality stock worth paying up for.

Investors, of course, will want to keep an eye on Apple's iPhone business. If declining revenue in the segment can't stabilize, Apple may struggle to grow its net income. But as long as the company's non-iPhone businesses keep up their momentum and iPhone revenue stabilizes, investors could be rewarded nicely over the long haul.

At a $280 share price, I think Apple stock is a buy.