How to declare class attributes in swift, just like UITableViewCell reuse identifiers?
Posted
by
martin
on Stack Overflow
See other posts from Stack Overflow
or by martin
Published on 2014-06-09T15:15:54Z
Indexed on
2014/06/09
15:25 UTC
Read the original article
Hit count: 195
I am trying to declare a reuse identifier associated to a UITableView subclass in swift.
From my understanding I would like to declare an class stored property (not an instance one) so i have access via: MyCustomTableCell.ReuseIdentifer.
Here is what I was trying:
class MyCustomTableViewCell : UITableViewCell {
class let ReuseIdentifier = "MyCustomTableViewCellReuseIdentifier"
}
The compiler mentions that class attributes are not supported yet. How to declare such kind of constants associated to a class type in a clean way?
© Stack Overflow or respective owner