@rhythmart please, try this little script and tap the share button
import ui
from objc_util import *
class MyView(ui.View):
def __init__(self):
super().__init__(self)
self.background_color = 'white'
b = ui.ButtonItem()
b.title = 'share'
b.action = self.share
self.right_button_items = (b,)
@on_main_thread
def share(self, sender):
vo = ObjCInstance(self)
SUIViewController = ObjCClass('SUIViewController')
root_vc = SUIViewController.viewControllerForView_(vo)
main_view=root_vc.view()
url_array = ['
@rhythmart text']
UIActivityViewController = ObjCClass('UIActivityViewController').alloc().initWithActivityItems_applicationActivities_(url_array,None)
UIActivityViewController.setCompletionHandler_(None)
r = root_vc.presentViewController_animated_completion_(UIActivityViewController, True, None)
UIActivityViewController.popoverPresentationController().sourceView = main_view
UIActivityViewController.popoverPresentationController().sourceRect = CGRect(CGPoint(0,0), CGSize(300,500))
if __name__ == '__main__':
v = MyView()
v.present('fullscreen')
