diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index f24d2bd6..2ed84116 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -58,11 +58,6 @@ open class Notification: View { case vertical, horizontal } - /// Enum used to describe the type of the Notification. - public enum `Type`: String, CaseIterable { - case fullBleed, inLine - } - //-------------------------------------------------- // MARK: - Private Properties //-------------------------------------------------- @@ -177,9 +172,6 @@ open class Notification: View { /// Add this attribute determine your type of Notification. open var style: Style = .info { didSet { setNeedsUpdate()}} - - /// If true, will hide the close button. - open var type: Type = .inLine { didSet { setNeedsUpdate()} } private var _layout: Layout = .vertical @@ -333,7 +325,6 @@ open class Notification: View { open override func updateView() { super.updateView() - layer.cornerRadius = type == .fullBleed ? 0 : 4.0 backgroundColor = backgroundColorConfiguration.getColor(self) updateIcons() updateLabels() @@ -341,6 +332,12 @@ open class Notification: View { setConstraints() } + /// Override to check the screen width to determine cornerRadius + open override func layoutSubviews() { + super.layoutSubviews() + layer.cornerRadius = UIScreen.main.bounds.width == bounds.width ? 0 : 4.0 + } + //-------------------------------------------------- // MARK: - Private Methods //--------------------------------------------------