ios - UIView transitionWithView animating property change: slide in from right? -
i have readonly uitextview, , i'm updating text. when new text appears, want animate follows: new text slides in right, old text slides offscreen toward left side.
is possible transitionwithview? if not, what's best way it? can make crossdissolve, that's not animation i'm looking for:
[uiview transitionwithview:self.storytextview duration:0.5 options:uiviewanimationoptiontransitioncrossdissolve animations:^{ [self.storytextview settext:withstory.storytext]; } completion:nil];
the reason insisting on right left animation because want user able trigger swiping toward left on uitextview.
catransition
allow this, transition type of 'push' , subtype of 'from right'. it's straightforward use:
catransition *transition = [catransition new]; transition.type = kcatransitionpush; transition.subtype = kcatransitionfromright; // make view changes self.textview.text = newtext; // add transition [self.textview.layer addanimation:transition forkey:@"transition"];
note this, while it's you've asked for, won't fit nicely gesture without tinkering - tie gesture you'd need set layer speed 0 , manually update progress of animation match gesture.
Comments
Post a Comment