Added type picker

This commit is contained in:
Krishna Kishore Bandaru 2024-02-13 22:52:32 +05:30
parent 4cbc1a691b
commit 72046c299c

View File

@ -33,6 +33,10 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
PickerSelectorView(title: "vertical", picker: self.picker, items: Notification.Layout.allCases)
}()
lazy var typePickerSelectorView = {
PickerSelectorView(title: "inLine", picker: self.picker, items: Notification.Type.allCases)
}()
override func viewDidLoad() {
super.viewDidLoad()
addContentTopView(view: component)
@ -54,6 +58,7 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
addFormRow(label: "Surface", view: surfacePickerSelectorView)
addFormRow(label: "Style", view: notificationTypePickerSelectorView)
addFormRow(label: "Layout", view: layoutTypePickerSelectorView)
addFormRow(label: "Type", view: typePickerSelectorView)
addFormRow(label: "Title", view: titleTextField)
addFormRow(label: "SubTitle", view: subTitleTextField)
addFormRow(label: "Hide Button Group", view: buttonGroupToggle)
@ -124,6 +129,14 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
self.layoutTypePickerSelectorView.set(item: self.component.layout)
}
}
typePickerSelectorView.onPickerDidSelect = { [weak self] item in
guard let self else { return }
self.component.type = item
if self.component.type != item {
self.layoutTypePickerSelectorView.set(item: self.component.layout)
}
}
}
func setupButtons(with firstButtonText: String? = nil, secondButtonText: String? = nil) {