ios - 在 popup-webview 中打开链接,例如 Twitter

标签 ios swift uiwebview popup storyboard

Twitter 在一种从底部跳转到全屏模式的应用内浏览器中打开链接,请参见以下屏幕截图:

enter image description here

我怎样才能在我自己的应用程序中得到这样的东西?我不知道这是怎么称呼的,所以我目前的谷歌搜索结果没有解决我的问题。我不确定这是 webview 或 safari 扩展使用还是其他。

我也想知道如何在 xcode-storyboard 中实现它。我是否应该创建一个新的 viewcontroller 以全屏 webview 跳到前面?我希望有人可以给我一个示例或网站,并提供教程/解释。

[最好是swift中的例子,本人对Objective_C了解不多]

最佳答案

SVWebViewController使这变得非常简单,它是一个带有所有标准功能的嵌入式浏览器 View Controller 。

objective-c :

SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithAddress:@"http://google.com"];
[self presentViewController:webViewController animated:YES completion:NULL];

swift :

let webViewController = SVModalWebViewController(address: "http://google.com")
self.presentViewController(webVC, animated: true, completion: nil)

关于ios - 在 popup-webview 中打开链接,例如 Twitter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27636341/

相关文章:

iphone - didSelectRowAtIndexPath 在极少数情况下被调用或大多数时间不被调用

ios - 用于 iOS 测试版应用程序分发的 Fabric Beta 与 Apple TestFlight?

iphone - UIWbView 在 iPhone SDK 中使用 UIProgressView 加载多个 URL

string - UIWebView 崩溃从 HTML 加载链接

ios - 检测拦截UIWebView中的视频播放

ios - 在 UIView 中检测对角滑动手势

ios - 从列表中选择最近的 3 个日期

ios - ViewController 上的框架

ios - 为特定时间设置本地通知

swift - NSURLSession/NSURLConnection HTTP 加载失败(kCFStreamErrorDomainSSL,-9843) fatal error : unexpectedly found nil while unwrapping an Optional value