Linfield's Ivan Sproule took advantage of confusion in the home defence to fire home the winner into an empty net from the edge of the box on 53 minutes.
The victory sees the Blues remain level with Crusaders at the top of the table although the champions enjoy a marginally better goal difference.
Douglas Wilson, Paul McElroy, Alan Teggart and Dale Montgomery were unable to convert chances for the Swifts.
Andrew Waterworth fired wide and Aaron Burns hit the sidenetting for Linfield.
In the first half, Wilson saw his dipping effort go over the bar, while McElroy and Teggart were denied by visiting goalkeeper Ross Glendinning.
Also before the interval, Mark Haughey skimmed the bar with a header and Guy Bates was unable to convert the rebound.
Sproule found the net for the only goal of the game, a triumph which David Healy's side just about deserved.
"I've been emphasising to the players that they should anticipate mistakes and make things happen and Ivan showed good awareness to nip in and score," said Healy.