65 lines
1.4 KiB
Objective-C
65 lines
1.4 KiB
Objective-C
//
|
|
// XPRoomPositionView.m
|
|
// xplan-ios
|
|
//
|
|
// Created by 冯硕 on 2021/10/11.
|
|
//
|
|
|
|
#import "XPRoomPositionContainView.h"
|
|
///Third
|
|
#import <Masonry/Masonry.h>
|
|
///Tool
|
|
#import "XPRoomPositionLayoutImpl.h"
|
|
///View
|
|
#import "XPRoomPositionView.h"
|
|
|
|
@interface XPRoomPositionContainView ()
|
|
///
|
|
@property (nonatomic,strong) XPRoomPositionView *postionView;
|
|
///
|
|
@property (nonatomic,strong) XPRoomPositionLayoutImpl *layoutImpl;
|
|
@end
|
|
|
|
@implementation XPRoomPositionContainView
|
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
self = [super initWithFrame:frame];
|
|
if (self) {
|
|
[self initSubViews];
|
|
[self initSubViewConstraints];
|
|
}
|
|
return self;
|
|
}
|
|
#pragma mark - Public Method
|
|
- (CGFloat)positionContainerViewHeight {
|
|
return [self.layoutImpl getPositionViewHeight];
|
|
}
|
|
|
|
#pragma mark - Private Method
|
|
- (void)initSubViews {
|
|
[self addSubview:self.postionView];
|
|
}
|
|
|
|
- (void)initSubViewConstraints {
|
|
[self.postionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.right.mas_equalTo(self).inset(20);
|
|
make.top.bottom.mas_equalTo(self);
|
|
}];
|
|
}
|
|
|
|
#pragma mark - Getters And Setters
|
|
- (XPRoomPositionView *)postionView {
|
|
if (!_postionView) {
|
|
_postionView = [[XPRoomPositionView alloc] initWithFrame:CGRectZero layout:self.layoutImpl];
|
|
}
|
|
return _postionView;
|
|
}
|
|
|
|
- (XPRoomPositionLayoutImpl *)layoutImpl {
|
|
if (!_layoutImpl) {
|
|
_layoutImpl = [[XPRoomPositionLayoutImpl alloc] init];
|
|
}
|
|
return _layoutImpl;
|
|
}
|
|
|
|
@end
|