How to implement search view controller with side menu in tvOS?

40 Views Asked by At
class SearchController: UISearchController {
    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override func viewWillDisappear(_ animated: Bool) {
        let appDelegate = UIApplication.shared.delegate as! AppDelegate
        AppDelegate.searchFlag = true
        DispatchQueue.main.async(execute: {
            self.searchBar.text = "abc"
        })
    }
    
    override func viewWillAppear(_ animated: Bool) {
        self.view.frame.origin.y = 400
        self.view.frame.origin.x = 400
    }
}
    

How to add this SearchController on search view controller because when use this code:

self.present(appDelegate.searchController, animated: true, completion: nil)

it is showing full width screen.

0

There are 0 best solutions below