Disable isUserInteractionEnabled or disable the button not work some cases, if have background API calling in next controller, push process will work asynchronously.
After some work around i thought its better to go with the other way, i found Completion handler in Objective-C or Closure in Swift can be good here.
Here is the example which i used in Objective c:
-(void)didSettingClick:(id) sender{ if (!isPushInProcess) { isPushInProcess = YES; SettingVC *settings = [[SettingVC alloc] initWithcomplition:^{ isPushInProcess = NO; }]; [self.navigationController pushViewController:settings animated:YES]; }}
Here is method description:
dispatch_block_t pushComplition;-(instancetype) initWithcomplition:(dispatch_block_t)complition{ self = [super init]; if (self) { pushComplition = complition; } return self;}
Inside viewDidAppear()
-(void)viewDidAppear:(BOOL)animated{ pushComplition();}
In swift using defer keyword is also can be good idea.
Hope It help!!!