Save and Load Downloaded File Locally

My Download Manager app is a real project which will manage download tasks. It allow users to start download a file, pause or resume the download task, and stop a download task. In tutorial 1, I already show you all the basic functions, such as starting a download, pause, resume and stop it. However, these basic functions are really not enough. For example, if I pause the download task and quit the app, the app will lose all downloaded data.

The only solution for that is saving the downloaded data into iOS device locally when we pause the download data. So we will not lose the data even we quit the app. If we want to resume the download task, we can load the data from where we store it locally and continue to download the rest of it.

Read more

Download File in iOS Start Pause and Resume

Downloading files is a common task in most of the iOS app. If you are building an ebook reader, or a comic book reader app, downloading ebooks will be a necessary feature. Last time, I am using a news reader app which will download the pdf newspaper from their website. This feature is also built in music player apps to download mp3 file, video player apps to download video file, even in the wallpaper apps to download wallpapers.
Read more

XIB vs Storyboard, Which Shall I Choose in iOS Project

xib is the common way to build UI in Xcode. After Xcode 5.5, Apple introduced a new concept, storyboard. The purpose is to provide a better way to make UI simple and easy to manage. If you like, you can still use xib as your default UI editor.

When you are using xib, each UIViewController will bind with a xib. But in Storyboard, all your app screens are put together. You can use graphic interface to connect them with segues. Each way has its own pros and cons.
Read more

Set UIWebView Content not to Scroll When Keyboard is Shown

This week, I have met a problem when I am developing a hybrid app with Cordova (Phonegap). The Cordova app is basing on UIWebView. So the whole app is build by HTML5, Javascript and CSS. Usually, UIWebView will scroll up when keyboard is shown if we click an input field or textfield focus. Therefore, all content in the UIWebView is pushing up. In most of the case, this behavior is correct. However, in my case, it becomes to be a problem. And I have to prevent UIWebView to scroll when keyboard appears.
Read more