From e1f6db4ec1964788e6f9d87e9c03dcc30a253c76 Mon Sep 17 00:00:00 2001 From: Dominic Go <18517029+dominicstop@users.noreply.github.com> Date: Wed, 7 Jun 2023 01:24:11 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Update:=20Exp=20-=20`AdaptiveMod?= =?UTF-8?q?al`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert prev/ commit. --- .../AdaptiveModalInterpolationPoint.swift | 19 ++---------- .../AdaptiveModal/AdaptiveModalManager.swift | 29 +++++-------------- 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalInterpolationPoint.swift b/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalInterpolationPoint.swift index 276e3554..1347a849 100644 --- a/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalInterpolationPoint.swift +++ b/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalInterpolationPoint.swift @@ -246,23 +246,8 @@ struct AdaptiveModalInterpolationPoint: Equatable { modalView.transform = self.modalTransform; modalView.alpha = self.modalOpacity; - 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; + 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 735460d7..b50acf20 100644 --- a/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalManager.swift +++ b/experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalManager.swift @@ -693,28 +693,13 @@ class AdaptiveModalManager { ) ); - // 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: modalView, + forPropertyKey: \.layer.cornerRadius, + withValue: self.interpolateModalBorderRadius( + forInputPercentValue: inputPercentValue + ) + ); AdaptiveModalUtilities.unwrapAndSetProperty( forObject: self.modalBackgroundView,