Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you implement NSPageController to navigate through a webView's history
    primarykey
    data
    text
    <p>I have a webView-based app, but I want the user to be able to navigate it with swiping on the trackpad and magic mouse. Therefore, I am going to implement NSPageController.</p> <p>I have looked at the documentation and the PictureSwiper app, however those aren't really meant for a webView. So, I would like to know how I can use an NSPageController on a webView. I have a webView defined as <code>webView</code> and two actions, goBack: and goForward: that load the previous and next page respectively. </p> <p>However, I am unaware of how I get NSPageController to work with a simple webView. There has a to be a way to do it, but I see no way. If someone could please explain what I am suppose to do, that would be great. Or if you are feeling especially generous, you can download my free browser source example. <a href="https://sites.google.com/site/infiniteopensyntax/basic-web-browser" rel="nofollow noreferrer">https://sites.google.com/site/infiniteopensyntax/basic-web-browser</a> </p> <p>That source shows how my own app is pretty much set up. If you would like to implement the NSPageController on that app and send me the source, I would really appreciate it. It's not much, but if you do that I'll add the swiping example to Infinite Open Syntax and put your name on it. You can choose the license. </p> <p>This is Cocoa, not Cocoa Touch</p> <p><strong><em>EDIT</em></strong></p> <p>Okay, now I just need to make sure the app still works on Snow Leopard. Supposedly, I can test this by disconnecting the outlets. It works fine, minus the back and forward button. To do this, I believe I check for the class NSPageController. If it doesn't exist, then I just skip using the pageController.</p> <pre><code>- (IBAction)goBack:(id)sender { if (NSClassFromString(@"NSPageController") != Nil) { [self.pageController navigateBack:sender]; } { //Not 10.8 [webView goBack]; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    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