Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first pull #121

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Empty file modified PYSearch/NSBundle+PYSearchExtension.h
100644 → 100755
Empty file.
Empty file modified PYSearch/NSBundle+PYSearchExtension.m
100644 → 100755
Empty file.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/en.lproj/Localizable.strings
100644 → 100755
Empty file.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified PYSearch/PYSearch.bundle/zh-Hans.lproj/Localizable.strings
100644 → 100755
Empty file.
Empty file modified PYSearch/PYSearch.bundle/zh-Hant.lproj/Localizable.strings
100644 → 100755
Empty file.
Empty file modified PYSearch/PYSearch.h
100644 → 100755
Empty file.
Empty file modified PYSearch/PYSearchConst.h
100644 → 100755
Empty file.
Empty file modified PYSearch/PYSearchConst.m
100644 → 100755
Empty file.
Empty file modified PYSearch/PYSearchSuggestionViewController.h
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions PYSearch/PYSearchSuggestionViewController.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ - (void)setSearchSuggestions:(NSArray<NSString *> *)searchSuggestions
* Adjust the searchSugesstionView when the keyboard changes.
* more information can see : https://github.com/iphone5solo/PYSearch/issues/61
*/
if (self.keyboardDidShow && !UIEdgeInsetsEqualToEdgeInsets(self.originalContentInsetWhenKeyboardShow, UIEdgeInsetsZero) && !UIEdgeInsetsEqualToEdgeInsets(self.originalContentInsetWhenKeyboardShow, UIEdgeInsetsMake(-30, 0, 30 - 64, 0))) {
if (self.keyboardDidShow && !UIEdgeInsetsEqualToEdgeInsets(self.originalContentInsetWhenKeyboardShow, UIEdgeInsetsZero) && !UIEdgeInsetsEqualToEdgeInsets(self.originalContentInsetWhenKeyboardShow, UIEdgeInsetsMake(-30, 0, 30 - CGRectGetMaxY(self.navigationController.navigationBar.frame), 0))) {
self.tableView.contentInset = self.originalContentInsetWhenKeyboardShow;
} else if (!self.keyboardDidShow && !UIEdgeInsetsEqualToEdgeInsets(self.originalContentInsetWhenKeyboardHidden, UIEdgeInsetsZero) && !UIEdgeInsetsEqualToEdgeInsets(self.originalContentInsetWhenKeyboardHidden, UIEdgeInsetsMake(-30, 0, 30 - 64, 0))) {
} else if (!self.keyboardDidShow && !UIEdgeInsetsEqualToEdgeInsets(self.originalContentInsetWhenKeyboardHidden, UIEdgeInsetsZero) && !UIEdgeInsetsEqualToEdgeInsets(self.originalContentInsetWhenKeyboardHidden, UIEdgeInsetsMake(-30, 0, 30 - CGRectGetMaxY(self.navigationController.navigationBar.frame), 0))) {
self.tableView.contentInset = self.originalContentInsetWhenKeyboardHidden;
}
self.tableView.contentOffset = CGPointMake(0, -self.tableView.contentInset.top);
Expand Down
16 changes: 8 additions & 8 deletions PYSearch/PYSearchViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ - (void)viewDidAppear:(BOOL)animated
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];

[self.navigationController setNavigationBarHidden:NO];
// Adjust the view according to the `navigationBar.translucent`
if (NO == self.navigationController.navigationBar.translucent) {
self.baseSearchTableView.contentInset = UIEdgeInsetsMake(0, 0, self.view.py_y, 0);
self.searchSuggestionVC.view.frame = CGRectMake(0, 64 - self.view.py_y, self.view.py_width, self.view.py_height + self.view.py_y);
self.searchSuggestionVC.view.frame = CGRectMake(0, CGRectGetMaxY(self.navigationController.navigationBar.frame) - self.view.py_y, self.view.py_width, self.view.py_height + self.view.py_y);
if (!self.navigationController.navigationBar.barTintColor) {
self.navigationController.navigationBar.barTintColor = PYSEARCH_COLOR(249, 249, 249);
}
Expand All @@ -167,7 +167,6 @@ - (void)viewWillDisappear:(BOOL)animated
[super viewWillDisappear:animated];

[self.searchBar resignFirstResponder];

}

- (void)dealloc
Expand Down Expand Up @@ -231,7 +230,7 @@ - (PYSearchSuggestionViewController *)searchSuggestionVC
[_swSelf searchBarSearchButtonClicked:_swSelf.searchBar];
}
};
searchSuggestionVC.view.frame = CGRectMake(0, 64, PYScreenW, PYScreenH);
searchSuggestionVC.view.frame = CGRectMake(0, CGRectGetMaxY(self.navigationController.navigationBar.frame), PYScreenW, PYScreenH);
searchSuggestionVC.view.backgroundColor = self.baseSearchTableView.backgroundColor;
searchSuggestionVC.view.hidden = YES;
_searchSuggestionView = (UITableView *)searchSuggestionVC.view;
Expand Down Expand Up @@ -335,8 +334,9 @@ - (void)setup
self.navigationController.navigationBar.backIndicatorImage = nil;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
UIButton *cancleButton = [UIButton buttonWithType:UIButtonTypeSystem];
cancleButton.titleLabel.font = [UIFont boldSystemFontOfSize:16];
cancleButton.titleLabel.font = [UIFont systemFontOfSize:15];
[cancleButton setTitle:[NSBundle py_localizedStringForKey:PYSearchCancelButtonText] forState:UIControlStateNormal];
[cancleButton setTitleColor:UIColorFromRGB(0x393939) forState:UIControlStateNormal];
[cancleButton addTarget:self action:@selector(cancelDidClick) forControlEvents:UIControlEventTouchUpInside];
[cancleButton sizeToFit];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:cancleButton];
Expand Down Expand Up @@ -890,8 +890,8 @@ - (void)cancelDidClick
[self.delegate didClickCancel:self];
return;
}

[self dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popViewControllerAnimated:self];
// [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)keyboardDidShow:(NSNotification *)noti
Expand Down Expand Up @@ -998,7 +998,7 @@ - (void)handleSearchResultShow
[self.view addSubview:self.searchResultController.view];
[self addChildViewController:self.searchResultController];
self.searchResultController.view.hidden = NO;
self.searchResultController.view.py_y = NO == self.navigationController.navigationBar.translucent ? 0 : 64;
self.searchResultController.view.py_y = NO == self.navigationController.navigationBar.translucent ? 0 : CGRectGetMaxY(self.navigationController.navigationBar.frame);
self.searchResultController.view.py_height = self.view.py_height - self.searchResultController.view.py_y;
self.searchSuggestionVC.view.hidden = YES;
} else {
Expand Down
Empty file modified PYSearch/UIColor+PYSearchExtension.h
100644 → 100755
Empty file.
Empty file modified PYSearch/UIColor+PYSearchExtension.m
100644 → 100755
Empty file.
Binary file added PYSearchExample/.DS_Store
Binary file not shown.