0
我有一个webview html5
页面does not work in ios 10
我不加载用户位置,在ios9及以下工作的应用程序。我没有在ios10的safari上找到我的位置http://html5demos.com/geo,我尝试了3种不同的手机,我是否错过了或为ios 10做了些改变?见下文ios 10 webview xcode swift geolocation
import UIKit
import CoreLocation
class ViewController: UIViewController, CLLocationManagerDelegate {
let locationManager = CLLocationManager()
@IBOutlet weak var webview: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
self.locationManager.delegate = self
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
self.locationManager.requestWhenInUseAuthorization()
self.locationManager.startUpdatingLocation()
let url = NSURL (string: "http://html5demos.com/geo");
let requestObj = NSURLRequest(url: url! as URL);
webview.loadRequest(requestObj as URLRequest);
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
嘿科里,你有没有解决这个问题? – MattJHoughton