In the iOS mail app if you go to inbox and swipe over an item the archive button gets revealed from right to left (and the way around when is disappears). I'm trying to get this behaviour in my app, the way I approached this is animating the mask layer of a button and moving it from right to left. The issue I'm having here is that once the animation ends the button disappears.
//Create Mask Layer
CALayer *maskLayer = [CALayer layer];
maskLayer.frame = CGRectMake(cell.deleteButton.frame.size.width,0,cell.deleteButton.frame.size.width,cell.deleteButton.frame.size.height);
maskLayer.backgroundColor = [UIColor whiteColor].CGColor;
cell.deleteButton.layer.mask = maskLayer;
// Setting the animation
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position.x"];
animation.byValue = [NSNumber numberWithFloat:-cell.deleteButton.frame.size.width];
animation.duration = 0.4f;
[cell.deleteButton.layer.mask addAnimation:animation forKey:@"maskAnimation"];
So I wonder how to get the button not to disappear after the animation or if there is a better way to create the animation.