//
//  FeedTopView.m
//  KKCivilAd
//
//  Created by 雷俊博 on 2020/8/20.
//  Copyright © 2020 雷俊博. All rights reserved.
//

#import "FeedTopView.h"

@interface FeedTopView ()
{
    MarkBtn* selectBtn;
}

@end

@implementation FeedTopView
- (IBAction)btnClick:(MarkBtn *)sender {
    
    if (selectBtn == sender) {
        return;
    }
    NSNumber*btnValue = nil;
    if (sender == self.btn1) {
        btnValue = @(1);
    }else if (sender == self.btn2){
        btnValue = @(2);
    }else if (sender == self.btn3){
        btnValue = @(3);
    }
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(btnClick:value:)]) {
        [self.delegate btnClick:sender value:btnValue];
    }
    
    selectBtn.btnSelected = NO;
    sender.btnSelected = YES;
    
    selectBtn = sender;
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
