All I need to add an extra variable to UITextView
class .
My First Attempt :
extension UITextView
{
var id : String
}
But it gives an error message Extension may not contain stored properties
!
Second Attempt :
extension UITextView
{
var id : String
{
get { return self.id }
set(newValue) { self.id = newValue }
}
}
But it crushes my app and give an error message Thread 1 : EXC_BAD_ACCESS
when I attempt to assign a value in var id
.
How can I assign value in var id
and print it ?