我在Swift中制作了一个webview&在该webview中,有链接到webview的同一域中的ics文件。现在,当您在Safari中单击此链接时,您可以完美地将其添加到您的日历中,但是当我在iOS模拟器或我的设备上尝试此操作时,我无法打开' ICS文件链接。 知道我做错了什么吗?谢谢! 这是我的代码:
import UIKit
class FirstViewController: UIViewController {
@IBOutlet weak var webAgenda: UIWebView!
@IBOutlet weak var activityagenda: UIActivityIndicatorView!
var url = "http://******.be/agenda.php"
func loadURL () {
let requestURL = NSURL(string: url)
let request = NSURLRequest(URL: requestURL!)
webAgenda.loadRequest(request)
}
override func viewDidLoad() {
super.viewDidLoad()
loadURL()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func webViewDidStartLoad(webView: UIWebView) {
activityagenda.hidden = false
activityagenda.startAnimating()
}
func webViewDidFinishLoad(webView: UIWebView) {
activityagenda.hidden = true
activityagenda.stopAnimating()
}