The 5th level ranger spell swift quiver (PHB, pp. 279-280) says (bold italics emphasis mine):
Components: V, S, M (a quiver containing at least one piece of ammunition)
You transmute your quiver so it produces an endless supply of nonmagical ammunition...
On each of your turns until the spell ends, you can use a bonus action to make two attacks with a weapon that uses ammunition from the quiver. Each time you make such a ranged attack, your quiver magically replaces the piece of ammunition you used with a similar piece of non magical ammunition.
The way I read this, the ammunition is replaced only when you use it to make these special bonus action attacks, and will not replace ammunition that you use when you make regular attacks with your action. However, this interpretation is not necessarily clear (see this related question, which at time of writing does not have an accepted answer), so that impacts the below scenario:
So, let's say we have a ranger who has only one arrow left. They cast swift quiver (the quiver containing only one piece of ammunition satisfies the material component requirement) and now that spell is active.
If that ranger fires their last arrow with their action (i.e. a "regular" attack, not one of these arrow-replacing bonus action attacks), or (depending on the outcome of the related question) if the quiver was turned upside-down and all the arrows fell out without an attack being involved, the quiver would now be empty. Either way, we can assume that the quiver is now empty in such a way that the spell doesn't replenish the arrows.
Would the spell end because the quiver no longer contains any ammunition? Or is it that, because the material component was satisfied at time of casting, the material component doesn't need to remain valid for the duration of the spell after that point?
Just as a reminder to those wanting to answer this question, this question is about whether or not the spell ends, not whether the arrows of a regular attack are replaced as per the spell. Anyone that wants to address the latter point should post an answer on the related question instead.