I am looking for a way to extend an existing class with new variables without creating my own new class, e.g. add an NSIndexPath to UITableViewCell to be able to access row or section without the use of tags.
I known i can add new functions with an extension
extension UITableViewCell {
// i can do this
func myExtendedFunction() {}
// but this is not possible
var indexPath:NSIndexPath
}
Is there a way to do this, or do i always have to build my own classes?