I refactored some code into its own Swift Package. Part of it is a table view cell as .xib file, which I put in a Resources
folder.
Two issues now came up which were not there before I refactored everything into its own Swift Package:
A) The constraints of the label in the cell are simply ignored, the text is at the top of the cell, while its supposed to be in the middle:
It looks like this though in the simulator:
B) Another issue which came up is that inside the class of that cell, the following code throws an error:
@IBOutlet weak var resultTextLabel: UILabel! // this is the label
override func awakeFromNib() {
super.awakeFromNib()
resultTextLabel.adjustsFontSizeToFitWidth = true // this line leads to the error
}
'NSUnknownKeyException', reason: '[<UITableViewCell 0x156f06570> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key resultTextLabel.'
A simple refactoring into a Swift Package shouldn't break things like this.
Question: What's happening here? How can I make sure the constraints are working again? Why can't I adjust the textlabel font size option inside awakeFromNib
anymore?