How to add a magnifier to custom control? Control is a child of UIView. (It's a UIWebView - but native magnification functionality doesn't work at some pages.)
UPDATED:
Maybe it's possible to force a draw of magnifier on UIWebView?
How to add a magnifier to custom control? Control is a child of UIView. (It's a UIWebView - but native magnification functionality doesn't work at some pages.)
UPDATED:
Maybe it's possible to force a draw of magnifier on UIWebView?
TouchReader.h:
TouchReader.m:
You don't need the
touches...
methods any more.1. Add the following files to your project:
MagnifierView.h:
MagnifierView.m:
TouchReader.h:
TouchReader.m:
Based on: http://coffeeshopped.com/2010/03/a-simpler-magnifying-glass-loupe-view-for-the-iphone
2. Add the following images:
Used images on the code:
loupe-hi@2x.png:
loupe-mask@2x.png:
Original but centered images with a shadow (not used at this moment):
loupe-shadow-hi@2x.png:
loupe-shadow-mask@2x.png:
3. Replace the main UIView on your xib-file by TouchReader
The magnifier will work automaticaly except controls that captures touch events themselfs (for example, UIWebView). And the code above doesn't support the images with a shadow. Please add new answer to the qustion if you successfully fix this issue.
UPDATED:
Change the following code to add
UIWebView
support.UIView
should remainUIView
.And add a gesture to
webView
: