The 49ers made a late-night trade in April to move back into the end of the third round to select an unheralded quarterback from Iowa.

The deal did not come without some second-guessing. After all, why trade away a seventh-round pick for C.J. Beathard, when he was likely to be available five picks later with the 49ers’ next scheduled draft pick?

Beathard has done everything right since his arrival, seemingly justifying the 49ers' decision to make sure they secured him when they did. And a solid showing during training camp has placed him in position to overtake veteran Matt Barkley as the team’s No. 2 quarterback.

“That’s for the coaches to decide on and evaluate,” Beathard said. “I’m critical of myself and I feel like there were plays that I can improve on and get better at. That’s part of football. You’re never going to play a perfect game. I’m always trying to get better.”

Brian Hoyer strengthened his grasp on the 49ers’ starting job with an impressive training camp with his arm strength, accuracy, and knowledge and execution of Kyle Shanahan’s offense.

Beathard has saved his best performances for the two exhibition games with and against backup players. Beathard has completed 14 of 23 passes (60.9 percent) for 211 yards with three touchdowns and no interceptions. His passer rating is 130.6.

“There were a couple third downs I thought he missed, but it was hard to get anyone in a rhythm that game,” Shanahan said after the 49ers’ 33-14 loss to the Denver Broncos on Saturday. “I think under the circumstances, he did solid.”

Beathard, the grandson of long-time NFL executive Bobby Beathard, led Iowa to a 12-2 record as a junior. His production dropped as a senior, as he completed 56.5 percent of his attempts with 17 touchdowns and 10 interceptions in the Hawkeyes' pro-style offense.

He entered training camp at No. 3 on the depth chart. He and Barkley have been assigned the same number of practice snaps since the team reported to Santa Clara in late-July.

But Beathard has taken advantage of technology to get more and more comfortable in the 49ers’ offense. The 49ers are one of six NFL teams that use STRIVR Labs as an aide in training players via virtual reality. The tool is especially useful for quarterbacks with the camera stationed approximately 10 yards behind the quarterback.

The 49ers have two stations inside Levi’s Stadium with VR headsets, and Beathard has taken full advantage of the resource to train his eyes to read defenses and route progressions. One source told NBC Sports Bay Area that Beathard recently reviewed more than 1,000 practice plays in a week with the technology on his own time.

“You only get limited reps in practice, but you’re able to watch through virtual reality, essentially every rep in practice – all of Brian’s and Matt’s and go back and watch mine, and kind of play things out in your head as you watch practice,” Beathard said.

Beathard's pedigree, football smarts and toughness are what originally drew Shanahan to him before the draft.

Beathard’s toughness was on display in the first exhibition game, when he hung in to deliver a pass down the field to Kendrick Bourne just moments before taking a hit from a Kansas City defensive lineman. Bourne turned it into a 46-yard touchdown.

On Saturday, Beathard executed a convincing play-fake to running back Kapri Bibbs before rolling to his left and tossing to tight end George Kittle, his Iowa teammate. Kittle turned upfield, ran over one would-be tackler, stiff-armed another and managed to stay in-bounds en route to a 29-yard touchdown.

Kittle, who caught two touchdowns passes from Beathard against Nebraska in their final game together at Iowa’s Kinnick Stadium, is not surprised with how quickly Beathard has adapted in his first NFL training camp.

“He is the most competitive person I’ve ever met in my life,” Kittle said. “You’ve got a guy who just cares about football.”