diff --git a/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalInterpolationPoint.swift b/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalInterpolationPoint.swift index 1347a849..276e3554 100644 --- a/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalInterpolationPoint.swift +++ b/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalInterpolationPoint.swift @@ -246,8 +246,23 @@ struct AdaptiveModalInterpolationPoint: Equatable { modalView.transform = self.modalTransform; modalView.alpha = self.modalOpacity; - modalView.layer.cornerRadius = self.modalCornerRadius; - modalView.layer.maskedCorners = self.modalMaskedCorners; + modalView.layer.mask = { + let path = UIBezierPath( + shouldRoundRect: modalView.bounds, + topLeftRadius: 20, + topRightRadius: 20, + bottomLeftRadius: 20, + bottomRightRadius: 20 + ); + + let shape = CAShapeLayer(); + shape.path = path.cgPath; + + return shape; + }(); + + //modalView.layer.cornerRadius = self.modalCornerRadius; + //modalView.layer.maskedCorners = self.modalMaskedCorners; }; func apply(toModalWrapperView modalWrapperView: UIView){ diff --git a/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalManager.swift b/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalManager.swift index b50acf20..735460d7 100644 --- a/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalManager.swift +++ b/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalManager.swift @@ -693,13 +693,28 @@ class AdaptiveModalManager { ) ); - AdaptiveModalUtilities.unwrapAndSetProperty( - forObject: modalView, - forPropertyKey: \.layer.cornerRadius, - withValue: self.interpolateModalBorderRadius( - forInputPercentValue: inputPercentValue - ) - ); + // AdaptiveModalUtilities.unwrapAndSetProperty( + // forObject: modalView, + // forPropertyKey: \.layer.cornerRadius, + // withValue: self.interpolateModalBorderRadius( + // forInputPercentValue: inputPercentValue + // ) + // ); + + modalView.layer.mask = { + let path = UIBezierPath( + shouldRoundRect: modalView.bounds, + topLeftRadius: 20, + topRightRadius: 20, + bottomLeftRadius: 20, + bottomRightRadius: 20 + ); + + let shape = CAShapeLayer(); + shape.path = path.cgPath; + + return shape; + }(); AdaptiveModalUtilities.unwrapAndSetProperty( forObject: self.modalBackgroundView,