Christian Sousa
05/18/2020, 11:26 AMlet label = UIView()
label.frame.origin.x = ...
I cant seem to find where I can update the x
in kotlin..Artyom Degtyarev [JB]
05/18/2020, 1:43 PMmemScoped {
val view = UIView()
val rect = view.frame()
val oldFrame = rect.getPointer(this).pointed
oldFrame.origin.x += 10
val newFrame :CValue<CGRect> = CGRectMake(oldFrame.origin.x, oldFrame.origin.y, oldFrame.size.width ,oldFrame.size.height )
view.setFrame(newFrame)
}
This can be an overkill in some moments, but. I’m not sure one can do something easier with CValue<...>
.Christian Sousa
05/19/2020, 11:33 AMuseContents
but found it too cumbersome to work with.
Either way, I was using constraints, so it was just a matter of putting up the constraint for the leftAnchor
as a variable and update it accordingly.