One of AIS’s recent projects involved development of an iPhone application using MonoTouch. This application made significant use of web services, some of which could take 10’s of seconds to return (Yes, we were moving a lot of data for this particular application… there is just no easy way to deal with “historical data”).
Rather than just locking the UI for the duration of the activity, we wanted to display a user notification that something was actually happening in the background. In addition, we wanted to disable the UI so the user did not inadvertently believe they could tap anything.
Our goals:
1. Display a “long running operation” notification to the user
2. Lock the primary UI to prevent unwanted unexpected user interactions
3. The component must be reusable
To accomplish this feat of programming, we decided to use a UIAlertView with a UIActivityIndicatorView on it. We created the ActivityAlertView class to manage this for us. It allows you to use it in one of 2 ways:
- In a using statement. This will display the ActivityAlertView for the duration that the using statement is in scope:
- Normal instantiation
using(ActivityAlertView alert
= new ActivityAlertView("Logging in, Please wait"))
{
//Code to do while ActivityAlertView is displayed to user
}
ActivityAlertView alert = new ActivityAlertView;
alert.Show("Logging in, Please wait");
//Code to do while ActivityAlertView is displayed to user
alert.Dismiss();
Here are a few screenshots of the attached demo project.
Download the sample project and source code from this link
Hello,
i cannot open the tar.gz, is there a way to get the demo in a .zip file?
Regards,
Dirk
Dirk,
I’ll go bug the developer and see if he can’t provider a .ZIP version. As he is a a Mac guy, it may take some arm twisting…
Hi Dave
I also cannot open the tar file – even on a mac. I think the file is corrupt.
Would you mind mailing it to me?
Cant extract / open the file on my mac 🙁
Yup, the tarball is corrupted.
We are flogging the developer to go create another tarball so we can get it posted.