Created
December 30, 2015 02:51
-
-
Save felipegenuino/5ed42e5102fc7c328d7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// baixando-conteudo-da-web | |
// | |
// Created by Felipe Genuino on 29/12/15. | |
// Copyright © 2015 Felipe Genuino. All rights reserved. | |
// | |
import UIKit | |
class ViewController: UIViewController { | |
//precisa criar um webview e arrastar para o storyboard | |
@IBOutlet var webView: UIWebView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let url = NSURL(string: "http://maisengenharia.altoqi.com.br/")! | |
webView.loadRequest(NSURLRequest(URL: url)) | |
/* | |
let task = NSURLSession.sharedSession().dataTaskWithURL(url) { (data, response, error) -> Void in | |
if let urlContent = data { | |
let webContent = NSString(data: urlContent, encoding: NSUTF8StringEncoding) | |
dispatch_async(dispatch_get_main_queue(), { () -> Void in | |
self.webView.loadHTMLString(String(webContent), baseURL: nil) | |
}) | |
}else{ | |
} | |
} | |
task.resume() | |
*/ | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment