Forum Archive

Access UITableViewAutomaticDimension

arandomperson

Hello! I'm making a UITableView by scratch, and am trying to use the constant "UITableViewAutomaticDimension" for the row heights. But I am having trouble accessing it. I have tried using the C function "CFBundleGetDataPointerForName" and the following,

lib = ctypes.CDLL(None)
print(lib.UITableViewAutomaticDimension)
pointer = ctypes.cast(lib.UITableViewAutomaticDimension, ctypes.c_void_p)
print(objc_util.ObjCInstance(pointer))

Any help would be great!

cvp

@arandomperson try something like

from objc_util import *
x = c.UITableViewAutomaticDimension 
cvp

@arandomperson seems to be a CGFLOAT with value -1

arandomperson

@cvp I Swear I tried that before lol. Thank you so much!

mikael

@arandomperson, just curious, as rolling your own TableView could be a lot of effort: what is additional features you are looking for, compared to the version that comes with Pythonista?

cvp

@mikael For instance, if you want your own action in swipe gesture, like here

mikael

@cvp, thanks. @arandomperson, be sure to check @cvp’s code behind the link, a lot of coding already done there. Also a good example that the content_view can support a lot of custom stuff without going to objc.

arandomperson

@mikael well, ever since the update, UITableViews are always in the native light theme and I want a native dark theme one. Other than that though... maybe I'm just crazy.