Finding (x,y) coordinate of specified word in UITextView

Here is my contents in UITextView...

==>"A ‘Metropolitan’ dining experience offering exquisite food prepared with attention to visual detail & taste."

Now my question is simple and short,how to find the location(x,y) of a word "experience" within the textview.

Any solution will be greatly appreciated.


use sizeWithFont, it suppose to be something like this:

NSString *text = textView.text;
NSString *substring = [text substringToIndex:[text rangeOfString:@"experience"].location];
CGSize size = [substring sizeWithFont:textView.font];
CGPoint p = CGPointMake((int)size.width % (int)textView.frame.size.width, ((int)size.width / (int)textView.frame.size.width) * size.height);

iphone, use sizeWithFont, it suppose to be something like this: NSString *text = textView.​text; NSString *substring = [text substringToIndex:[text  Converts from the coordinate system of to that of this object. (Inherited from UIView) ConvertRectFromView(CGRect, UIView) Converts from the coordinate system used in to that of this object. (Inherited from UIView) ConvertRectToCoordinateSpace(CGRect, IUICoordinateSpace) Converts from this object's coordinate system to that described by .


Try this:

- (CGPoint)getPoint:(UITextView *)textView
{
    NSRange range = [textView.text rangeOfString:@"experience"];

    UITextPosition *beginning = textView.beginningOfDocument;
    UITextPosition *start = [textView positionFromPosition:beginning offset:range.location];
    UITextPosition *end = [textView positionFromPosition:start offset:range.length];
    UITextRange *textRange = [textView textRangeFromPosition:start toPosition:end];
    CGRect rect = [textView firstRectForRange:textRange];
    return rect.origin;
}

Android Wireless Application Development: Barnes & Noble Special , with the word “Layout;” for example, LinearLayout, RelativeLayout, TableLayout, For example, we've been using the LinearLayout to arrange various TextView We could have used an AbsoluteLayout to specify the exact x​/y coordinate You can find the Hierarchy Viewer in the Android SDK subdirectory called /tools. Hello, I'm attempting to extract strings from a text file that comes after specific key words. I only need to extract the X,Y coordinates from the text but I need to preserve what values they correspond with. In my example these are well points and I


Try this if you want in Swift

    let range: NSRange = (txtView.text as NSString).range(of: text)
    let beginning: UITextPosition? = txtView.beginningOfDocument
    let start: UITextPosition? = txtView.position(from: beginning!, offset: range.location)
    let end: UITextPosition? = txtView.position(from: start!, offset: range.length)
    let textRange: UITextRange? = txtView.textRange(from: start!, to: end!)
    let rect: CGRect = txtView.firstRect(for: textRange!)

UITextField Class (UIKit), Initializes the UITextField with the specified frame. This property controls how words should be capitalized by the system during user The NSLayoutYAxisAnchor that defines the Y-axis center of this UIView. An array of IUIFocusEnvironments that are recursively searched by the system to find the default focused view. How to get X and Y of any point in plot for excel 2010 I have made a scatter plot with a smooth line in Excel 2010. Is there any way to find X and Y value at any point in graph by moving cursor??.


iOS Text Kit Basics, Finding (x,y) coordinate of specified word in UITextView. Here is my contents in UITextView ==>"A 'Metropolitan' dining experience offering exquisite food  The lines extending from the x- and y-axes to the interpolated point (x-value, y-value) can be created with a new data series containing three pairs of xy data. Those pairs are as follows: The first and second pair of data points comprise the horizontal line from the y-axis to (x-value, y-value) and the second and third points make up the


Getting to Know TextKit · objc.io, In fact, if you've used OS X at all, there is a near 100% chance that you've run Select Main.storyboard, use the Object Library to find a UITextView object, text content is created not by programmatically specifying ranges and attributes, you type, just as you'd expect from any word processor application. y=x^2+1 (Graph Example), 4x+2=2(x+6) (Solve Example) Algebra Calculator is a calculator that gives step-by-step help on algebra problems.


UITextField, iOS 6: Some movement: Attributed text editing comes to UITextView . For example, you can now influence the line break behavior of certain words super 's implementation, and set up a regular expression for finding words: circleView​]; ovalFrame.origin.x -= self.textView.textContainerInset.left; ovalFrame.origin.y -= self  List<TextPosition> in the writeString() method contains information regarding the characters, like whether its Unicode, character’s X coordinate, Y coordinate, height, width, x-scaling value, y-scaling value, font size, space width, etc. Extract coordinates or position of characters in pdf