项目需求:
要求在手机app中加载webview界面,webView中展现的内容是ppt课件,我们需要实现的是,点击按钮触发webView呈现的ppt翻页,来实现oc和webview的交互!
需求分析:
实现oc和webview的交互 比较简单 代码:
let nextSlide = "frame.nextSlide()" // frame.nextSlide() 是h5 中提供的方法
webView.stringByEvaluatingJavaScript(from: nextSlide) // 触发实现oc和webview的交互
了解更重要 (看图说话)


测试的h5(ppt):http://dean-uploads.oss-cn-qingdao.aliyuncs.com/ppj/2016/12/19/XSm65uh96GGHrwsN/index.html
网友评论