Cosmic expansion influences the angular size of black hole shadow. The most general way to describe a black hole embedded into an expanding universe is to use the McVittie metric. So far, the exact analytical solution for the shadow size in the McVittie metric, valid for arbitrary law of expansion and arbitrary position of the observer, has not been found. In this paper, we present the first analytical solution for angular size of black hole shadow in McVittie metric as seen by observer comoving with the cosmic expansion. We use a method of matched asymptotic expansions to find approximate solution valid within the entire range of possible positions of observer. As two particular examples, we consider black hole in de Sitter and matter dominated universe.