Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Slide down in present sheet mode close my view
-
I’ve not been using Pythonista for a long time, ios version have changed and now I have some problems with my scripts :
The first is that my keyboard loose the extra line at the top, but I’ve seen on the forum that I’m the only one ;-) the second (but my search on the forum does’nt help me to find a solution - my bad english is really a problem) is that now a view in sheet mode close when I slide down with one finger. I would like to block this process.
Thanks for a solution ! -
@Enez-Houad said:
view in sheet mode close when I slide down with one finger.
Whaaa, I did not remark this problem...
-
Looks like there is a property on the view controller
@cvp, do you recall if we have access to the view controller before it is presented?
-
@Enez-Houad, this is an iPhone problem, and the easy fix is to
present
with 'fullscreen', not 'full_screen' as you probably have. The latter is considered to be an unknown value in the current Pythonista version, and thus we default to 'sheet', which is the behaviour you are seeing. -
@mikael, this is not only a iPhone problem as it appears on my iPad mini 4 with both orientations : portrait and landscape.
It's a pity that there is no other solution than to use a fullscreen present mode as I only wanted to present a choice view with a tableView, never mind I will adapt ! -
@Enez-Houad, sorry, I was under the impression that it behaves differently on iPad. But do not despair, the game does not have to be over yet.
-
@JonB said:
do you recall if we have access to the view controller before it is presented
Sorry, I don't remember
-
-
iOS 13 , not 14... Found this here
One part of fixing this issue is a new view controller property: isModalInPresentation. From the header documentation:
modalInPresentation is set on the view controller when you wish to force the presentation hosting the view controller into modal behavior. When this is active, the presentation will prevent interactive dismiss and ignore events outside of the presented view controller’s bounds until this is set to NO.
To get iOS 12-like behaviour for my Settings screen on iOS 13, I could just set isModalInPresentation to true for the modally-presented navigation controller. If the user tries to swipe down to dismiss, the view controller moves slightly but resists the user’s action and cannot be dismissed.@JonB sorry, I did find this topic just before to read the link you pointed to
-
@Enez-Houad try this
import ui from objc_util import * v = ui.View() v.frame = (0,0,300,300) v.background_color ='white' v.present('sheet') ObjCInstance(v).nextResponder().setModalInPresentation_(True)
@JonB must be set after presentation
-
@cvp Perfect, it works for me 👍 always so impressive 👏