save file in iPhone

Download and Save File in iPhone by Swift

In a modern iPhone app, a smooth user experience is quite important. To achieve this, caching the internet resources to local is a good approach. Therefore, to make the app more smoothly when users open it, downloading images and videos and saving them locally will quite improve the app starting speed. In the last tutorial, I have demonstrated how to download files by Swift 5 and watch the download status such as progress. The downloading task is controlled by 3 buttons: a start button to start, a pause button to pause and resume, a stop button to stop. In this tutorial, I will show how to save the downloaded file in local and open it by default in the iPhone. The whole tutorial is developed under the latest Swift.

Read more
swift 5

Download File in Swift5 Start Pause and Resume

Several years ago, I post an article to demostrate how to implement download file features in iOS. In that article, I am using swift 2 to write all features including start, pause, resume and show progress. Lots of readers ask me to improve a new version with swift4 or swift5. As the language changes a lot, some of the APIs has been deprecated. That’s the reason why I write this artiel. In this article, I will use the latest version of Swift (current version is 5) to show you how to implement download file features.

Read more