14
16

More than 5 years have passed since last update.

UIWebViewでサイトタイトルとURLを取得する

Posted at

タイトルを取得する

NSString* title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"];

URLの取得

NSString* url = [webView stringByEvaluatingJavaScriptFromString:@"document.URL"];

これにUIPasteboard - 【Objective-C】クリップボードにコピー - Qiita [キータ]を組み合わせて、
変数urlを渡せば、WebViewによくある機能、「URLをコピー」は簡単に実装できる。

14
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
16