If you want something that allows it via RAW, there is catapult, and as others have said also spiritual weapon, animate objects, and sword burst. Dancing and returning magical weapons could also achieve this effect.
However, any ranged attack or spell can be reflavored to be flying swords. Eldritch blast, as someone mentioned before, could look like a sword orbiting the character before being sent to strike a foe. Even something mundane like a longbow can be reflavored. The only thing to remember is that if using a longbow, a player can describe having a number of swords orbiting around them and sending them to strike their foes before returning. But that character would still need to use both hands to do it (they don't have to be holding anything necessarily, but their gestures to control the swords wouldn't allow them to hold anything to maintain the effect. Or they could wield a two-handed focus item, or dual-wield two focus items as stand-ins for the Longbow) and would need to provide some kind of ammo for each use (even if describing the swords returning). Basically, you'd just be mechanically having nothing any different than using a longbow or eldritch blast, but you could visually describe it in such a way. This is the easiest way to provide flexibility to achieve an effect without requiring new homebrew rules or high level spells / magic items to execute it.