1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- //
- // NYFloatingSuggestView.m
- // jiaPei
- //
- // Created by Ning.ge on 2023/6/30.
- // Copyright © 2023 JCZ. All rights reserved.
- //
- #import "NYFloatingSuggestView.h"
- @interface NYFloatingSuggestView ()
- @property (nonatomic,strong) NYFloatingSuggestViewModel *floatingSuggestViewModel;
- @end
- @implementation NYFloatingSuggestView
- #pragma mark - PublicMethods
- + (instancetype)floatingSuggestView {
- return [super rq_viewFromXib];
- }
- #pragma mark - SystemMethods
- - (void)awakeFromNib {
- [super awakeFromNib];
- }
- - (void)bindViewModel:(id)viewModel
- {
- self.floatingSuggestViewModel = viewModel;
- self.floatingSuggestViewModel.floatingSuggestView = self;
- @weakify(self)
- // 使用 RAC 建立按钮点击事件与视图模型中的命令的绑定
- [[self.icon_button rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
- @strongify(self);
- [self.floatingSuggestViewModel.iconCommand execute:nil];
- }];
- //关闭
- [[self.close_button rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x){
- @strongify(self);
- [self.floatingSuggestViewModel.closeCommand execute:nil];
- }];
- }
- @end
|