도래울

swift wkwebview alert 본문

개발/iOS

swift wkwebview alert

도래울 2016. 9. 9. 11:04

func webView(webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String,

                 initiatedByFrame frame: WKFrameInfo, completionHandler: () -> Void) {

        

        let alertController = UIAlertController(title: message, message: nil,

                                                preferredStyle: UIAlertControllerStyle.Alert);

        

        alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Cancel) {

            _ in completionHandler()}

        );

        

        self.presentViewController(alertController, animated: true, completion: {});

    }

'개발 > iOS' 카테고리의 다른 글

cocoapods 최신버전 업데이트  (0) 2016.09.20
swift NSMutableAttributedString text color  (0) 2016.09.09
swift url parsing  (0) 2016.09.09
FBSOpenApplicationErrorDomain error 1  (0) 2016.09.06
ios push 구현  (0) 2016.08.30
Comments