Reputation: 6228
I have base controller:
public class ListViewController<T>: UIViewController where T: Codable {
@IBOutlet public var indicator: UIActivityIndicatorView!
@IBOutlet public var tableView: UITableView!
@IBOutlet public var searchBar: UISearchBar!
}
and have a sub class with a storyboard which contains the ViewController design:
public class FlightListViewController: ListViewController<FlightItinerary> {}
to connect IBOutlets I am setting ViewController's class to ListViewController. After setting IBOutlets I am setting ViewController's class to FlightListViewController. This was working on iOS 12 until switching to Xcode 11. Now it is working on iOS 13 but crashing on iOS 12 with following error:
Unknown class _TtC9App24FlightListViewController in Interface Builder file.
2019-10-10 10:02:50.248232+0300 App[458:36248] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x12fd3e710> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key indicator.'
Does anyone have the same problem?
UPDATE
This stupid bug seems to be hunting developers since Xcode 5. I have ended up totally ditching xibs and storyboards. I am now programmatically laying out my view. I am also planning to use Texture for my older projects and SwiftUI
for new ones.
Upvotes: 2
Views: 441