title: Create an mask on an UIView to colorise all UIImageView subviews in black and white
body: <p>I have an UIView which contains UIImagesViews with images loaded from a remote server.</p>
  
  <p>The images loaded from the server are in color.</p>
  
  <p>I would like create a mask on my UIView which put in black and white all its contents including the images. </p>
  
  <p>But I don't want to have to put the mask on each picture when they are ready.</p>
  
  <p>I tried to create a subclass of <code>UIView</code> :</p>
  
  <pre><code>@interface FriezeView : UIView
  
  @property (nonatomic, strong) UIView *mask;
  @property (nonatomic, strong) UIView *container;
  
  @end
  </code></pre>
  
  <p>The init method of this class:</p>
  
  <pre><code>- (id)initWithFrame:(CGRect)frame
  {
      if ((self = [super initWithFrame:frame]))
      {
          self.container = [[UIView alloc] initWithFrame:frame];
          self.mask = [[UIView alloc] initWithFrame:frame];
  
          [self addSubview:self.container];
          [self addSubview:self.mask];
      }
  
      return self;
  }
  </code></pre>
  
  <p>Then I use the <code>mask</code> UIView to colorise the <code>container</code> UIView.</p>
  
  <pre><code>[_frieze.container addSubview:myImageView];
  
  _frieze.mask.layer.backgroundColor = [[UIColor grayColor] CGColor];
  _frieze.mask.backgroundColor = [UIColor grayColor];
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>Any suggestions ? </p>