title: How can I mask a UIImageView?
body: <p>I am trying to mask an image with something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/0PeR9.png" alt="image to be masked"></p>
  
  <p>Would you please help me? </p>
  
  <p>I am using this code:</p>
  
  <pre><code>- (void) viewDidLoad {
      UIImage *OrigImage = [UIImage imageNamed:@"dogs.png"];
      UIImage *mask = [UIImage imageNamed:@"mask.png"];
      UIImage *maskedImage = [self maskImage:OrigImage withMask:mask];
      myUIIMage.image = maskedImage;
  }
  </code></pre>