ios - Can I keep UI elements accessable while changing background color in Xcode? -


i have game in xcode several uibuttons on white background. when user clicks correct buttons, i'm changing background white blue-green (animated). i'd allow user keep clicking, while background colors change, looks buttons not accessible until bg color animation done running. there way resolve , keep focus on buttons? can background animation happen in background, independent of rest of game?

thanks in advance understanding this. here code:

[uiview animatewithduration:0.3f animations:^{ self.view.backgroundcolor = [uicolor colorwithred:0.1f green:0.15f blue:0.05f alpha:1.0f]; } completion:^(bool finished){ [uiview animatewithduration:0.3f animations:^{ self.view.backgroundcolor = [uicolor colorwithred:1.0f green:1.0 blue:1.0 alpha:1.0f]; } ]; } ]; 

all uibuttons added in separate method earlier

uibutton *btni; [self.view addsubview:btni]; 

you can use animation method options:

+ animatewithduration:delay:options:animations:completion: 

with uiviewanimationoptionallowuserinteraction option.

from documentation:

if want users able interact views, include   uiviewanimationoptionallowuserinteraction constant in options parameter. 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -