Make sure you import UIKit and import WebKit at the top of your source file.
import UIKit
import WebKit