UIGraphicsBeginImageContext(self.bounds.size);
[self.layerrenderInContext:UIGraphicsGetCurrentContext()];
UIImage *cardImage = UIGraphicsGetImageFromCurrentImageContext();
if (self.card == nil) {
self.card = [[UIImageView alloc] initWithImage:cardImage];
}
else
{
self.card.image = cardImage;
}
}
self.card.center = [touch locationInView:self];
[self addSubview:self.card];
UIGraphicsEndImageContext();
self.layer.contents = nil;