First Minister John Swinney thanked Nicola Sturgeon for her contribution to public life.