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.
Converting UIView to _ui.View and viceversa
-
Hi,
Can someone tell me (if possible) how to convert an objcutil generated view(UIView) to a ui module version(_ui.View).If not possible, how to present a UIView inside a sheet/popover/panel?
Thanks in advance
Filippo -
You cannot convert from ObjC to ui, but you can add as a subview, by using the ObjCInstance of your ui parent view
import ui from objc_util import * objc_label=ObjCClass('UILabel').alloc().initWithFrame_(CGRect(CGPoint(0,0),CGSize(200,50))).autorelease() objc_label.setText_('this is the objc label') ui_view=ui.View(frame=(0,0,200,200)) ObjCInstance(ui_view).addSubview_(objc_label) ui_view.present('popover')
-
It is good for my needs anyway :-)
Thank you very much :-)