Note that there are some explanatory texts on larger screens.

plurals
  1. PODetecting what view is currently being displayed
    primarykey
    data
    text
    <p>I have a problem. I am using three20 and am using TTYoutubeView, this problem does not necessarily require knowledge of three20 to fix I think.</p> <p>My issue is, i have a custom drawMethod on my navigationBar, however, when i load a youtube video, i need to tell it to ignore my custom draw method (this isn't a problem, i have a global BOOL that can do this).</p> <p>My problem is, there is no way i can detect when the youtube video loads, it is launched via an object within a UIWebview, so no UITouches to catch, and I don't fancy subclassing the UIWebview, as after the youtube video has been dismissed, i have no way to catch this either.</p> <p>What i require, is a method that whenever my navigationbar is drawn asks 'What class is the current viewController', then i can tell it what to draw dependent on what is being displayed.</p> <pre><code>NSLog(@"%@",[TTNavigator navigator].topViewController); NSLog(@"%@",[TTNavigator navigator].visibleViewController); </code></pre> <p>I am logging out the viewControllers in my draw method, this works perfectly, my code logs as follows</p> <pre><code>2010-09-08 16:39:23.171 MyApp[3512:307] &lt;HomeController: 0x264df0&gt; 2010-09-08 16:39:23.174 MyApp[3512:307] &lt;HomeController: 0x264df0&gt; </code></pre> <p>The problem is, when the youtube video loads, it seems to load a modalViewController, my code still logs out the viewController that is underneath this modalController. It does not tell me what is on top.</p> <p>Detecting the viewController seemed like a bright spark when i thought of it, and it still is a good idea as far as i'm concerned. I'm just at a loss as to how I can find out what view is currently on top. (as topViewController and visibleViewController don't seem too do this accurately)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload