Skip to content

Commit 7d8dc14

Browse files
authored
Update README.md
1 parent cc047bb commit 7d8dc14

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,19 @@ Then paste this URL:
3434
https://github.com/MMMagicCoder/SwiftNet.git
3535
```
3636

37+
## Usage
38+
<a id="usage"></a>
39+
`SwiftNet` provides a streamlined way to perform networking tasks. Whether you're fetching small data, downloading large files, or uploading content, you can choose between Escaping Closures, Combine, or async-await methods. To use these methods, instantiate the appropriate manager:
40+
- ```let networkManager = EscapingNetworkManager()``` for Escaping Closures.
41+
- ```let networkManager = CombineNetworkManager()``` for Combine.
42+
- ```let networkManager = AsyncNetworkManager()``` for async-await.
43+
44+
Below are examples for each type of task.
45+
46+
Fetching Data
47+
<a id="fetching-data"></a>
48+
49+
`SwiftNet` provides two types of data fetching: `JSON Fetching` and `Data Fetching`. For JSON fetching, your model must conform to the `FetchableModel` protocol, which ensures the proper structure for decoding JSON responses.
50+
51+
52+

0 commit comments

Comments
 (0)