Access files owner view controller instance from subclass (using SWRevealViewController)

纵然是瞬间 提交于 2019-12-11 05:19:34

问题


I am using SWRevealViewController (https://github.com/Joan-Lluch/SWRevealViewController) and am trying to access the revealViewController instance that lives within the files owner view controller of a xib file from within a subclass.

Basically, in the files owner of the xib, i access the instance by saying [self revealViewController] and am able to control it that way. My issue is that I have a search display controller in the xib file and I need to access [self revealViewController] within the search display controller subclass so that I can slide the revealViewController left and right based on if the search bar is touched or not. Right now I do have it working but thats because I have the delegate of the search bar set to files owner, but this isn't desirable as I need to style search results and be able to click on search results and manipulate revealViewController.

I was thinking maybe set a property that points to the instance of [self revealViewController] on the files owner and expose it so that a subclass could access that property?

Any help is appreciated.

来源:https://stackoverflow.com/questions/16576072/access-files-owner-view-controller-instance-from-subclass-using-swrevealviewcon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!