简体   繁体   English

如何快速更改SFSafariviewController的标题?

[英]How to change SFSafariviewController's Title in swift?

I am Opening web page in Application using SFSafariViewController. 我正在使用SFSafariViewController.在Application中打开网页SFSafariViewController.

I used below code to open SafariViewController: 我使用下面的代码打开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 . 也搜索相同但没有任何答案SFSafariViewController Title

As the introduction of the documentation suggests, SFSafariViewController is for securely displaying web content in an app. 正如文档介绍所暗示的那样, SFSafariViewController用于安全地在应用程序中显示Web内容。 The user can trust that he doesn't see manipulated web content. 用户可以相信他看不到操纵的Web内容。 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. 因此,Apple不会提供任何更改标题的可能性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM