ios - animation completion called immediately completion -
i confused lot .
this condition normal when value yes animation action . state when no value completion called immediately.
i not know if there difference between 2 .
- (void)setdimview : (uiview*)targetview state:(bool)state { cgrect screenrect = [[uiscreen mainscreen] bounds]; uiview *dim = [[uiview alloc]initwithframe:screenrect]; dim.tag = tag; if (state) { dim.alpha = 0.0; } [uiview transitionwithview:dim duration:0.5 options:uiviewanimationoptioncurveeaseout animations:^ { if (state) { [targetview sethidden:no]; [targetview addsubview:dim]; dim.backgroundcolor = [uicolor blackcolor]; dim.alpha = 0.6; } else { dim.alpha = 0.0; } }completion:^(bool finished) { if (!state) { (uiview *subview in [targetview subviews]) { if (subview.tag == tag) { [subview removefromsuperview]; [targetview sethidden:yes]; } } } }]; }
this block working sequence first called animation block , completion block, if set animation no call completion.
i not getting why confused it?
Comments
Post a Comment