0

I am using a WKWebView and I am trying to set its magnification with the setMagnification instance method in a class that the webView is a variable of. Whenever I try to compile I get:

No visible @interface for 'WKWebView' declares the selector 'setMagnification:centeredAt:'

despite the fact that WebKit is being imported.

-(void)zoomIn:(int) xCoord y:(int) yCoord
{
    CGPoint myPoint = CGPointMake(xCoord, yCoord);
    [_webView setMagnification:3 centeredAt:myPoint]
}

Edit: Just learned why this does not work is because it is OSX only, and I need it for iOS. If you have an alternative for iOS, please let me know.

rmaddy
  • 298,130
  • 40
  • 468
  • 517
Bneac
  • 59
  • 1
  • 8
  • 1
    This method is only available in OSX (Since 10.10, see the doc: https://developer.apple.com/documentation/webkit/wkwebview/1414996-setmagnification?language=objc) Are you building for iOS? – Larme Jul 03 '18 at 18:57
  • Oh, I just saw that. I am using iOS. Is there any alternative you know for it? – Bneac Jul 03 '18 at 19:02
  • I don't know. But https://stackoverflow.com/questions/25553711/disable-magnification-gesture-in-wkwebview ? It's not the same goal (at all), but it reminds that `WKWebView` has a `scrollView` property. Maybe something to search there. – Larme Jul 03 '18 at 19:06

0 Answers0