How to: 怎样做? 下载文本内容 import Foundation let url = URL(string: "https://www.example.com")! let task = URLSession.shared.dataTask(with: url) { data, response, error in if let error = error { print("错误: (error)") } else if let data = data, let string = String(data: data, encoding: .utf8) { print(string) } } task.resume() 示