I want add image into the center of the cell image.I have cell image so if the cell is a video then i want to add a play icon in center of the cell image.I have tried following code but this does not work.please tell me how can i solve this?

```
  if([user_post.post_image isEqualToString:@"none"])
        {
            [cell.img_post_thumbnail setImageWithURL:[NSURL URLWithString:[IMAGE_BASE_URL stringByAppendingString:user_post.post_video_thumbnail]] placeholderImage:[UIImage imageNamed:@"post_placeholder.png"]];
            CGPoint centerImageView = cell.img_post_thumbnail.center;
            centerImageView.x = self.view.center.x;
            centerImageView.y = self.view.center.y;

            UIImageView *playIcon=[[UIImageView alloc]initWithFrame:CGRectMake(centerImageView.x, centerImageView.y,20,20)];
            playIcon.image=[UIImage imageNamed:@"play_icon.png"];
            [cell.img_post_thumbnail addSubview:playIcon];

        }

```

**Edit:**
 Image is centred but not scaled as per size given.

```
[cell.img_post_thumbnail setImageWithURL:[NSURL URLWithString:[IMAGE_BASE_URL stringByAppendingString:user_post.post_video_thumbnail]] placeholderImage:[UIImage imageNamed:@"post_placeholder.png"]];

float btn_width = cell.frame.size.width * (5/ 320.0);
float btn_height = cell.frame.size.height * (5 / 568.0);

UIImageView *playIcon=[[UIImageView alloc]initWithFrame:CGRectMake(10, 10,btn_width,btn_height)];
playIcon.image=[UIImage imageNamed:@"play_icon.png"];
playIcon.translatesAutoresizingMaskIntoConstraints = NO;
[cell.img_post_thumbnail addSubview:playIcon];

float btn_selfRatio=(btn_width/btn_height);
float btn_superRatio=(btn_width/playIcon.frame.size.height);

[playIcon addConstraint:[NSLayoutConstraint constraintWithItem:playIcon attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:playIcon attribute:NSLayoutAttributeHeight multiplier:btn_selfRatio constant:0]];

[cell.img_post_thumbnail addConstraint:[NSLayoutConstraint constraintWithItem:playIcon attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:cell.img_post_thumbnail attribute:NSLayoutAttributeHeight multiplier:btn_superRatio constant:0]];

[[cell img_post_thumbnail] addConstraint:
 [NSLayoutConstraint constraintWithItem:playIcon
                              attribute:NSLayoutAttributeCenterX
                              relatedBy:NSLayoutRelationEqual
                                 toItem:[cell img_post_thumbnail]
                              attribute:NSLayoutAttributeCenterX
                             multiplier:1.0
                               constant:0.0]];

[[cell img_post_thumbnail] addConstraint:
 [NSLayoutConstraint constraintWithItem:playIcon
                              attribute:NSLayoutAttributeCenterY
                              relatedBy:NSLayoutRelationEqual
                                 toItem:[cell img_post_thumbnail]
                              attribute:NSLayoutAttributeCenterY
                             multiplier:1.0
                               constant:0.0]];

```