How to Get the Title of a HTML Page Displayed in UIWebView?

前端 未结 7 1160
逝去的感伤
逝去的感伤 2020-12-12 13:28

I need to extract the contents of the title tag from an HTML page displayed in a UIWebView. What is the most robust means of doing so?

I know I can do:



        
相关标签:
7条回答
  • 2020-12-12 14:06

    I dońt have experience with webviews so far but, i believe it sets it´s title to the page title, so, a trick I suggest is to use a category on webview and overwrite the setter for self.title so you add a message to one of you object or modify some property to get the title.

    Could you try and tell me if it works?

    0 讨论(0)
提交回复
热议问题