If you simply implement the download function, then it is OK to request some resources from the server and get them directly. It can be implemented from AFNetwork. But general downloads have some additional processing, such as breakpoint resuming and so on. Then you have to add the request header Set additional request information such as range etag. In addition, the download is returned from the network thread, so the synchronization problem between the returned data and the data written to the file needs to be processed. It is recommended that the returned data be written into NSOutputStream and then used to write the file using NSOutputeStream.
If you simply implement the download function, then it is OK to request some resources from the server and get them directly.
It can be implemented from AFNetwork.
But general downloads have some additional processing, such as breakpoint resuming and so on.
Then you have to add the request header Set additional request information such as range etag.
In addition, the download is returned from the network thread, so the synchronization problem between the returned data and the data written to the file needs to be processed.
It is recommended that the returned data be written into NSOutputStream and then used to write the file using NSOutputeStream.