Access files owner view controller instance from s

2019-08-02 14:26发布

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.

0条回答
登录 后发表回答