The 21-year-old, who joined the Magpies from West Ham in January, has linked up with the Championship side ahead of the start of the campaign and will spend the entirety of 2022/24 at the Swansea.com Stadium.
Ashby has featured for Eddie Howe's side during pre-season, scoring his first goal for the club in the 2-1 victory at Rangers in Allan McGregor's testimonial match last month, but is yet to make his competitive bow for United.
After making the move from the Hammers last term he made two appearances for the Magpies' under-21s, scoring once, and has also appeared for his former club in the Premier League, Europa League and Europa Conference League.
Ashby could make his debut for the Swans when they kick off their Championship campaign at home to Birmingham City on Saturday afternoon.