// // SettingsItemView.m // 千模 // // Created by Drew on 2018/10/27. // Copyright © 2018年 MUMEI. All rights reserved. // #import "SettingsItemView.h" @interface SettingsItemView() @property (weak, nonatomic) IBOutlet UILabel *labelView; @property (weak, nonatomic) IBOutlet UIView *line; @end @implementation SettingsItemView - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { [self initView]; } return self; } - (instancetype)initWithCoder:(NSCoder *)aDecoder { if (self = [super initWithCoder:aDecoder]) { [self initView]; } return self; } - (void)initView { NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSString *className = NSStringFromClass([self class]); UIView *view = [[bundle loadNibNamed:className owner:self options:nil] firstObject]; view.frame = self.bounds; [self addSubview:view]; } -(void)setLabel:(NSString *)label{ self.labelView.text = label; } -(void)setShowLine:(BOOL)showLine{ self.line.hidden = !showLine; } /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code } */ @end