Button with link to a site

0

Could they help me make a button with a link to a website? It is an application for iPhone and I wanted the button to open the site in Safari (for example).

    
asked by anonymous 03.07.2015 / 10:33

1 answer

0

The function for this is openURL , an example:


@IBAction func WebLink(sender: AnyObject) {
    if let url = NSURL(string: "http://...") {
        UIApplication.sharedApplication().openURL(url)
    }
}
    
03.07.2015 / 13:27