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.
ObjCClass('SUIViewController') does not work anymore in Pythonista beta but ...
-
In Pythonista beta, the SUIViewController class does not exist anymore in objc_util but it has been replaced by SUIViewController_PY3.
For instance, this little script works
# UIReferenceLibraryViewController # display definition of a word from system dictionaries # nb: system display is allowed but not to get the result... from objc_util import * import ui uiview = ui.View() uiview.frame = (0,0,300,300) uiview.present('sheet') objc_uiview = ObjCInstance(uiview) SUIViewController = ObjCClass('SUIViewController_PY3') vc = SUIViewController.viewControllerForView_(objc_uiview) @on_main_thread def m(): UIReferenceLibraryViewController = ObjCClass('UIReferenceLibraryViewController').alloc().initWithTerm_('bonjour') UIReferenceLibraryViewController.setModalPresentationStyle_(3) vc.presentViewController_animated_completion_(UIReferenceLibraryViewController, True, None)#handler_block) m()
Note also that the m def code now needs to be run in main thread, what was not needed before.
-
@ihf in outline.py, replace
SUIViewController = ObjCClass('SUIViewController')
By
SUIViewController = ObjCClass('SUIViewController_PY3')
and the script will go a little bit further
That will be in the future next version V01.37 when all will be ok, thus, sincerely, unknown target date
-
@cvp FWIW, I think the PY3 versions were available in the last version. So that code should also be backwards compatible.
-
@JonB said
FWIW, I think the PY3 versions were available in the last version. So that code should also be backwards compatible.
It is probable but the class name without _PY3 has disappeared only from the beta