Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)openCreateQuickQuoteVC {
- for (id childVC in self.childViewControllers) {
- if ([childVC isKindOfClass:[CBGCreateQuoteMainViewController class]]) {
- return;
- }
- }
- CBGCreateQuoteMainViewController *createQuickQuote = [self.storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([CBGCreateQuoteMainViewController class])];
- createQuickQuote.delegate = self;
- [self addChildViewController:createQuickQuote];
- [self.view addSubview:createQuickQuote.view];
- [createQuickQuote didMoveToParentViewController:self];
- __weak typeof(self) weakSelf = self;
- createQuickQuote.view.frame = CGRectMake(0.f, CGRectGetHeight(self.view.bounds), CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds) - kCBGTabBarHeight);
- [UIView animateWithDuration:0.3f
- delay:0.f
- options:UIViewAnimationOptionCurveEaseInOut
- animations:^{
- createQuickQuote.view.frame = CGRectMake(0.f, 0.f, CGRectGetWidth(weakSelf.view.bounds), CGRectGetHeight(weakSelf.view.bounds) - kCBGTabBarHeight);
- } completion:nil];
- }
- #pragma mark - CBGCreateQuoteMainViewControllerDelegate
- - (void)createQuoteMainViewControllerDidCancelButtonClicked:(CBGCreateQuoteMainViewController *)viewController {
- [viewController willMoveToParentViewController:nil];
- __weak typeof(self) weakSelf = self;
- __block typeof(viewController) blockViewController = viewController;
- [UIView animateWithDuration:0.3f
- delay:0.f
- options:UIViewAnimationOptionCurveEaseInOut
- animations:^{
- blockViewController.view.frame = CGRectMake(0.f, CGRectGetHeight(weakSelf.view.bounds), CGRectGetWidth(weakSelf.view.bounds), CGRectGetHeight(weakSelf.view.bounds) - kCBGTabBarHeight);
- } completion:^(BOOL finished) {
- [blockViewController.view removeFromSuperview];
- [blockViewController removeFromParentViewController];
- }];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement