With Xcode 6 and iOS8 I have strange issue in my app. The problem is in my custom UITableViewCell which I made with xib file. On iOS8 simulator layoutSubviews method get called infinite number of times. Like it is in "while(1)" or calls itself again and again. This is layout subviews method:
- (void)layoutSubviews
{
[super layoutSubviews];
UIEdgeInsets insets = UIEdgeInsetsMake(1, 1, 1, 1);
self.contentView.frame = UIEdgeInsetsInsetRect(UIEdgeInsetsInsetRect(self.bounds, insets), insets);
NSLog(@"Layout");
}
When I remove self.contentView.frame line, everything is OK. Also if I make self.contentView.translatesAutoresizingMaskIntoConstraints = NO, recursion stops, but it breaks all my constraints. This issue happens only in iOS8, the same method works fine in iOS6 and iOS7.
Why can't I change self.contentView.frame in this method? Is there new documentation about it?