How do you get the user agent from Safari, in Xcode using Swift?

I need to get the user agent of safari during run-time on my app.


How do you get the user agent from Safari, in Xcode using Swift?
 
 
Q