facebookarchive / AsyncDisplayKit

Smooth asynchronous user interfaces for iOS apps.
http://asyncdisplaykit.org
Other
13.4k stars 2.2k forks source link

[ASTableNode ver. 1.9.81] UISearchBar disappears when call reloadData() #2104

Closed ht22pt closed 8 years ago

ht22pt commented 8 years ago

I use ASTableNode for show some data and add one search bar with code in viewDidLoad

 // create search controller
self.searchController = UISearchController(searchResultsController: nil)
self.searchController!.searchResultsUpdater = self
self.searchController!.hidesNavigationBarDuringPresentation = false
self.searchController!.dimsBackgroundDuringPresentation = false
self.searchController!.definesPresentationContext = true
self.searchController!.searchBar.sizeToFit()
self.tableNode.view.tableHeaderView = searchController!.searchBar

and when searching

    // MARK : - Search
    func filterContentForSearchText(searchText: String) {
        filterSavedPost = savedPost.filter({(post : Post) -> Bool in
               // Some check post data and return true or false
        })
        self.tableNode.view.reloadData()
    }

And some image show in simulation simulator screen shot aug 19 2016 3 05 35 pm

simulator screen shot aug 19 2016 3 06 11 pm

ht22pt commented 8 years ago

I found workaround solution for this issue:

func do_table_refresh()
{
    dispatch_async(dispatch_get_main_queue(), {
        self.tableNode.view.reloadData()
        return
    })
}