I am trying to use drawRect to draw a rectangle in the space below a collectionView contained in another view (self in the code below) using the frames of both views to define the rectangle.
This code works fine until the device orientation changes. Everything I have tried calls drawRect before the animated rotation begins. This means the collectionView.frame and self.frame have not yet been adjusted by autoLayout and the resulting rectangle is wrong.
CGRect frame = self.collectionViwOutlet.frame;
CGFloat x = frame.origin.x;
CGFloat y = frame.origin.y + frame.size.height + 8;
CGFloat w = frame.size.width;
CGFloat h = self.frame.origin.y + self.frame.size.height - y - 8;
CGRect drawableRect = CGRectMake(x, y, w, h);
Any suggestions would be appreciated.