First the dry apricots swells due to endosmosis as pure water moves into its cells. Then, when it is places in sugar solution, the concentration of water in sugar solution is lower as compared to apricot and hence, water moves out due to exosmosis and it shrinks.