Shares of Apple (AAPL 1.30%) have gyrated wildly since U.K. voters chose to leave the European Union late last month. Many analysts believe that "Brexit" will cause a recession in the United Kingdom -- and perhaps in the broader EU -- impacting sales of the iPhone and other Apple gadgets. The strengthening dollar will also contribute to lower revenue and profit for Apple's European operations.

Brexit is likely to reduce Apple's sales in the U.K. Image source: Apple.

Nevertheless, Brexit isn't likely to hurt Apple very much. Any negative impact on demand in the U.K. and the rest of Europe is likely to be offset by positive effects elsewhere.

Results in Britain will suffer

It is virtually inevitable that Brexit will reduce Apple's sales and earnings in the U.K. First, the current state of political turmoil has raised fears of a recession. This will naturally put a damper on consumer spending. Indeed, consumer confidence has already fallen to its lowest level in three years.

To make matters worse, the value of the U.S. dollar has risen significantly relative to the British pound. This exchange rate move means that American companies like Apple will have to either raise their prices in the U.K. or accept lower revenue and profit on each sale there.

US Dollar to British Pound Exchange Rate Chart

US Dollar to British Pound Exchange Rate data by YCharts.

Fortunately, the United Kingdom isn't a particularly large market for Apple. The company only derived 2.3% of its revenue from the U.K. last year.

By contrast, the rest of Europe contributes about 15% of Apple's revenue. Brexit could potentially have spillover effects there, due to the uncertainty about future political and economic relations between the U.K. and the rest of Europe. However, Brexit's impact on the European economy is likely to be smaller in scale. Furthermore, the euro's value relative to the dollar has remained fairly stable thus far.

Brexit could help results in Japan

Curiously, while Brexit will hurt Apple's results in the U.K. -- and perhaps, to some extent, in the rest of Europe -- it could actually bolster the company's sales and earnings in Japan. That's because the Brexit-related "flight to safety" has caused the Japanese yen to rise further against the dollar.

US Dollar to Japanese Yen Exchange Rate Chart

US Dollar to Japanese Yen Exchange Rate data by YCharts.

The yen has now appreciated by more than 15% against the dollar in the past year. Apple already cut iPhone prices in Japan by about 10% in late April in response to the rising yen. The most recent strengthening of the yen has nearly fully offset this price cut.

In other words, Apple is getting almost as much money (in dollar terms) for each iPhone sale in Japan as it was a few months ago, when prices were 10% higher. Thus, Apple's customers in Japan are benefiting from lower prices -- which should stimulate sales -- while Apple hasn't had to compromise on its profit margin.

Total impact of Brexit should be modest

Japan is a much larger market for Apple than the United Kingdom, representing 7% to 8% of its global revenue in recent years. This means that modest sales gains in Japan could go a long way toward offsetting a slump in the U.K.

It's important to note that Apple does face some structural headwinds in Japan. Most notably, smartphone subsidies are declining rapidly there -- as is also the case in the U.S. That could encourage iPhone users to keep their old phones longer. But Apple's price cuts, along with the growing popularity of trade-in programs, should keep iPhones relatively affordable in Japan.

If Europe as a whole falls into a deep recession, then all bets are off. A stronger yen wouldn't provide enough of a sales bump to offset a big drop in Apple's sales in Europe. But as long as the economic fallout from Brexit is largely contained to the U.K., Apple should be just fine.