The £55m school was delivered by Morrison Construction and designers Ryder Architecture, alongside development partners hub North Scotland and Shetland Island Council.
As part of the ceremony to celebrate the event, Mr Swinney unveiled a plaque placed in a 2.7m-high commemorative cairn outside the school, which also incorporates the original foundation stone.
Construction of the project began in August 2015 and was completed on schedule with staff and pupils relocating to their new school in October 2017. The project continues to be the largest standalone schools project across the whole of Galliford Try.
The five-storey school features more than 300 rooms and has capacity for 1,180 pupils, while the new halls of residence have capacity for 100 residents and provide accommodation for pupils from the outer isles of Shetland.
Morrison Construction, Managing Director of Building Highland, Donald Mclachlan, said: ‘‘It was wonderful to have the Deputy First Minister visit the new Anderson High School and Halls of Residence and meet pupils and teachers who have been enjoying the state-of-the-art facilities since moving in last year.
‘‘We are very proud to have delivered this project that directly benefitted the community by supporting eight apprentices, three graduates and creating 60 new local jobs during construction.’’