Let’s say that you weren’t monitoring the wine or cider batch and the yeast ate all the sugar until the yeast died and the batch tastes dry, but you wanted it sweet. The solution to the problem is called back sweetening.
First off, the yeast should be verified as dead, which can be done by adding potassium sorbate or pasteurizing. From there, sugar or juice can be added to make it sweet. This technique is used with making ciders flavored with other fruits.
In his book Craft Cider Making, Andrew Lea talks about making sweet ciders, “If you want to sweeten dry ciders with added sugar (or with frozen or concentrated apple juice) but you do not want to pasteurise or filter them, it is important that they should be racked and stored for several months after fermentation is complete, to allow the yeast to die out completely before the sugar is added. Otherwise the risk of re-fermentation is considerable. The chances of re-fermentation can be reduced by the addition of yeast inhibitors such as potassium sorbate and benzoate at levels up to 200 ppm. (Both these materials occur naturally in rowan berries and cranberries respectively). Potassium sorbate may be bought from home winemaking suppliers. It is most effective if combined with say 50 ppm of SO2 added at the same time. If the cider is to be sold, however, a total of 200 ppm for the sum of sulphite and sorbate must not be exceeded."
I should note that you do not need to add potassium sorbate to a dry wine or cider if you decide to back sweeten with an artificial sweeteners such as sucralose (Splenda). Most artificial sweeteners are not edible by yeast, so there is no risk that fermentation will start up again. However, using artificial sweeteners is sometimes frowned upon as not being natural, affecting the texture of the cider or wine, causing the wine or cider to have an aftertaste and off flavors, and some even claim it gives them headaches to consume such a product, so consider these issues before deciding to use artificial sweeteners.