Swift broke Johnny Rodgers' record on the first of his two touchdowns. Swift, who had 121 yards in receptions, caught a career-high 11 passes to increase his four-year total to 147. That's four more than Rodgers, the 1972 Heisman Trophy winner who set the record in three years.
Joe Ganz's 9-yard pass to Swift late in the third quarter erased Baylor's 20-17 halftime lead, and the two teamed up for a 53-yarder on the Huskers' next series to make it 30-20.
Baylor (3-5, 1-3) came in 2-47 in Big 12 road games, including losses in eight straight. But the Bears gave Nebraska (5-3, 2-2) a scare, with Griffin always a threat to break a long run. He finished with 121 yards rushing, and he threw for 134.
The Huskers started their go-ahead 80-yard drive after Ben Parks missed a 19-yard field-goal attempt. Ganz scrambled and completed a 15-yard pass to Swift on third-and-10 before hitting him with the record-breaking touchdown pass on a short square-out on the left side of the end zone.
Baylor had its ensuing possession kept alive by a roughing-the-punter penalty, but Nebraska got the ball back when safety Larry Asante sacked Griffin on fourth-and-4 at the Nebraska 31.
Ganz, 32-of-46 for 336 yards and three touchdowns, found Swift on a deep fly pattern to make it a 10-point game.
The Huskers were closing in on another touchdown when Quentin Castille fumbled at the Baylor 2. Baylor gave up a safety when Colton Koehler crashed through to tackle Jay Finley in the end zone.
Finley finished with 88 yards for Baylor and Marlon Lucky with 83 for Nebraska.
Baylor gave Nebraska its most competitive game in Lincoln since the Bears won a non-conference game 26-7 in 1956.
Four of Nebraska's previous six home wins over Baylor had been by shutout. In six meetings as Big 12 opponents, Nebraska had outscored the Bears 277-69, scoring 48 or more points five times.
All that was ancient history Saturday.
Baylor scored two quick touchdowns after Nebraska opened a 7-0 lead on Ganz's 6-yard pass to Ryan Hill.
The Bears picked up 15 yards on a personal foul by Cody Glenn for making a horse-collar tackle on Griffin, and then Finley busted through the line for a 32-yard touchdown.
Griffin broke two long runs on the Bears' next series, starting with a 40-yarder on the first play and a 47-yarder around left end for the tiebreaking touchdown on fourth-and-1.
Nebraska was up 17-14 after Lucky's 18-yard run, but Griffin led the Bears 80 yards in six plays just before half. After a facemask penalty on Glenn, Griffin passed 35 and 16 yards to Ernest Smith before Jacoby Jones scored from the 1 for a 20-17 halftime lead.