import UIKit
class ViewController: UIViewController {
@IBOutlet var WebView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
do {
let url = NSURL (string: "http://www.domain.com/")
try NSFileManager.defaultManager().addSkipBackupAttributeToItemAtURL(url!)
WebView.loadRequest(NSURLRequest(URL: url!))
} catch {
// Handle error here
print("Error: \(error)")
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func prefersStatusBarHidden() -> Bool {
return true;
}
}
extension NSFileManager{
func addSkipBackupAttributeToItemAtURL(url:NSURL) throws {
try url.setResourceValue(true, forKey: NSURLIsExcludedFromBackupKey)
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.