A superbly disciplined performance saw the Knights extend their winning run to four games against Swinton.
It was York who started brightly with Jordan Howden’s kick-off allowed to bounce, strike the posts for Ed Smith to gather, step-off his left foot and scamper through.
Howden converted and Ben Dent crossed the line after deft bullet passes from Howden and Jonny Presley again left the Lions defence floundering.
After such an explosive start the Lions were rattled and Howden thumped over a penalty after Pat Smith was punched by Mike Morrison. But the response was immediate as Tom Thackeray collected from the kick-off for Chris Atkin to touch down.
With the initial flurry over, the game settled down to a hard-fought although expansive contest as Howden extended York’s lead to 12-points with a try.
Two minutes after the break Richie Hawkyard broke three tackles and substitute Andy Ackers raced through to score with Ben White’s goal reducing the deficit to only six points.
But York were not to surrender the lead willingly and two tries within six minutes shaped the destiny of the game.
Winger James Clare finished off a length-of-the-field movement before Greg Minikin demonstrated pace and power to touch down.
Darren Hawkyard provided a late response but the Knights were ultimately good value for their victory.
York: B Dent, Clare, Channing, Minikin, Morrison, Howden, Presley, Applegarth, P Smith, Aldous, E Smith, Tonks, Nicholson. Substitutes: Brinning, Cunningham, Blagborough, Learmont
Swinton: R Hawkyard, Robinson, Littler, Rothwell, Atkin, White, Lloyd, Morrison, Govin, D Hawyard, Thackeray, Dwyer, Thornley. Substitutes: James, Lever, Ackers, Gallagher.
Referee: J Roberts (RFL).