extension ViewController {
private func presentPMWevViewAsChild() {
let vc = PMWebViewBuilder.build(
url: url,
output: self
)
pmWebViewInput = vc
addChildViewController(vc)
vc.didMove(toParentViewController: self)
}
private func presentPMWevViewAsModal() {
let vc = PMWebViewBuilder.build(
url: url,
output: self
)
pmWebViewInput = vc
present(vc, animated: true)
}
}
extension ViewController: PMWebViewOutput {
func webViewWillAppear() {
print("webViewWillAppear")
}
func webViewWillDisappear() {
print("webViewWillDisappear")
}
}
More details in Example project
To run the example project, clone the repo, and run pod install
from the Example directory first.
PMWebView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'PMWebView'
PattoMotto
PMWebView is available under the MIT license. See the LICENSE file for more info.