if you using storyboard, but some property need set in code (may be xcode GUI dun provide enough setting)

  • drag to property first
  • write a setter, it will autoload

// this function will auto load by storyboard
-(void)setKeyLabel:(UILabel *)keyLabel {
    if (_keyLabel != keyLabel) {
        _keyLabel = keyLabel;
        _keyLabel.font = [UIFont fontWithName:@"SOME-FONT-NAME" size:20.0f];
        _keyLabel.textColor = SOME-UI_COLOR;
    }
}