Search code examples
iosios7uitextviewuicolor

How to change color of UITextview UIDataDetectorTypeLink?


  1. I am passing some urls to the UITextView and they are detected using UIDataDetectorTypeLink. Now I'm in need to change the color of the link(url) to some uicolor. I have no idea on how to do this.

    Here is the code showing my attempt:

    [textview_Url setEditable:NO];
    [textview_Url setScrollEnabled:NO];
    [textview_Url setDataDetectorTypes:UIDataDetectorTypeLink];
    [textview_Url setText:web];

    It gives blue, and I want to change that color.

  2. By UIDataDetectorTypeLink, a long press only asks conformation to redirect to the link. But I want to show some alert to ask confirmation if someone just touches it. Is there a way to do this ?


Solution

  • Solved

    I have used globalTintColor property of window,

    like,

    self.window.tintColor = [UIColor redColor];
    

    Output:

    enter image description here