[ad_1]
I need to cross the parameter width within the selector rotation perform which passes the dimensions.width.
#selector(rotated(width: dimension.width))
However it’s giving me the next error:
Argument of ‘#selector’ doesn’t check with an ‘@objc’ methodology, property, or initializer
Any thought the way to resolve this?
public override func viewWillTransition(to dimension: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
tremendous.viewWillTransition(to: dimension, with: coordinator)
coordinator.animate(alongsideTransition: { _ in
self.setupConstraints()
self.tableView?.reloadTableData()
}, completion: { _ in })
NotificationCenter.default.addObserver(self, selector: #selector(rotated(width: dimension.width)), identify: UIDevice.orientationDidChangeNotification, object: nil)
}
@objc func rotated(width: CGFloat) {
self.widthAnchorConstraint = tableView?.widthAnchor.constraint(equalToConstant: width)
}
[ad_2]