Todo icon indicating copy to clipboard operation
Todo copied to clipboard

searchDisplayController 在ios8中被弃用后用什么替代呢?

Open x1911 opened this issue 10 years ago • 1 comments

非常感谢大大无私的奉献,让我学到很多东西,在此有两个小疑问想问问

在课件提到的两个地方 1, contentOffset.y += searchDisplayController!.searchBar.frame.size.height

2, func searchDisplayController(controller: UISearchDisplayController, shouldReloadTableForSearchString searchString: String!) -> Bool { fliteredTodos = todos.filter(){$0.title.rangeOfString(searchString) != nil} return true }

都提示 searchDisplayController 和 UISearchDisplayController 在IOS8 中被弃用,这里应该如何修改呢?

谢谢大大

x1911 avatar May 11 '15 07:05 x1911

请使用UISearchController,但是要支持iOS 7的话需要注意一下,我的做法是iOS9出来时,我的app只支持iOS8,然后把这些API都升级。

谢谢 Jake

2015-05-11 17:28 GMT+10:00 x1911 [email protected]:

非常感谢大大无私的奉献,让我学到很多东西,在此有两个小疑问想问问

在课件提到的两个地方 1, contentOffset.y += searchDisplayController!.searchBar.frame.size.height

2, func searchDisplayController(controller: UISearchDisplayController, shouldReloadTableForSearchString searchString: String!) -> Bool { fliteredTodos = todos.filter(){$0.title.rangeOfString(searchString) != nil} return true }

都提示 searchDisplayController 和 UISearchDisplayController 在IOS8 中被弃用,这里应该如何修改呢?

谢谢大大

— Reply to this email directly or view it on GitHub https://github.com/JakeLin/Todo/issues/3.

JakeLin avatar May 11 '15 08:05 JakeLin