I have a generic view controller that is used as a base controller for other controllers. Generic type of that base controller is used to determine which type of data is used like so:
public class BaseViewController<T where T: ExampeDataProtocol> : UIViewController {
var data: T?
}
For some reason, when I'm setting my self.data in subclass view controller I get an error.
public class SubClassViewController: BaseViewController<SomeData> {
}
When I debugged, before setting that value, self.data was already set and it was UIView with CGRect(0, 0, 600, 600). How is this even possible?