Brian,
Oh, I used your lovely anchor extension in the TodayController to set up the saved constrains for the fullscreenView (was named the redView) and used a small CGRect extension:
extension CGRect {
var topLeftEdge: UIEdgeInsets {
return .init(top: self.origin.y, left: self.origin.x, bottom: 0, right: 0)
}
}
override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
...
guard let cell = collectionView.cellForItem(at: indexPath) else { return }
guard let startingFrame = cell.superview?.convert(cell.frame, to: nil) else { return }
self.startingFrame = startingFrame
let anchors = fullscreenView.anchor(top: view.topAnchor, leading: view.leadingAnchor, padding: startingFrame.topLeftEdge, size: startingFrame.size) // This works pretty good! Oh, the bottom and trailing were defaulted to nil
(topConstraint, leadingConstraint, widthConstraint, heightConstraint) = (anchors.top, anchors.leading, anchors.width, anchors.height) // Save the constraints for later ...
self.view.layoutIfNeeded()
Thanks