在搜索栏(ModernSearchBar)之后重新加载tableview

时间:2018-07-06 15:31:31

标签: swift uitableview uisearchbar

我已在我的应用程序上成功设置了此广告连播(Modernsearchbar) 当我在tableview中搜索时,它可以正确检索结果(此功能可以成功启动)

func onClickItemWithUrlSuggestionsView(item: ModernSearchBarModel) {
        print("User touched this item: "+item.title+" with this url: "+item.url.description)
}

但是我不知道如何仅返回结果(重新加载我的表视图)后再返回到表视图 当我尝试时,无法关闭ModernSearchBar。

如果有人有任何线索,我想或:

  • 选中我的结果,然后关闭modernSearchBar

  • 关闭modernSearchBar并仅使用搜索结果重新加载我的TableView。

预先感谢,我在这里已经读了很多东西,但是没有找到任何解决方案。

1 个答案:

答案 0 :(得分:0)

如果有人有此问题,请提供帮助:

 My_ModernSearch.searchBarCancelButtonClicked(My_ModernSearch)

并勾选:

for x in (0..<totalNumberOfRows).reversed() {

            let indexPath = IndexPath(row: x, section: 0)
            let cell = MyFriendsTableview.cellForRow(at: indexPath)
            var MyFriendsLine: MyFriendsModel
            MyFriendsLine = self.MyFriendslist[indexPath.row]

            if(MyFriendsLine.field1 == item.title) {

                if cell?.accessoryType == .checkmark {
                    cell?.accessoryType = .none
                     }
             else {
                cell?.accessoryType = .checkmark

            }
相关问题