55 lines
1.6 KiB
Swift
55 lines
1.6 KiB
Swift
//
|
|
// NotificationViewController.swift
|
|
// VDSSample
|
|
//
|
|
// Created by Nadigadda, Sumanth on 14/03/23.
|
|
//
|
|
|
|
import Foundation
|
|
import VDS
|
|
|
|
class NotificationViewController: BaseViewController {
|
|
|
|
var notificationView = Notification()
|
|
|
|
lazy var notificationTypePickerSelectorView = {
|
|
PickerSelectorView(title: "Info",
|
|
picker: self.picker,
|
|
items: Notification.NotificationStyle.allCases)
|
|
}()
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
|
|
notificationView.titleText = "Good morning"
|
|
notificationView.subTitleText = "SecondLabel information"
|
|
notificationView.primaryButtonModel = .init(text: "First", onClick: { button in
|
|
print("\(button.text!) button click")
|
|
})
|
|
notificationView.secondaryButtonModel = .init(text: "Second", onClick: { button in
|
|
print("\(button.text!) button click")
|
|
})
|
|
addContentTopView(view: notificationView)
|
|
|
|
setupForm()
|
|
setupPicker()
|
|
}
|
|
|
|
func setupForm() {
|
|
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
|
addFormRow(label: "Style", view: notificationTypePickerSelectorView)
|
|
}
|
|
|
|
func setupPicker() {
|
|
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
|
self?.notificationView.surface = item
|
|
self?.contentTopView.backgroundColor = item.color
|
|
}
|
|
|
|
notificationTypePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
|
self?.notificationView.type = item
|
|
}
|
|
|
|
}
|
|
}
|