ShawnFoo / SwiftWebViewBridge

Swift version of WebViewJavascriptBridge with more simplified and friendly methods to handle messages between Swift and JS in UIWebViews
MIT License
137 stars 34 forks source link

undeclared type SwiftWebViewBridge #14

Closed TheKongBakPau closed 7 years ago

TheKongBakPau commented 7 years ago

I am having an issue getting my project to recognise the SwiftJavaScriptBridge module. It is in my Podfile (version 0.3.0) and I can browse the Pods and see the SwiftJavaScriptBridge folder with SwiftJavaScriptBridge.swift and the Support Files directory there. However when I declare a variable such as:

fileprivate var bridge: SwiftWebViewBridge!

I get the compile error:

Use of undeclared type 'SwiftWebViewBridge'

I have tried setting up a fresh project and encounter the same issue. I can successfully compile and run SwiftWebViewBridgeDemo though.

I even tried not using the Podfile and adding SwiftWebViewBridge.swift directly to my project and the result was still the same.

Is there a project setting I am missing? I don't have a problem with any other Podfiles so I don't think it is a path problem. I am using Swift 3.0. Any help would be greatly appreciated.

ShawnFoo commented 7 years ago

Please import SwiftWebViewBridge module in the file you want to use it. default

TheKongBakPau commented 7 years ago

Thanks, I'm such a doughnut!