Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collection view controller's viewDidLayoutSubviews is being called repeatedly in iOS 7

I have a collection view controller with a vertical flow layout, which has some custom layout attributes to warp it into a semicircle, but is otherwise fairly normal. Under iOS 6, viewDidLayoutSubviews is called precisely twice, once when the view is initialised, and again after it has got its data. But under iOS 7, it is then getting called repeatedly whenever the collection view scrolls, whether with finger down or under its own momentum. It looks like it could be once per didscroll. Does anybody know the reason why this might be happening in 7?

like image 206
Danyal Aytekin Avatar asked Nov 30 '25 08:11

Danyal Aytekin


1 Answers

Ok so according to this post by nickman55 on the Apple forums, viewDidLayoutSubviews is called in iOS 7 whenever a collection view cell is reused. https://devforums.apple.com/message/874718#874718

like image 106
Danyal Aytekin Avatar answered Dec 02 '25 23:12

Danyal Aytekin