File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Sources/ComponentsKit/Components/Alert Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,15 @@ public class UKAlertController: UKCenterModalController {
2323 body: { _ in UILabel ( ) }
2424 )
2525
26- self . header = self . titleLabel
27- self . body = self . subtitleLabel
26+ if model. title. isNotNilAndEmpty && model. message. isNotNilAndEmpty {
27+ self . header = self . titleLabel
28+ self . body = self . subtitleLabel
29+ } else if model. title. isNotNilAndEmpty {
30+ self . body = self . titleLabel
31+ } else {
32+ self . body = self . subtitleLabel
33+ }
34+
2835 if model. primaryButton. isNotNil || model. secondaryButton. isNotNil {
2936 self . footer = self . buttonsStackView
3037 }
@@ -82,8 +89,10 @@ public class UKAlertController: UKCenterModalController {
8289 - AlertVM. buttonsSpacing
8390 - self . model. contentPaddings. leading
8491 - self . model. contentPaddings. trailing
92+ let availableButtonWidth = availableButtonsWidth / 2
8593
86- if primaryButtonWidth + secondaryButtonWidth <= availableButtonsWidth {
94+ if primaryButtonWidth <= availableButtonWidth,
95+ secondaryButtonWidth <= availableButtonWidth {
8796 self . buttonsStackView. removeArrangedSubview ( self . secondaryButton)
8897 self . buttonsStackView. insertArrangedSubview ( self . secondaryButton, at: 0 )
8998
You can’t perform that action at this time.
0 commit comments