I have this code should modify the colors of 24 buttons, connected to a IBoutletCollection :
In .h File:
@property (nonatomic, strong) IBOutletCollection(UIButton) NSArray *buttons;
In .m File:
for (UIButton *label in buttons) {
label.layer.borderWidth = 1.5f;
label.layer.borderColor = (__bridge CGColorRef)([UIColor colorWithRed:87.0/255.0 green:49.0/255.0 blue:42.0/255.0 alpha:1]);
label.layer.backgroundColor = (__bridge CGColorRef)([UIColor colorWithRed:134.0/255.0 green:98.0/255.0 blue:98.0/255.0 alpha:1]);
}
The IBOutletCollection's connected to the existing 24 buttons in my view, which is initially in gray color, when I run this function to modify the colors of the buttons they all go to the white color, how can I solve this?