One possibility is that the system does not use setFrame: to adjust the geometry of your view. It can use setCenter: and setBounds: Another possibility is that the system does not set the geometry of your view at all, and it is set only once in the [super initWithFrame:frame] call before adding a mask layer.
In any case, instead of overriding setFrame: you should override layoutSubviews :
- (void)layoutSubviews { [super layoutSubviews]; self.layer.mask.frame = self.bounds; }
source share