Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Created June 19, 2020 06:34
Show Gist options
  • Save SunXiaoShan/cea3ea0c89c5158631160b6058dfefa4 to your computer and use it in GitHub Desktop.
Save SunXiaoShan/cea3ea0c89c5158631160b6058dfefa4 to your computer and use it in GitHub Desktop.
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self addBottomSheetView];
}
- (void)addBottomSheetView {
BottomSheetViewController *bottomSheetVc = [BottomSheetViewController new];
[self addChildViewController:bottomSheetVc];
[self.view addSubview:bottomSheetVc.view];
[bottomSheetVc didMoveToParentViewController:self];
const CGFloat y = self.view.frame.origin.y;
const CGFloat height = self.view.frame.size.height;
const CGFloat width = self.view.frame.size.width;
bottomSheetVc.view.frame = CGRectMake( 0, y + height, width, height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment