Просмотр исходного кода

Fix example in Usage.md to use AF namespace (#3955)

### Goals :soccer:
<!-- List the high-level objectives of this pull request. -->
<!-- Include any relevant context. -->

- Replaced the deprecated `Alamofire.request(...)` with
`AF.request(...)` in
[Usage.md](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md)
for consistency with Alamofire 5+ API style, and to match the
explanation provided in the ["AF
Namespace"](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#aside-the-af-namespace-and-reference)
section.
- This change helps keep the documentation up-to-date and avoids
potential confusion for new users.

### Implementation Details :construction:
<!-- Explain the reasoning behind any architectural changes. -->
<!-- Highlight any new functionality. -->

Updated the code example in the [“Chained Response
Handlers”](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#chained-response-handlers)
section:

**Before**

```swift
Alamofire.request("https://httpbin.org/get")
  .responseString { response in
      print("Response String: \(response.value)")
  }
  .responseDecodable(of: DecodableType.self) { response in
      print("Response DecodableType: \(response.value)")
  }
```

**After**

```swift
AF.request("https://httpbin.org/get")
  .responseString { response in
      print("Response String: \(response.value)")
  }
  .responseDecodable(of: DecodableType.self) { response in
      print("Response DecodableType: \(response.value)")
  }
```

### Testing Details :mag:
<!-- Describe what tests you've added for your changes. -->

No testing is required as this change is limited to documentation.
김영빈 (Rei) 6 месяцев назад
Родитель
Сommit
46249e0168
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Documentation/Usage.md

+ 1 - 1
Documentation/Usage.md

@@ -604,7 +604,7 @@ AF.request("https://httpbin.org/get").responseDecodable(of: DecodableType.self)
 Response handlers can also be chained:
 
 ```swift
-Alamofire.request("https://httpbin.org/get")
+AF.request("https://httpbin.org/get")
     .responseString { response in
         print("Response String: \(response.value)")
     }