Linfield moved five points clear at the top of the Premiership table with a game in hand despite an unconvincing home display against Dungannon.
Stefan Lavery saw his first-time effort saved by Stuart Addis in the first half while Robert Garrett flashed a header wide before the interval.
Addis denied Lavery before Aaron Burns stabbed home his sixth goal of the season in the 63rd minute.
Garrett struck the base of the post late in the game for the Blues.
Linfield had the ball in the net early on but the 'goal' was ruled out for a foul on Swifts' goalkeeper Niall Morgan.
Former Newry midfielder Damian Curran provided the cross for Burns' winner.