objective c - How to Subclass UICollectionViewFlowLayout with Storyboard -
objective c - How to Subclass UICollectionViewFlowLayout with Storyboard -
i'm using uicollectionview storyboard , trying subclass uicollectionviewflowlayout doesn't seem work.
i've created subclass collectionviewflowlayout :
#import "collectionviewflowlayout.h" @implementation collectionviewflowlayout -(id)init { nslog(@"init of collectionviewflowlayout"); if (!(self = [super init])) homecoming nil; self.itemsize = cgsizemake(250, 250); homecoming self; } @end and in storyboard's identity inspector changed class flow layout:
but when save/build/run, itemsize not set @ 250 , nslog isn't beingness output.
i've seen in examples such this can set layout in collectionview controller, sort of assumed wasn't necessary if set in storyboard.
objects loaded storyboard utilize initwithcoder:, not init. move setup code there instead, or have mutual method called each initialiser.
objective-c xcode uistoryboard uicollectionview uicollectionviewlayout
Comments
Post a Comment