[ad_1]
I’ve a WKWebview
that’s if course hooked as much as the file by means of storyboard. You’ll be able to see it’s hooked on this image:
As you see each in storyboard and within the UIViewController
file, the webView
is hooked.
I get a zero from the webView
the primary time I name it within the viewDidLoad
on line 36.
That is the error:
Deadly error: Unexpectedly discovered nil whereas implicitly unwrapping an Non-compulsory worth
How can I get Xcode to acknowledge there’s a internet view??
EDIT
I load the VC like this:
let vc = joinFromInAppViewController()
vc.purchaseDate = purchaseDate
vc.purchaseEndDate = purchaseEndDate
vc.membershipPurchased = membershipPurchased
self.current(vc, animated: true, completion: nil)
The ViewController the place the webView is in:
import UIKit
import WebKit
import RevealingSplashView
import SwiftEntryKit
class joinFromInAppViewController: UIViewController, WKNavigationDelegate {
@IBOutlet weak var webView: WKWebView!
var purchaseDate: Int = 0
var purchaseEndDate: Int = 0
var membershipPurchased: String = ""
let revealingSplash = RevealingSplashView(iconImage: #imageLiteral(resourceName: "RevealingSplashIconImage"), iconInitialSize: CGSize(width: 125, peak: 125), backgroundColor: UIColor(crimson: 225/255, inexperienced: 32/255, blue: 62/255, alpha: 1.0))
var attributesShow = EKAttributes.bottomFloat
let defaults = UserDefaults.commonplace
override func viewDidLoad() {
tremendous.viewDidLoad()
view.addSubview(revealingSplash)
revealingSplash.animationType = SplashAnimationType.heartBeat
let myURL = URL(string: "https://www.google.com")
let myRequest = URLRequest(url: myURL!)
webView.navigationDelegate = self
webView.load(myRequest)
//revealingSplash.startAnimation()
}
}
[ad_2]