Why don't you just set userInteractionEnabled
to false for the button?
btn.userInteractionEnabled = NO;
and return it to YES after completing the login?
You can set this property for each sensitive user interface element in the view that you want to disable.
BTW
This curse dose does not stop you from showing an activity indicator.
As always, I like to recommend MBProgressHUD
EDIT If you get ARC errors, do the following:
- Choose a target
- Locate the MBProgressHud.m file under Phase Assembling → Compile Sources
- add
-fno-objc-arc
to the compiler flags of the MBProgressHud.m file.
This will launch xCode so as not to compile this file using ARC.
source share