1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- //
- // YMCancellationAccountViewController.m
- // MSYOUPAI
- //
- // Created by YoMi on 2024/3/17.
- // Copyright © 2024 MS. All rights reserved.
- //
- #import "YMCancellationAccountViewController.h"
- #import "YMCancellationAccountViewModel.h"
- #import "YMCancellationAccountInfoView.h"
- @interface YMCancellationAccountViewController ()<UIGestureRecognizerDelegate>
- /// 注销账号VM
- @property (nonatomic, strong) YMCancellationAccountViewModel *viewModel;
- /// 容器滚动视图
- @property (nonatomic, strong) UIScrollView *contentScrollView;
- /// 容器视图
- @property (nonatomic, strong) UIView *contentView;
- /// 注销账号信息视图
- @property (nonatomic, strong) YMCancellationAccountInfoView *cancellationAccountInfoView;
- @end
- @implementation YMCancellationAccountViewController
- @dynamic viewModel;
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- }
- - (void)ym_setupViews{
- [self.view addSubview:self.contentScrollView];
- [self.contentScrollView addSubview:self.contentView];
- [self.contentView addSubview:self.cancellationAccountInfoView];
- [self.view setNeedsUpdateConstraints];
- [self.view updateConstraintsIfNeeded];
- }
- - (void)updateViewConstraints{
- [self.contentScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.view).offset(kYMNavHeight);
- make.left.equalTo(self.view);
- make.right.equalTo(self.view);
- make.bottom.equalTo(self.view);
- }];
-
- [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.equalTo(self.contentScrollView);
- make.width.equalTo(self.contentScrollView.mas_width);
- }];
-
- [self.cancellationAccountInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.contentView);
- make.left.equalTo(self.contentView);
- make.right.equalTo(self.contentView);
- make.bottom.equalTo(self.contentView);
- }];
-
- [super updateViewConstraints];
- }
- - (void)ym_bindViewModel{
- [self.cancellationAccountInfoView ym_bindViewModel:self.viewModel];
- }
- - (UIScrollView *)contentScrollView{
- if (!_contentScrollView) {
- _contentScrollView = [[UIScrollView alloc]init];
- _contentScrollView.alwaysBounceVertical = YES;
- _contentScrollView.showsVerticalScrollIndicator = NO;
- _contentScrollView.showsHorizontalScrollIndicator = NO;
- _contentScrollView.backgroundColor = UIColor.clearColor;
- _contentScrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
- }
- return _contentScrollView;
- }
- - (UIView *)contentView{
- if (!_contentView) {
- _contentView = [[UIView alloc]init];
- }
- return _contentView;
- }
- - (YMCancellationAccountInfoView *)cancellationAccountInfoView{
- if (!_cancellationAccountInfoView) {
- _cancellationAccountInfoView = [[YMCancellationAccountInfoView alloc]init];
- }
- return _cancellationAccountInfoView;
- }
- @end
|