ios - WebKit View 未连接到 ViewController(Control + 拖动)

标签 ios swift xcode

当我尝试控制时,从我的 main.Storyboard 单击并拖动 WebKit View ,它只有蓝线,但没有连接选项。我在 UIViewController.h 上尝试了它,它给了我连接选项。这是一个错误吗?如果是这样我该如何修复它? This is the blue line I am talking about.

最佳答案

检查是否导入了webkit模块

import UIKit
import WebKit

然后连接让
为我工作!

Ctrl+Click and drag to view controller

Release click where ever in side view controller when you see "Insert outlet message with collection line"

或者尝试像屏幕短路一样反向。首先手动写入 @IBOutlet 弱 var webView: WKWebView!

然后单击从代码拖动到Webview Write IBOutlet manually

关于ios - WebKit View 未连接到 ViewController(Control + 拖动),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49178648/

相关文章:

ios - 在 View Controller Xcode 之间滚动

ios - xcode中的已读和未读消息

ios - 带有多个子ManagedObjectContexts和NSManagedObjectContextDidSaveNotification的罕见崩溃

ios - Trigger.io iOS 插件从回调返回数据

java - APN 证书之间的差异

android - 找不到 TextInput 功能文档?

ios - 使用 Swift 的 NSLocalization + Storyboard

ios - 如何让 UIBarButtonItem 打开一个新的 View Controller swift 3

ios - 单击按钮重置重新排序的 TableView 行

ios - 应用程序运行时 swift sourceApplication 不工作