Renaming parameters in Notification component
This commit is contained in:
parent
7d14ab1f5c
commit
fee33a17da
@ -35,7 +35,7 @@ public class Notification: View {
|
||||
}
|
||||
}
|
||||
|
||||
public enum ButtonsPosition: String, CaseIterable {
|
||||
public enum ButtonsLayout: String, CaseIterable {
|
||||
case bottom, right
|
||||
}
|
||||
|
||||
@ -138,15 +138,15 @@ public class Notification: View {
|
||||
|
||||
open var type: NotificationStyle = .info { didSet{didChange()}}
|
||||
|
||||
var _buttonPosition: ButtonsPosition = .bottom
|
||||
open var buttonPosition: ButtonsPosition {
|
||||
var _layout: ButtonsLayout = .bottom
|
||||
open var layout: ButtonsLayout {
|
||||
set {
|
||||
if !UIDevice.isIPad, newValue == .right { return }
|
||||
_buttonPosition = newValue
|
||||
buttonsView.buttonPosition = _buttonPosition == .right ? .center : .left
|
||||
_layout = newValue
|
||||
buttonsView.buttonPosition = _layout == .right ? .center : .left
|
||||
didChange()
|
||||
}
|
||||
get { _buttonPosition }
|
||||
get { _layout }
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -218,7 +218,7 @@ public class Notification: View {
|
||||
type = .info
|
||||
typeIcon.name = .infoBold
|
||||
closeButton.name = .close
|
||||
buttonPosition = .bottom
|
||||
layout = .bottom
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -281,7 +281,7 @@ public class Notification: View {
|
||||
labelsView.setCustomSpacing(VDSLayout.Spacing.space3X.value, after: subTitleLabel)
|
||||
|
||||
buttonsView.buttons = buttons
|
||||
labelButtonView.axis = buttonPosition == .bottom ? .vertical : .horizontal
|
||||
labelButtonView.axis = layout == .bottom ? .vertical : .horizontal
|
||||
labelButtonView.addArrangedSubview(buttonsView)
|
||||
|
||||
buttonsView
|
||||
|
||||
Loading…
Reference in New Issue
Block a user