It can be done something like this:
-(void)setWebViewScale:(NSUInteger)pageScale {
_textFontSize = pageScale;
NSString *jsString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%d%%'",pageScale];
[_webView stringByEvaluatingJavaScriptFromString:jsString];
[jsString release];
}
And +/- scale will done by:
- (IBAction)changeTextFontSize:(id)sender
{
switch ([sender tag]) {
case 1: // A-
_textFontSize = (_textFontSize > MIN_PAGE_SCALE) ? _textFontSize - STEP_PAGE_SCALE : _textFontSize;
break;
case 2: // A+
_textFontSize = (_textFontSize < MAX_PAGE_SCALE) ? _textFontSize + STEP_PAGE_SCALE : _textFontSize;
break;
}
[self setWebViewScale:_textFontSize];
}
Defines MAX_PAGE_SCALE and MIN_PAGE_SCALE restricts content to be too big and too small, and STEP_PAGE_SCALE determine step of scale change.