-
-
Save fitomad/4952088e0bb15ecaa515d6f76b90ed4c 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
/* | |
Usad siempre el inicializador init(contentsOf:encoding:) en lugar | |
de init(contentsOf:). | |
Parece que si no especificas una codificación no funciona. | |
*/ | |
import Foundation | |
if let url = URL(string: "http://desappstre.com"), let html = try? String(contentsOf: url, encoding: .utf8) | |
{ | |
print(html) | |
} | |
/* | |
<html> | |
<head> | |
<title>desappstre {eStudio}</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css"> | |
<link href="style/skeleton.css" rel="stylesheet" type="text/css" media="screen"> | |
<link href="style/desappstre.css" rel="stylesheet" type="text/css" media="screen"> | |
... | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment