0

I am useing the swreveal to do the slide menu which i want to add search bar in it. However, the search bar has been covered by the parent view.

enter image description here

    slide_areaWidth = self.revealViewController().rightViewRevealWidth
    searchBar =  UISearchBar(frame: CGRectMake(300, 0, 60, 64))
    var searchDisplayController: UISearchDisplayController = UISearchDisplayController()
    searchDisplayController = UISearchDisplayController(searchBar: searchBar, contentsController: self)
    //searchDisplayController.delegate = self
    searchDisplayController.searchResultsDataSource = self
    self.tableView.tableHeaderView = searchBar

    self.tableView.tableHeaderView!.frame = CGRectMake(300, 0, 60, 64);
Jacky Shek
  • 953
  • 1
  • 11
  • 35
  • in here add the frame for search is using **window position** + x, else use delegate method of `SWLRevel` **- (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position** – Anbu.Karthik May 15 '15 at 10:48
  • Sorry, i do not understand the window position + x. Do you mean UIScreen? Thank you very much – Jacky Shek May 15 '15 at 13:58
  • i found the solution which is edit the `self.revealViewController().rightViewRevealOverdraw ` to 0. thank you very much for your helping – Jacky Shek May 15 '15 at 17:03

1 Answers1

0

There is a simple way that can solve this issue which can be find in SWRevealViewController.m

Swift: self.revealViewController().rightViewRevealOverdraw = 0

Jacky Shek
  • 953
  • 1
  • 11
  • 35