omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Wrap an Objective C UIView in a ui.View

    Pythonista
    2
    3
    2888
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Webmaster4o
      Webmaster4o last edited by

      If I wanted to create new ui.View subclasses for Objective-C UIView classes, like many of the built-in classes do, what's involved?

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        Best bet is to create a ui.View, add the UIView as a subview. Set the autoresizingMask of the contained to represent flex(). Maybe wrap some attributes in @properties of your custom ui.View to do things to the contained UIview -- thinks like background color perhaps, but not attributes like frame, which you want controlled at the ui.View level.

        1 Reply Last reply Reply Quote 1
        • Webmaster4o
          Webmaster4o last edited by

          Right. I noticed this is how @omz did it in that MapView from a while back. I guess there's a different way to do it but not from Python. Thanks.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors