I am trying to develop an App for the School I work at. I am trying to set up several buttons that send users to a specific webpage.
Here's my code for one of the buttons... It doesn't link to the webpage. In the simulator it sends me to the home screen, or sometimes it sends me back into xcode... (I think because it just shuts the simulator down? ) Please help.
import UIKit
class ViewController: UIViewController {
@IBAction func Registrar(sender: AnyObject) {
if let url = NSURL(string: "http://www.ajusd.org") {
UIApplication.shared.open(url as URL, options:[:], completionHandler:nil)
}
}
override func viewDidLoad() {
super.viewDidLoad()
/
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
/
}
}