Setting up notification class to test

This commit is contained in:
Sumanth Nadigadda 2023-03-15 23:06:15 +05:30
parent 5bde0c5fa1
commit 68f5da116d
3 changed files with 64 additions and 1 deletions

View File

@ -32,6 +32,7 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
445BA07A29C088470036A7C5 /* NotificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 445BA07929C088470036A7C5 /* NotificationViewController.swift */; };
5FC35BE928D5235A004EBEAC /* ButtonViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FC35BE828D5235A004EBEAC /* ButtonViewController.swift */; };
EA0FC2C12912DC5500DF80B4 /* TextLinkCaretViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0FC2C02912DC5500DF80B4 /* TextLinkCaretViewController.swift */; };
EA3C3B9D289966EF000CA526 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3C3B9C289966EF000CA526 /* AppDelegate.swift */; };
@ -113,6 +114,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
445BA07929C088470036A7C5 /* NotificationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationViewController.swift; sourceTree = "<group>"; };
5FC35BE828D5235A004EBEAC /* ButtonViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonViewController.swift; sourceTree = "<group>"; };
EA0FC2C02912DC5500DF80B4 /* TextLinkCaretViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextLinkCaretViewController.swift; sourceTree = "<group>"; };
EA3C3B99289966EF000CA526 /* VDSSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VDSSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
@ -297,6 +299,7 @@
EA5E305B295111050082B959 /* TileletViewController.swift */,
EA5E30542950EA6E0082B959 /* TitleLockupViewController.swift */,
EA3C3BB328996775000CA526 /* ToggleViewController.swift */,
445BA07929C088470036A7C5 /* NotificationViewController.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
@ -452,6 +455,7 @@
EA3C3BB628996775000CA526 /* MenuViewController.swift in Sources */,
EA3C3B9D289966EF000CA526 /* AppDelegate.swift in Sources */,
EA5E3050294D11540082B959 /* TileContainerViewController.swift in Sources */,
445BA07A29C088470036A7C5 /* NotificationViewController.swift in Sources */,
EAF7F11A28A14A0E00B287F5 /* RadioButtonViewController.swift in Sources */,
EA89204628B66CE2006B9984 /* ScrollViewController.swift in Sources */,
EA3C3B9F289966EF000CA526 /* SceneDelegate.swift in Sources */,

View File

@ -88,7 +88,8 @@ class MenuViewController: UITableViewController {
MenuComponent(title: "TileContainer", completed: true, viewController: TileContainerViewController.self),
MenuComponent(title: "Tilelet", completed: false, viewController: TileletViewController.self),
MenuComponent(title: "TitleLockup", completed: true, viewController: TitleLockupViewController.self),
MenuComponent(title: "Toggle", completed: true, viewController: ToggleViewController.self)
MenuComponent(title: "Toggle", completed: true, viewController: ToggleViewController.self),
MenuComponent(title: "Notification", completed: false, viewController: NotificationViewController.self)
]
override func numberOfSections(in tableView: UITableView) -> Int {

View File

@ -0,0 +1,58 @@
//
// 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.titleLabel.text = "Good morning"
notificationView.subTitleLabel.text = "SecondLabel information"
let firstButton = Button()
firstButton.use = .secondary
firstButton.size = .small
let secondButton = Button()
secondButton.use = .primary
secondButton.size = .small
notificationView.buttonsView.buttons = [firstButton,secondButton]
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
}
}
}