I am new to Swift. I am getting this error:
Cannot assign to property: 'width' is a get-only property
While using this statement:
cell.reciverMsg.frame.width = cell.reciverMsg.text?.characters.count * 2
reciverMsg
is an UILabel
.
I am new to Swift. I am getting this error:
Cannot assign to property: 'width' is a get-only property
While using this statement:
cell.reciverMsg.frame.width = cell.reciverMsg.text?.characters.count * 2
reciverMsg
is an UILabel
.
You need to set the width
of the frame's size
property.
cell.reciverMsg.frame.size.width = 20
The width
property of frame
is just a read-only convenience. See the documentation for CGRect
for details.
© 2022 - 2024 — McMap. All rights reserved.