From f0e9dee1e869a953a8f4e91a60cfee95649f946b Mon Sep 17 00:00:00 2001 From: Sagen Date: Thu, 28 Jul 2016 12:00:40 +0900 Subject: [PATCH] added circular radius to the circleIconView layer after the circleIconView frame is set so that custom icons will be masked accordingly to its circular container view --- SCLAlertView/SCLAlertView.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SCLAlertView/SCLAlertView.swift b/SCLAlertView/SCLAlertView.swift index 4fb7df5..d68aa0a 100644 --- a/SCLAlertView/SCLAlertView.swift +++ b/SCLAlertView/SCLAlertView.swift @@ -671,6 +671,8 @@ public class SCLAlertView: UIViewController { circleView.addSubview(circleIconView!) let x = (appearance.kCircleHeight - appearance.kCircleIconHeight) / 2 circleIconView!.frame = CGRectMake( x, x, appearance.kCircleIconHeight, appearance.kCircleIconHeight) + circleIconView?.layer.cornerRadius = circleIconView!.bounds.height / 2 + circleIconView?.layer.masksToBounds = true for txt in inputs { txt.layer.borderColor = viewColor.CGColor