The only way to get the Tart Apple in Shield is to trade it from Sword, where you can get it from the cutscene, under trees, and in the Battle Cafe. In Shield, Sweet Apples will replace the rewards previously mentioned.
Sweet and Tart Apples in SwSh (DotEsports)
This article has a small error: it says that Sweet Apples are exclusive to Sword and Tart Apples are exclusive to Shield, when in fact it is vice versa.
Hope I helped!