//
//  SLMyViewController.m
//  SLAiELTS
//
//  Created by Gusont on 2023/3/8.
//

#import "SLMyViewController.h"
#import "SLMyView.h"
#import "SLPageViewModel.h"

@interface SLMyViewController ()

@property (nonatomic, strong) SLMyView *myView;

@end

@implementation SLMyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    if (@available(iOS 11.0, *)) {
        self.myView.mainCollectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    [self.myView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
    self.myView.viewModels = [SLPageViewModel myPageViewModels];
    self.navigationBar.hidden = YES;
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear: animated];
}

- (SLMyView *)myView {
    if (!_myView) {
        _myView = [[SLMyView alloc] initWithFrame:self.view.frame];
        [self.view addSubview:_myView];
    }
    return _myView;
}

@end
