UIContainerView to display a view controller:
Now I am tying to make it full screen when user tap full screen button with this code :
@IBAction func fullscreen(_ sender: Any) {
view.goFullscreen()
}
extension CGAffineTransform {
static let ninetyDegreeRotation = CGAffineTransform(rotationAngle: CGFloat(Double.pi / 2))
}
extension UIView {
var fullScreenAnimationDuration: TimeInterval {
return 0.15
}
func minimizeToFrame(_ frame: CGRect) {
UIView.animate(withDuration: fullScreenAnimationDuration) {
self.layer.setAffineTransform(.identity)
self.frame = frame
}
}
func goFullscreen() {
UIView.animate(withDuration: fullScreenAnimationDuration) {
self.layer.setAffineTransform(.ninetyDegreeRotation)
self.frame = UIScreen.main.bounds
}
}
}
Making view full screen works fine but when viewcontroller is full screen the view stop receiving touch. This happens when I add constraints to the view controller, but when I remove it it works fine. Why this happens and how can I able to both set constraint and receiving touch?

