开发者

UISearchDisplayController across multiple views

Is is possible to use the same UISearchDisplayController/UISearchbar/UISearchDisplayController ResultsTable logic across multiple views?

I have an application which utiliz开发者_开发问答es a site wide search, using a UISearchBar above nearly every view, therefore i have a lot of duplication throughout the application as each view has a UISearchDisplayController and integrated conditional statements in the tableView's to display the results.

Is there a better approach? It feels wrong doing it this way and there must be a better approach that avoids all of this repetition.

I should point out that my application is a Navigation based application utilizing a UINavigationbar hierarchy


You could factor out the common code into it's own class, and then if there is any specific behavior needed by any one implementation, you can override specific methods (such as cellForRowAtIndexpath or didSelectCellForIndexPath).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜