pixelbitlabs
pixelbitlabs

Reputation: 1934

Detect if UIWebView is showing www.example.com link

How can I do an if statement to check if UIWebView is displaying a certain page or not?

Thanks,

James

Upvotes: 0

Views: 379

Answers (2)

PengOne
PengOne

Reputation: 48398

currentURL = webView.request.URL.absoluteString;
NSLog(@"%@",([currentURL isEqualToString:desiredURL] ? @"YES" : @"NO")];

Upvotes: 1

Frank Schmitt
Frank Schmitt

Reputation: 30765

You could try using the url property of the request - see SO for an example But I'm not sure how you could handle different encodings of the same URL or IP addresses instead of FQDN's.

Upvotes: 1

Related Questions