Pydia Installer.py: https://gist.github.com/bmw1821/d9883042b95a818e6429
Source Code: https://gist.github.com/bmw1821/bc2ccf257d60804be010
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.
I made a module based on your code: https://gist.github.com/d44b83d80f2f77e4f832
To run it you just call authenticate()
with an optional string if you want to supply a reason. It will return True
if the user authenticated (with either TouchID or passcode) and False
if it was cancelled.
I am working on a Pythonista script that displays a UITabBarController, which contains multiple UINavigationControllers, containing UITableViewControllers. At some point I need to display a UIAlertController, but all the methods I've tried to present it either crash the app or push the UIAlertController to the navigation stack.
My code:
from objc_util import *
from UIKit import *
alert = UIAlertController.alertControllerWithTitle_message_preferredStyle_('Title', 'Message', 0)
def alertActionCancel(sender):
print 'Cancelled!'
alertActionCancelBlock = ObjCBlock(alertActionCancel, None, [c_void_p])
retain_global(alertActionCancelBlock)
alert.addAction_(UIAlertAction.actionWithTitle_style_handler_('Cancel', 1, alertActionCancelBlock))
myTableViewController.presentViewController_animated_completion_(alert, True, None) # This line crashes Pythonista
Thanks in advance, any help is greatly appreciated.
I made a module based on your code: https://gist.github.com/d44b83d80f2f77e4f832
To run it you just call authenticate()
with an optional string if you want to supply a reason. It will return True
if the user authenticated (with either TouchID or passcode) and False
if it was cancelled.
I have tried using SUIViewConrroller
, but Pythonista still crashes. viewControllerForView_
seems to just return my original view controller.
P.S. This seems to be more of a issue on iPad.
I am working on a Pythonista script that displays a UITabBarController, which contains multiple UINavigationControllers, containing UITableViewControllers. At some point I need to display a UIAlertController, but all the methods I've tried to present it either crash the app or push the UIAlertController to the navigation stack.
My code:
from objc_util import *
from UIKit import *
alert = UIAlertController.alertControllerWithTitle_message_preferredStyle_('Title', 'Message', 0)
def alertActionCancel(sender):
print 'Cancelled!'
alertActionCancelBlock = ObjCBlock(alertActionCancel, None, [c_void_p])
retain_global(alertActionCancelBlock)
alert.addAction_(UIAlertAction.actionWithTitle_style_handler_('Cancel', 1, alertActionCancelBlock))
myTableViewController.presentViewController_animated_completion_(alert, True, None) # This line crashes Pythonista
Thanks in advance, any help is greatly appreciated.