- (void)popTitleView:(UIButton *)btn
{
if (popView.superview ==self.view) {
CATransition *animation =[CATransition animation];
animation.delegate=self;
animation.duration=0.3;
animation.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.type=kCATransitionPush;
animation.subtype=kCATransitionFromTop;
[popView setAlpha:0.0f];
[popView.layer addAnimation:animation forKey:@"TSLocateView"];
[popView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.3];
}else{
CATransition *animation =[CATransition animation];
animation.delegate=self;
animation.duration=0.3;
animation.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.type=kCATransitionPush;
animation.subtype=kCATransitionFromBottom;
[popView setAlpha:1.0f];
[popView.layer addAnimation:animation forKey:@"pushIn"];
[self.view addSubview:popView];
}
}