Reputation: 117
I would like to create some formatted text using HTML in my OS X program. I am programing in swift. I created a web view and set up a simple test.
import Cocoa
import RealmSwift
import WebKit
class invociegenerator: NSViewController {
@IBOutlet var InvoiceView: WebView!
override func viewDidLoad() {
super.viewDidLoad()
var htmlString:String! = "<br /><h2>Hello World!!</h2>"
InvoiceView.loadHTMLString(htmlString, baseURL: nil)
// Do view setup here.
}
}
I receive an error saying "WebView does not have a member named 'LoadHTMLString'" I must be missing something, is it possible to load from a string in an OS X program? There are plenty of tutorials online but the all focus on iOS.
Upvotes: 1
Views: 2186