The Everton midfielder's second-half free-kick earned Roberto Martinez's men a 2-1 win in Wales to put them fourth in the table.
It was another moment of magic from Barkley who is enjoying a fine breakthrough season, and the England international admitted he always thought he would score.
"It's a relief because I had a chance to score with 20 minutes to go and I slipped, so to see the free-kick go in was a bonus and great for the team," he told Sky Sports 1.
"I told Romelu Lukaku to leave it, because I saw the goal and thought 'I'm going to score this'.
"I don't really practice free-kicks because Leighton Baines is usually on the pitch, so I thought it was my chance."
Skipper Phil Jagielka was happy that Barkley was on his side.
"He slipped and thought it wasn't his day, then five minutes later he hits the bar. Then he's brave enough to take the free-kick and he did," he said.
"It's a massive result because everyone around us won. It was a big game for us, we might have been fortunate to take all three points but that's the sign of a good team."
Swansea boss Michael Laudrup agreed with Jagielka.
"We did not deserve to lose, conceding such a late goal at a moment when Everton, I think, were okay with a draw.
"It was harsh and the least we deserved was a point. That's how football is. Their goalkeeper made a couple of great saves. I don't want to say Everton found luck, because it was a great free-kick, but they found the three points.
"We did well, we played against one of the most in-form teams in the league. We have to move on, the games will come in three days."
The win marked Roberto Martinez's first against his old club.
"Huge credit to the team, it's such a pleasing win because it was a difficult game," the Everton manager said.
"We showed the desire and discipline to win the game and this is a very satisfying day."
On Barkley, who he has previously compared to Paul Gascoigne, Martinez added: "The goal from Ross gave us something to be proud of and something I want to savour.
"We have a few youngsters. Ross, John Stones, James McCarthy, Romelu Lukaku, Seamus Coleman... We have a real nice blend and what pleases me is that in the group, everyone is prepared to work hard for the team.
"Ross is growing game by game and is a diamond of English football. The free-kick was an example of what he can do."