Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8831943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:25:14+00:00 2026-06-14T08:25:14+00:00

How to simulate tap event on UIWebView? I just need to process mouse down+up

  • 0

How to simulate tap event on UIWebView? I just need to process mouse down+up events by page scripts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:25:16+00:00Added an answer on June 14, 2026 at 8:25 am

    I am not sure whether this is possible with public APIs. Using private APIs, this is possible as mentioned here synthesizing-touch-event-on-iphone. You will not be able to use this in appstore app though.

    Another possible way to do this is by using a javascript. Not sure this is exactly what you wanted. It can be done using javascript as mentioned here,

    function simulate(element, eventName)
        {
            var options = extend(defaultOptions, arguments[2] || {});
            var oEvent, eventType = null;
    
            for (var name in eventMatchers)
            {
                if (eventMatchers[name].test(eventName)) { eventType = name; break; }
            }
    
            if (!eventType)
                throw new SyntaxError('Only HTMLEvents and MouseEvents interfaces are supported');
    
            if (document.createEvent)
            {
                oEvent = document.createEvent(eventType);
                if (eventType == 'HTMLEvents')
                {
                    oEvent.initEvent(eventName, options.bubbles, options.cancelable);
                }
                else
                {
                    oEvent.initMouseEvent(eventName, options.bubbles, options.cancelable, document.defaultView,
              options.button, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
              options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, element);
                }
                element.dispatchEvent(oEvent);
            }
            else
            {
                options.clientX = options.pointerX;
                options.clientY = options.pointerY;
                var evt = document.createEventObject();
                oEvent = extend(evt, options);
                element.fireEvent('on' + eventName, oEvent);
            }
            return element;
        }
    
        function extend(destination, source) {
            for (var property in source)
              destination[property] = source[property];
            return destination;
        }
    
    var eventMatchers = {
        'HTMLEvents': /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
        'MouseEvents': /^(?:click|dblclick|mouse(?:down|up|over|move|out))$/
    }
    var defaultOptions = {
        pointerX: 0,
        pointerY: 0,
        button: 0,
        ctrlKey: false,
        altKey: false,
        shiftKey: false,
        metaKey: false,
        bubbles: true,
        cancelable: true
    }
    

    and then use,

    simulate(document.getElementById("btn"), "click");
    

    You can try to execute javascript by implementing the UIWebView's delegate method webViewDidFinishLoad: in your UIViewController and in there you call [webview stringByEvaluatingJavaScriptFromString:@"methodName()"];. Check if that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

or How to simulate a home button pressed event? I need to restart my
just a quick question guys, how can I simulate a tap on the back
I was wondering if it is possible to simulate the doulbe tap event. I
I need to simulate a test scenario in which I call the getBytes() method
I need to simulate multiple embedded server devices that are typically used for motor
I want to simulate many key press events. I found a solution by using
I need to simulate the left join effect without using the left join key.
I have this button in an app. I want to simulate a tap on
I need to simulate enums in Python, and did it by writing classes like:
I want to simulate keydown events on a given textarea element in an html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.