Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 290
user8719510 Avatar asked Mar 07 '23 23:03

user8719510


1 Answers

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.

like image 130
clemens Avatar answered Mar 15 '23 02:03

clemens