title: How to change a rectangle's position and size realtime?
body: <p>I want to draw an  rectangle and  can change the rectangle's position and size realtime.</p>
  
  <p>I have tried following two methods, but the view don't show the rectangle.</p>
  
  <p>do you have any advice or example?</p>
  
  <p>appreciate your help.</p>
  
  <p><strong>use view frame</strong> (it only show the new rectangle when restart the app)</p>
  
  <pre><code>UIView * drawView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 10, 10)];
  [self.view addSubview:drawView];
  drawView.layer.borderColor = [[UIColor orangeColor] CGColor];
  drawView.layer.borderWidth = 2;
  
  drawView.frame = CGRectMake(r.x, r.y, r.width, r.height);
  </code></pre>
  
  <p><strong>draw in the drawRect</strong></p>
  
  <pre><code>fav = [[FaceAugmentingView alloc] initWithFrame:[imageView frame]];
  fav.backgroundColor = [UIColor clearColor];
  [self.view addSubview: fav  ];
  fav.face = CGRectMake(r.x, r.y, r.width, r.height);
  [fav setNeedsDisplay];
  </code></pre>