What are the little-known features of Swift
This article mainly explains "what are the little-known characteristics of Swift". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the little-known characteristics of Swift".
Consider a common situation where you want to initiate a network request and type out data without encountering any errors, so create a URLSessionDataTask, as follows:
Let task = URLSession.shared.dataTask (with: URL (string: "https://google.com")!) {(data,response, error) in guardlet datadata = data, let responseresponse = response as? HTTPURLResponse, (200..