swift - Remove menu for tel-links in WkWebView - Stack Overflow

How do I remove the context menu when a user taps a "tel:" link in a WkWebView on iOS?I'

How do I remove the context menu when a user taps a "tel:" link in a WkWebView on iOS?

I've tried to override the buildMenu in the WkWebView, but i can't find the appropriate identifier.

override func buildMenu(with builder: UIMenuBuilder) {
        // super.buildMenu(with: builder)
        
        // List of system menu identifiers to remove
        let menuIdentifiers: [UIMenu.Identifier] = [
            .file,
            .edit,
            .view,
            .window,
            .help,
            .format,
            .toolbar,
            .newScene,
            .preferences,
            .about,
            .services,
            .hide,
            .quit,
            .print,
            .undoRedo,
            .standardEdit,
            .find,
            .text,
            .textStyle,
            .writingDirection,
            .substitutions,
            .spelling,
            .lookup,
            .transformations,
            .speech,
            .share
        ]
        
        // Remove each menu
        for identifier in menuIdentifiers {
            builder.remove(menu: identifier)
        }
    }

Thanks, Martin

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744224824a4563954.html

相关推荐

  • swift - Remove menu for tel-links in WkWebView - Stack Overflow

    How do I remove the context menu when a user taps a "tel:" link in a WkWebView on iOS?I'

    8天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信