user8719510
user8719510

Reputation: 143

How to change SFSafariviewController's Title in swift?

I am Opening web page in Application using SFSafariViewController.

I used below code to open SafariViewController:

  let url = URL.init(string: myURL)
  let safari = SFSafariViewController(url: url!)
  self.presentVC(vc: safari)

It is working fine. But How can I change it's Title? ScreenShot

I have tried below code:

 safari.title = "About Us"

But No Success.

Also search for same but didn't get any answer SFSafariViewController Title.

Upvotes: 4

Views: 3790

Answers (1)

clemens
clemens

Reputation: 17711

As the introduction of the documentation suggests, SFSafariViewController is for securely displaying web content in an app. The user can trust that he doesn't see manipulated web content. If you could change the title, you could foist pages from a wrong domain to the user and that would open the door for phishing attacks.

For this reason, Apple will not have provided any possibility to change the title.

Upvotes: 11

Related Questions