This repository has been archived on 2020-08-22. You can view files and clone it, but cannot push or open issues or pull requests.
flutter-unity-view-widget/ios/Classes/FlutterUnityView.m

38 lines
620 B
Objective-C

//
// FlutterUnityView.m
// FlutterUnityView
//
// Created by krispypen on 8/1/2019
//
#import "FlutterUnityView.h"
@implementation FlutterUnityView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
return self;
}
- (void)dealloc
{
}
- (void)setUnityView:(UIView *)view
{
self.uView = view;
[self setNeedsLayout];
}
- (void)layoutSubviews
{
[super layoutSubviews];
[(UIView *)self.uView removeFromSuperview];
[self insertSubview:(UIView *)self.uView atIndex:0];
((UIView *)self.uView).frame = self.bounds;
[(UIView *)self.uView setNeedsLayout];
}
@end