override func viewWillAppear(_ animated: Bool) {
self.Scrollview.contentOffset = CGPoint(x: 0,y :0)
}
let documentsURL = try! FileManager().url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) let fooURL = documentsURL.appendingPathComponent("foo.html") let fileExists = FileManager().fileExists(atPath: fooURL.path) if fileExists==true { print("already existed") } else { print("no file") }
https://stackoverflow.com/questions/1638834/how-to-check-if-a-file-exists-in-documents-folder
webView.scalesPageToFit=YES;
programmaticallyclick the check box "Scaling" scales Page to fit
let tapRecognizer = UITapGestureRecognizer()
tapRecognizer.addTarget(self, action: #selector(ViewController.didTapView))
self.view.addGestureRecognizer(tapRecognizer)
}func didTapView(){
self.view.endEditing(true)
}
navigationController ?. navigationBar . setBackgroundImage ( UIImage (), for: . any , barMetrics: . default ) navigat...