Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dexter Miguel
    @divmgl
    @colinta is there any way to retrieve a constraint after it has already been made and you've lost the reference to it?
    keeping a reference throws a WeakRef err
    Dexter Miguel
    @divmgl
    for now i'll just create the cell every time and set the constraints afterwards, but it would nice to know why the constraint is collected by the GC!
    Colin T.A. Gray
    @colinta
    @divmgl if you can post some code somewhere, I can try to take a look. cells have always been a sore spot in mkit.
    Dexter Miguel
    @divmgl
    eh
    i'm sure my code is absolute shit
    at this point i'm trying to contain everything inside of a UIView and then place it inside a UITableViewCell instead of having like eight subviews in the UITableViewCell
    i'm basically just trying to use dynamic heights in a UITableViewCell
    like if i have a label with 5 lines i want the UITableViewCell to adjust but holy shit its proving to be such a bitch. i keep running into problems one way or another
    Colin T.A. Gray
    @colinta
    yeah that can be a tricky one
    you're using constraints to "auto size" the cells, or are you using heightForRowAtIndexPath?
    Dexter Miguel
    @divmgl
    autosize and with constraints
    do you think heightforrow would work better?
    Colin T.A. Gray
    @colinta
    dunno, i'm old school so i never use autosize w/ constraints, always heightforrow
    e.g.
    def heightForText(attributedText, tableWidth)
        minHeight = 30.0
        textWidth = tableWidth - (Size.margins.left + Size.margins.right + Size.textMargins.left + Size.textMargins.right)
        tv = generateTextView()
        tv.attributedText = attributedText
        tvSize = tv.sizeThatFits(CGSize.new(textWidth, _000_000))
        heightPadding = Size.margins.top + Size.margins.bottom + Size.textMargins.top + Size.textMargins.bottom
        textHeight = heightPadding + tvSize.height.round()
        return [minHeight, textHeight].max
    end
    that'll size a UITextView
    UILabel is pretty much the same
    Dexter Miguel
    @divmgl
    O_O
    jesus lmao
    yea im gonna have to think about my design a little more ill send you some code in a min
    doing some tests righ tnow
    Dexter Miguel
    @divmgl
    by the way, i appreciate all of your help. i'm flattered that you take a few min out of your day to help me out
    blob
    blob
    so basically, i layout everything here using constraints and then i call
    blob
    Dexter Miguel
    @divmgl
    sorry i can't copy/paste from vnc lol at work rn
    making a reddit client and its going well just having a few issues with constraints here and there. i would say like 80% of my time i'm messing around with the constraints trying to get them to work
    i usually can go around this by adding preferred_max_layout_width but i'm having a tough time getting the width of the label from inside of the UITableViewCell
    welp, look like i fixed it
    blob
    Dexter Miguel
    @divmgl
    preferred_max_layout_width superview.frame.size.width
    Colin T.A. Gray
    @colinta
    nice!
    Dexter Miguel
    @divmgl
    now im running into another problem...if the text for the string is too long it completely disappears -_-. why is this so inconsistent lol
    so have you released any apps into production on rubymotion?
    Colin T.A. Gray
    @colinta
    oh yeah, a few, Jukely was a big one
    Dexter Miguel
    @divmgl
    Dude this is a seriously impressive app
    Holy fucking shit
    Dexter Miguel
    @divmgl
    so you mentioned to me that you build all of your UITableViewCell manually?
    i'm still having a really tough time with this and I'm thinking of letting go of building UITableViewCells with MotionKit layouts
    making UITableViewCells work with autolayout is extremely tough in rubymotion
    The Crab
    @theCrab
    So. This is a dead channel then? Where's the official RubyMotion channel?
    How do I check if a string.empty? In RM
    Aleksandr Lossenko
    @egze
    "string".empty?
    rubymotion channel is in rubymotion/rubymotion
    The Crab
    @theCrab
    RM doesn't support empty? yet
    @egze thanks for that channel name, but ^^^
    Aleksandr Lossenko
    @egze
    how about "string".length > 0 ?
    The Crab
    @theCrab
    That's the way to go.
    @egze just checking. It's not working either. Version 4.9