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
Post
Replies
Boosts
Views
Activity
How to change default white color of tvos swift UIButton focus selection?
override func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) {
if let nextFocusedView = context.nextFocusedView {
playAllOutlet.backgroundColor = UIColor.red
shuffleBtnOutlet.backgroundColor = UIColor.green
}
if let previousFocusView = context.previouslyFocusedView {
playAllOutlet.backgroundColor = UIColor.red
shuffleBtnOutlet.backgroundColor = UIColor.green
}
}
But background when button is focused is still white
scrollview did scrolling and focus view video is playing and all are video is pause. How can I implement this functionality?
I get center and top position of UIScrollView() but top video is play when focused but all are video also playing, so how can I implement only focus video is play using scrollview?