Barack Obama believes Scotland has "a lot to offer the world'' and promised to return after his first visit to the country.
Apple boss hits out at Trump during Scotland visit
Apple chief executive Tim Cook has reiterated his opposition to US President Donald Trump's travel ban, saying "if we stand and say nothing it's as if we're agreeing''.
Mr Cook spoke after collecting an honorary doctorate of science from the University of Glasgow on Wednesday evening.
During a Q&A with students and university staff he was asked for his response to Mr Trump's order targeting people from seven predominantly Muslim countries.
Mr Cook said: "I wrote this letter, you probably read about it unless you're living underground, about the most recent executive order that was issued in the US.
"We have employees that secured a work visa, they brought family to the US, but happened to be outside the US when the executive order was issued and all of a sudden their families were affected. They couldn't get back in.
"That's a crisis. You can imagine the stress.
"If we stand and say nothing it's as if we're agreeing, that we become a part of it.
"It's important to speak out.''
Mr Cook said Apple relied on workers from around the world, telling students and staff: "Steve (Jobs) was the son of an immigrant.
"It's a subject we're passionate about and we wanted to state our pain and try to end the dispute.''
He went on to say he understands issues of security, but added: "I don't believe you have to trade walking away from what is a deeply held American value to get there.''
Issues of privacy and surveillance were also topics of conversation at the university, whose students elected Edward Snowden, the US National Security Agency whistleblower, as rector in 2014.
Mr Cook was asked if he saw his company as an "activist''.
He replied: ``We're not shy. Last year we came to loggerheads with the US government about privacy and security.
"It wasn't that we were being activists, it was that we were being asked to do something that we knew was wrong.
"So we had a choice, to either blindly do what the institutions said to do or to fight and we chose to fight.''
Giving advice to students coming to the end of their university studies, Mr Cook told them to ignore negativity.
"The world is full of cynics and you have to tune them out, because if not they become a cancer in your mind and you begin to think that you can't or that life is negative,'' the 56-year-old said.
"The truth is, and it might not seem like it all the time, but there has never been a better time to be alive than today.''
To laughter, he added: "That is my advice ... with no charge.''
Mr Cook had earlier made a surprise visit to company staff in Glasgow.
He dropped in to the Buchanan Street store on Wednesday afternoon, where work stopped for around 15 minutes as staff and customers greeted him and took photographs.
Before leaving, he was presented with two gifts - a tartan scarf and an embroidered picture.
He said he loved the scarf but asked: "How are you supposed to fold this?''
The embroidered picture shows Mr Cook waving and the words: "Welcome Tim.''
It also features saltire flags and the Loch Ness monster.
He joked: "That's great. I recall looking for the Loch Ness monster in 1984.
"Everything is right but the colour of the hair.''
Since taking the helm of the company, Mr Cook has led the introduction of new products such as the iPhone 7, iPad Pro and Apple Watch.
He is also leading a company-wide effort to use 100% renewable energy at all Apple facilities.
In 2015, Mr Cook became an honorary patron of Trinity College Dublin's Philosophical Society and gave a talk to students.
Fans attending the Scottish Cup Final have been warned to expect delays before the match as security is increased following the attack in Manchester.
Torrential thundery downpours are set to descend on Britain over the bank holiday weekend, bringing an end to the spell of summery weather.
The family of Manchester bomb victim Eilidh MacLeod have said they are praying that her injured friend makes a full recovery.
Most Viewed Pictures On Heart
Recently Played Tracks
To listen live, choose your preferred station:
Now playing: The best feel good music
Now playing: The best feel good music
Deposit £10 to get a £40 Welcome Bonus - That's £50 to play bingo, slots and more!*
Over 50 tracks to make you feel-good. New album out now...
Find your local four day weather report here.
Make Heart the soundtrack to your day and you could be a winner with great prizes up for grabs throughout the day.
Find out more about some of the companies advertising on Heart Scotland- East.