Search background image: Made it generic and updated UIViewController+VectorSerch to add it programmatically

This commit is contained in:
manuroe
2016-01-05 16:03:58 +01:00
parent 3f5d7e0c3d
commit 8368f46b52
6 changed files with 81 additions and 93 deletions
@@ -25,12 +25,6 @@
@implementation RoomSearchViewController
+ (UINib *)nib
{
return [UINib nibWithNibName:NSStringFromClass([RoomSearchViewController class])
bundle:[NSBundle bundleForClass:[RoomSearchViewController class]]];
}
- (void)viewDidLoad
{
[super viewDidLoad];
@@ -41,6 +35,9 @@
// Reuse cells from the RoomViewController to display results
[self.searchTableView registerClass:RoomIncomingTextMsgBubbleCell.class forCellReuseIdentifier:RoomIncomingTextMsgBubbleCell.defaultReuseIdentifier];
[self.searchTableView registerClass:RoomIncomingAttachmentBubbleCell.class forCellReuseIdentifier:RoomIncomingAttachmentBubbleCell.defaultReuseIdentifier];
// Add the Vector background image when search bar is empty
[self addBackgroundImageViewToView:self.view];
}
- (void)viewWillAppear:(BOOL)animated
@@ -55,7 +52,7 @@
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
{
self.backgroundImageViewBottomConstraint.constant = keyboardHeight;
//self.backgroundImageViewBottomConstraint.constant = keyboardHeight;
[super setKeyboardHeight:keyboardHeight];
}
@@ -67,7 +64,7 @@
if (searchBar2.text.length)
{
_backgroundImageView.hidden = YES;
self.backgroundImageView.hidden = YES;
}
}