Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to set up an invisible UIButton and lay it between the view that should not register touches and the UIButtons that should still be active.</p> <p>Now you need to set the invisible button's 'userInteractionEnabled':</p> <pre><code>//userInteractionEnabled == NO =&gt; self.view registeres touches //userInteractionEnabled == YES =&gt; self.view doesn't register touches [_invisibleButton setUserInteractionEnabled:NO]; </code></pre> <p>What really matters in this solution is that both - the invisible and the visible buttons are direct subviews of the VC's view.</p> <p>You can download an example project from my dropbox: <a href="https://dl.dropboxusercontent.com/u/99449487/DontTapThat.zip" rel="noreferrer">https://dl.dropboxusercontent.com/u/99449487/DontTapThat.zip</a></p> <p>However this example just prevents the handling of certain touches. Completly ignoring input isn't technically possible: Third party apps are not responsible for for <em>detecting</em> input. They are just responsible for <em>handling</em> input. The detection of touch input is done iOS.</p> <p>The only way to build up a case like you describe it in the comments is to hope that iOS won't interpret the input of your case as a "finger" because it's most likely going to cover an area that's way bigger than a finger.</p> <p>So in conclusion the best way would be to change the material of the case you're about to build or at least give it a non conductive coating. From a third party developers point of view there is no way to achieve your goals with software if there is a need for 5 fingers as described in the comments.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COThanks for the code, however I'm afraid it still doesn't do what I need. Yes, it doesn't trigger touchesBegan, however it still registers touch points on the screen. So if you touch the screen with 5 fingers and then use a 6th to tap any of the buttons, it doesn't read. I realise it's a bit of an odd problem..
      singulars
    2. COI'm sorry but I don't have a valid program enrollment at the moment to test that out. I don't know what the problem with registering touchesBegan is for you but I think the easiest way would be to forget about that invisible button and just set up a BOOL indicates whether to use the code inside touchesBegan or not. Like if (_useCode) {} Edit: That is just for that 5th and 6th finger case, right? I think there was something about a finger limit of 5 fingers at the same time on iPhone. The 6th finger would not be registered no matter what you do.
      singulars
    3. COThere is indeed a 5 finger limit, but I was hoping that if you ignored fingers that weren't in the 'correct' place, it would only read the ones that were. But it seems that no matter what you do, it will still read a point of contact with the screen, regardless of whether or not you handle the touch... I'm basically working on a case that covers part of the screen, but is made of conductive material, and I don't want it triggering touch points on the surface. Well, thanks for the suggestions.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload