===Network===
----
====URLからデータを取得=====
<pre>
let url = URL(string: "https://www.typea.info/blog/")!
let session = URLSession(configuration: .default)
let task = session.dataTask(with: url){data, response, error in
guard error == nil else {
return
}
if let httpResponse = response as? HTTPURLResponse {
guard httpResponse.statusCode == 200 else {
return
}
if let recieveData = data {
if let text = String(bytes: recieveData, encoding: .utf8) {
print(text)
}
}
}
}
task.resume()
</pre>
====[https://developer.apple.com/bonjour/ Bonjour]====
----