Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)layoutContainerView {
  2.     CGFloat y;
  3.     if (self.mode == kLDPPostsFeedViewModeSearch) {
  4.         y = CGRectGetMaxY(self.searchBar.frame);
  5.         if (@available(iOS 11.0, *)) {
  6.             y += self.safeAreaInsets.top;
  7.         }
  8.         // TODO: remove this hack.
  9.         // On new iPhones needs place containerView under the searchBar, so that black bottom bar on searchBar will not be visible
  10.         if ([LDPHelper isIphoneXSeries]) {
  11.             y -= 2;
  12.         }
  13.     } else {
  14.         y = CGRectGetMaxY(self.feedPostsTypesScrollView.frame);
  15.     }
  16.     CGRect frame = self.containerView.frame;
  17.     frame.origin.x = 0;
  18.     frame.origin.y = y;
  19.     frame.size.width = CGRectGetWidth(self.frame);
  20.     CGFloat height = CGRectGetHeight(self.frame) - CGRectGetMinY(frame);
  21.     frame.size.height = height;
  22.     self.containerView.frame = frame;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement