TextView url link --> UIWebView

Discussion in 'iOS Programming' started by iPhoneSpain, Apr 18, 2010.

  1. iPhoneSpain macrumors newbie

    Joined:
    Sep 27, 2009
    #1
    Hi,

    I have a textView which detects links and allows me to click on them. When I do so, current app is closed in order to open safari as usual. I want to load that url inside my app with an UIWebView so the app isn't closed when I click the link (that is kind of annoying!). How can I accomplish that??

    Thanks!
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Push a new view controller into the navigation stack. The view controller should be managing a UIWebView. When it becomes visible tell it to load the URL.

    Unless there is something specific you are stuck with I don't really see what more you want? It seems like a very basic simple thing to do.
     
  3. iPhoneSpain thread starter macrumors newbie

    Joined:
    Sep 27, 2009
    #3
    Yeah I guess it's very simple and I've already loaded UIWebViews into my app. The problem is that I do not know which method is responsible for detecting that I've clicked the link, capture it into a string 4 instance and so, the method where I have to push the new ViewController.

    Do you understand me?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Ah, well that's the bit you said you have. I'm not seeing anything obvious in the documentation.
     
  5. iPhoneSpain thread starter macrumors newbie

    Joined:
    Sep 27, 2009
    #5
    But I have seen lots of programs doing what I am trying to. I think it's very simple. I've come across lots of forums explaining how to detects links inside a UIWebView but I need that inside a textView in order to launch my UIWebView whenever the link is clicked.

    No idea? :(
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    How do you know these other programs are using text views? Could you not load your text into a UIWebView?
     
  7. iPhoneSpain thread starter macrumors newbie

    Joined:
    Sep 27, 2009

Share This Page