When I try and control, click and drag the WebKit View from my main.Storyboard it just has the blue line but no connection options. I tried it on my UIViewController.h and it gave me connection options. Is this a bug? If so how can I fix it? This is the blue line I am talking about.
Asked
Active
Viewed 959 times
0
-
Make sure that the View Controller in the Storyboard is of the ViewController's type you want to connect to. (See Identitiy inspector) – heyfrank Mar 08 '18 at 17:08
-
Which type is it that I want to connect to? There are a lot of them and it's set on "Default - Swift Source" – Nick Miller Mar 08 '18 at 17:12
-
check if you set the className for that UIViewController – Rashed Mar 08 '18 at 17:12
-
I'm not sure what you mean by that, Md Rashed Pervez. – Nick Miller Mar 08 '18 at 17:37
2 Answers
1
Check if you imported webkit module
import UIKit
import WebKit
Then Connect out let
works for me!
Or try reverse like screen short. First manually write @IBOutlet weak var webView: WKWebView!

Britto Thomas
- 2,092
- 1
- 15
- 28
-
-
Then try reverse. Type "@IBOutlet weak var webView: WKWebView!" manually in swift file and click drag from un connected point of IBOutlet in code to Webview. – Britto Thomas Mar 08 '18 at 17:41
-
I tried that but it's giving me the same connecting blue line with no option to connect it. And If I try to just click the plus button on New Referencing Outlet, it doesn't do anything. – Nick Miller Mar 08 '18 at 17:46
-
1Please toggle Manual to Automatic in your assistant editor. and check wether your storyboard view controller connected to right class!! – Britto Thomas Mar 08 '18 at 17:49
-
1How do I know if they're connected to the right class? I am new to Xcode, sorry. – Nick Miller Mar 08 '18 at 17:58
-
1https://stackoverflow.com/questions/26311000/how-to-connect-viewcontroller-swift-to-viewcontroller-in-storyboard – Britto Thomas Mar 08 '18 at 18:04
-
2Thank you! I feel so dumb right now. I can't believe it was that easy. – Nick Miller Mar 08 '18 at 18:08
0
Why does your view controller containing the WebKit have so many IBOutlets and IBActions?
Is your Storyboard UIViewController correctly connected to it's corresponding UIViewController class? It's most likely this, if it isn't it might simply be a bug, try cleaning the project, closing it and reopening.

Sung
- 434
- 5
- 17
-
I had so many IBOutlets and IBActions because this is a work in progress app. I had tried to make something harder than what it really was. I cleaned it up however it did not fix my problem. – Nick Miller Mar 08 '18 at 17:34
-
Did you do what we have all told you to do and give the storyboard its class? – Sung Mar 08 '18 at 17:40
-
I didn't understand how to do that, but now I do understand what that is. Thank you for your help. – Nick Miller Mar 08 '18 at 18:08