diff --git a/Demo/RootViewController.swift b/Demo/RootViewController.swift index 1549211..c048b95 100644 --- a/Demo/RootViewController.swift +++ b/Demo/RootViewController.swift @@ -48,7 +48,7 @@ final class RootViewController: UIViewController { appearance.font = .boldSystemFont(ofSize: 16) appearance.textInsets = UIEdgeInsets(top: 15, left: 20, bottom: 15, right: 20) appearance.bottomOffsetPortrait = 100 - appearance.cornerRadius = 20 + appearance.cornerRadius = 20 // or use `appearance.cornerRadius(20)` if you are facing `Ambiguous use of cornerRadius` error. appearance.maxWidthRatio = 0.7 } diff --git a/Sources/ToastView.swift b/Sources/ToastView.swift index 0327cd2..914f63f 100644 --- a/Sources/ToastView.swift +++ b/Sources/ToastView.swift @@ -221,4 +221,9 @@ open class ToastView: UIView { return nil } + /// Helper function for setting cornerRadius to avoid conflicting with UIView extension. + @objc public dynamic func cornerRadius(_ cornerRadius: CGFloat) { + self.cornerRadius = cornerRadius + } + }