WKWebview is not working in Xcode 11

Hello

Recently i've tried to integrate a webview in my app

and while i tried to make the url for the web view but it doesn't work, Xcode says to me that (

webView?.load(request)

"

it says to me this

"/ Extraneous '}' at top level"

Extraneous '}' at top level

Expected 'func' keyword in instance method declaration

Expected '(' in argument list of function declaration

Consecutive declarations on a line must be separated by ';'

Expected declaration In declaration of 'ViewController'

: Expected '{' in body of function declaration

Invalid redeclaration of 'webView()'

'webView' previously declared here

i'm a newbie in developmment and I don't know that much how to debug code,

this my webview code that i did before this line

import UIKit
import WebKit
class ViewController: UIViewController {
    @IBOutlet weak var webView:WKWebView?
let request = URLRequest(url: URL(string: "https://www.exampleurl.com")!)

You have an unmatched/extra } somewhere. Might be as easy as simply selecting the one it points out and deleting it.


Show more code....unless it's more than a few dozen lines, show all of it from the file that caused the error.

There must be some code between lines 4 and 5 ?


Search in these lines.


Doing a ctrl-I to force formatting the whole file in XCode could directly point you to the problem.

WKWebview is not working in Xcode 11
 
 
Q