0

After programmatically applying constraints to a view, I'm finding it difficult to use that view's frame - all values are zero.

I know that I can implement frame-dependent code in the view controller via viewDidLayoutSubviews - within that method, the frame has been set. But I'd rather not use a view controller for what I'm trying to do. Is there a similar method that fires in UIView? Or a notification? Something must call viewDidLayoutSubviews...

I've found related answers (best one here), but haven't been able to find an answer to this specific question.

Community
  • 1
  • 1
shmim
  • 729
  • 9
  • 21
  • In what method are you trying to access the view's frame? – rdelmar Apr 12 '14 at 02:05
  • 1
    Have you tried `layoutSubviews`? – architectpianist Apr 12 '14 at 03:50
  • Yeah, I guess layoutSubviews is the guy... I was hoping to get a sort of notification when a view's frame was available - so I could know from outside the view. But I could always implement that by overriding layoutSubviews and sending a notification, then calling [super layouSubviews]; Thanks for the replies! – shmim Apr 18 '14 at 21:03

0 Answers0