# Detecting iPhone X swipe up from bottom (DEF-3870)(SOLVED)

**URL:** <https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625>\
**Category:** Questions\
**Created:** [February 26, 2019, 11:44am UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625 "2019-02-26T11:44:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [February 26, 2019, 11:44am UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/1 "2019-02-26T11:44:42Z")

</div>

Touches get “stuck” when swiping up on an iPhone X in my game. I’m trying to catch it (unsuccesfully) with this code:

```
local function window_callback(self, event, data)
	if event == window.WINDOW_EVENT_FOCUS_LOST then
		is_touching_screen = false -- Not triggered on iPhone X swipe up
	end
end

window.set_listener( window_callback )

```

I also use this code:

```
function on_input(self, action_id, action)

	if action.pressed then
		is_touching_screen = true
	elseif action.released then
		is_touching_screen = false -- Not triggered on iPhone X swipe up
	end

end

```

Neither seem to fix the problem. Any other options available, or should I wave the unfixable red flag?

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [March 20, 2019, 9:52pm UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/2 "2019-03-20T21:52:25Z")

</div>

Bump!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 21, 2019, 4:57am UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/3 "2019-03-21T04:57:22Z")

</div>

Hmm, we need to investigate this. @AGulev, maybe we can take a look at this today? This might have to do with touch detection outside of the safe areas of the phone. @sven?

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [March 25, 2019, 1:09pm UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/4 "2019-03-25T13:09:19Z")

</div>

We are working on this issue, no ETA. In our internal tracker, this issue is DEF-3870

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [March 25, 2019, 1:09pm UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/5 "2019-03-25T13:09:52Z")

</div>

Great, thanks! Let me know if I can help test.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [March 26, 2019, 9:39am UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/6 "2019-03-26T09:39:50Z")

</div>

On our side, we can fix an issue with event “stuck” but you should to implement respecting of Apple guidelines about “safe area” yourself [Layout | Apple Developer Documentation](https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/)

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [March 27, 2019, 9:26am UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/7 "2019-03-27T09:26:41Z")

</div>

Thanks, that’s a great link. Is there a way to get the safe areas in Defold? In my game I prevent taps at the bottom, using a value guesstimated by me.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 27, 2019, 9:31am UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/8 "2019-03-27T09:31:30Z")

</div>

> [@totebo](#):
>
> Is there a way to get the safe areas in Defold?

Yes. @sven created this extension a while back: [GitHub - defold/extension-safearea: Simple native extension library for Defold that will change the view/render of a game to fit into the safe area on newer iPhones. · GitHub](https://github.com/defold/extension-safearea)

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [March 27, 2019, 9:33am UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/9 "2019-03-27T09:33:11Z")

</div>

> [@britzl](#):
>
> Yes. @sven created this extension a while back: [GitHub - defold/extension-safearea: Simple native extension library for Defold that will change the view/render of a game to fit into the safe area on newer iPhones. · GitHub](https://github.com/defold/extension-safearea)

I afraid this NE iOS only and as I understand @totebo is talking about html5

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [March 27, 2019, 9:35am UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/10 "2019-03-27T09:35:41Z")

</div>

> [@britzl](#):
>
> Yes. @sven created this extension a while back: [https://github.com/defold/extension-safearea](https://github.com/defold/extension-safearea)

Nice!

> [@AGulev](#):
>
> I afraid this NE iOS only and as I understand @totebo is talking about html5

Ah yes, it’s for Facebook Instant. Damn this muddling of platforms!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 27, 2019, 9:38am UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/11 "2019-03-27T09:38:40Z")

</div>

Ah, yes, true. There’s probably a way to get the safe areas in HTML5. Maybe something like this:

> **[safe-area-inset values on iOS11 - QuirksBlog](https://www.quirksmode.org/blog/archives/2017/10/safeareainset_v.html)**

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [April 1, 2019, 12:45pm UTC](https://forum.defold.com/t/detecting-iphone-x-swipe-up-from-bottom-def-3870-solved/44625/12 "2019-04-01T12:45:12Z")

</div>

Solved in[1.2.150](https://forum.defold.com/t/defold-1-2-150-has-been-released/47998)
