I have created a project with a view controller, which is set to be the initial one. There is another view controller which is a subclass of UITableViewController which is presenting a subclass of UITableViewCell which has a single outlet to an image view.
A button on the initial view controller presents the table view controller which in the 'willDisplayCell' method is setting an animation on the transformation property of the image outlet of a cell. It doesn't work on when the tableview is presented as a card (modalPresentationStyle == .automatic) and it works when modalPresentationStyle == .fullScreen
Is this a UIKit bug? My configuration is Xcode 12.4 (iOS 14.4)
override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "cel") as? CustomCell {
fatalError()
}
UIView.animate(withDuration: 0.2, delay: 0, options: [.repeat, .autoreverse]) {
cell.customImage.transform = .init(scaleX: 1.2, y: 1.2)
}
}
class CustomCell {
@IBOutlet private(set) var customImage: UIImageView!
}