ios - How to trigger IBAction from UIButton in Storyboard static cell? -
i have storyboard uitableviewcontroller. in controller, have static cells 1 of them subclass of uitableviewcell. in ib added uibutton static cell , connected ibaction in uitableviewcell subclass. however, ibaction never called. why doesn't work? how can achieve desired behaviour button inside cell triggers event through ib?
.h
#import <uikit/uikit.h> @interface bsworkoutscell : uitableviewcell @property (nonatomic, weak) iboutlet uibutton *button; @property (nonatomic, strong) iboutletcollection(uibutton) nsarray *buttons; - (ibaction)tapbutton:(id)sender; @end .m
- (ibaction)tapbutton:(id)sender{ if (!_buttonshidden){ [self animatehidebuttons:(uibutton *)sender]; _buttonshidden = yes; } } images


i realised uitableviewcell had user interaction enabled unchecked in ib. made subviews inside not interactive, buttons not being pressed, , ibaction not being called.
once checked box, worked fine.
Comments
Post a Comment