I have a UITextView wrapped inside a UIView which can be resized (increasing frame and font size), and the magnifying glass works fine with smaller textview sizes
But if I increase the textview size a lot, the magnifying glass starts going out of its frame
Can I just remove the magnifying glass without affecting cursor selection, or decrease the scale value inside the glass so the content fits its frame?
Ok, managed to disable magnifying glass without removing the ability to move curser.
To do that, I removed the UILongPressGestureRecognizer to get rid of magnifying glass. Then used my UIPanGestureRecognizer to track the touch location of the user
CGPoint currentPos = [panRecognizer locationInView:self];
and then set the cursor location
UITextPosition *cursorPosition=[self closestPositionToPoint:CGPointMake(currentPos.x, currentPos.y)];
[self setSelectedTextRange:[self textRangeFromPosition:cursorPosition toPosition:cursorPosition]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With