ios - traitCollectionDidChange: Called even I dont have any changes -
do know why traitcollectiondidchange
called no size class changes.
selecting uilabel, have in storyboard attribute inspector / installed check uilabel. no special cases installing according size class.
therefore dont understand why traitcollectiondidchange
called when rotate device?
yes, called after viewdidlod, every time rotate device/ emulator.
if wanted react rotation use viewwilltransitiontosize
.
update: hmm, re-thinking this. guess size class changing when rotate iphone.
can think of traitcollectiondidchange specialised method of viewwilltransitiontosize - facilitating thresholds telling when crossing size class boundaries?
the size class change if rotate iphone, won't change if rotate ipad (which has regular size class both horizontally , vertically).
rotation considered change in interface environment, therefore traitcollectiondidchange
called.
Comments
Post a Comment