123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- //
- // YMMagicView.m
- // MSYOUPAI
- //
- // Created by 刘必果 on 2024/3/16.
- // Copyright © 2024 MS. All rights reserved.
- //
- #import "YMMagicView.h"
- @implementation YMMagicView
- - (instancetype)initWithFrame:(CGRect)frame{
- self = [super initWithFrame:frame];
- if(self){
- [self loadUI];
- [self loadLayout];
- }
- return self;
- }
- - (void)loadUI{
- [self addSubview:self.magicView];
- [self.magicView addSubview:self.displayerOpenGLView];
- }
- - (void)loadLayout{
- [self.magicView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.equalTo(self);
- }];
- [self.displayerOpenGLView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.equalTo(self.magicView);
- }];
- }
- - (UIView *)magicView{
- if(!_magicView){
- UITextField *bgTextField = [[UITextField alloc] init];
- bgTextField.secureTextEntry = YES;
- bgTextField.enabled = NO;
- _magicView = bgTextField.subviews.firstObject;
- }
- return _magicView;
- }
- - (FUOpenGLView *)displayerOpenGLView{
- if(!_displayerOpenGLView){
- _displayerOpenGLView = [[FUOpenGLView alloc]initWithFrame:CGRectZero];
- _displayerOpenGLView.backgroundColor = [UIColor clearColor];
- }
- return _displayerOpenGLView;
- }
- @end
|