//
//  YMBarButtonItem.m
//  PCDBank
//
//  Created by Gusont on 2020/12/1.
//  Copyright © 2020 YMBank. All rights reserved.
//

#import "YMBarButtonItem.h"

@implementation YMBarButtonItem

- (nullable instancetype)initWithImage:(nullable UIImage *)image style:(YMBarButtonItemStyle)style target:(nullable id)target action:(nullable SEL)action
{
    YMBarButtonItem *item = [[YMBarButtonItem alloc] init];
    item.image = image;
    item.style = style;
    item.target = target;
    item.action = action;
    item.buttonWidth = YMBarItemWidth;
    return item;
}

- (nullable instancetype)initWithTitle:(nullable NSString *)title target:(nullable id)target action:(nullable SEL)action
{
    YMBarButtonItem *item = [[YMBarButtonItem alloc] init];
    item.title = title;
    item.target = target;
    item.action = action;
    item.buttonWidth = YMBarItemWidth;
    return item;
}

- (nullable instancetype)initWithCustomView:(nullable UIView *)customView
{
    YMBarButtonItem *item = [[YMBarButtonItem alloc] init];
    item.customView = customView;
    return item;
}

- (void)setButtonWidth:(float)buttonWidth
{
    _buttonWidth = buttonWidth;
}

@end
