Merge branch 'feature/tableviewtester' into 'develop'

refactored code for changes

See merge request BPHV_MIPS/vds_ios_sample!48
This commit is contained in:
Bruce, Matt R 2023-09-07 20:26:02 +00:00
commit 02d2e27c6a
5 changed files with 28 additions and 10 deletions

View File

@ -333,8 +333,8 @@
EA985C24296E06EA00F2FF2E /* TextAreaViewController.swift */, EA985C24296E06EA00F2FF2E /* TextAreaViewController.swift */,
EAC9257F29119FC400091998 /* TextLinkViewController.swift */, EAC9257F29119FC400091998 /* TextLinkViewController.swift */,
EA5E304F294D11540082B959 /* TileContainerViewController.swift */, EA5E304F294D11540082B959 /* TileContainerViewController.swift */,
EA5E305B295111050082B959 /* TileletViewController.swift */,
EA5E30542950EA6E0082B959 /* TitleLockupViewController.swift */, EA5E30542950EA6E0082B959 /* TitleLockupViewController.swift */,
EA5E305B295111050082B959 /* TileletViewController.swift */,
EA3C3BB328996775000CA526 /* ToggleViewController.swift */, EA3C3BB328996775000CA526 /* ToggleViewController.swift */,
EAB2375F29E88D5D00AABE9A /* TooltipViewController.swift */, EAB2375F29E88D5D00AABE9A /* TooltipViewController.swift */,
EAB2376B29E9E74900AABE9A /* TrailingTooltipLabelViewController.swift */, EAB2376B29E9E74900AABE9A /* TrailingTooltipLabelViewController.swift */,
@ -679,7 +679,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 40; CURRENT_PROJECT_VERSION = 41;
DEVELOPMENT_TEAM = FCMA4QKS77; DEVELOPMENT_TEAM = FCMA4QKS77;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VDSSample/Info.plist; INFOPLIST_FILE = VDSSample/Info.plist;
@ -711,7 +711,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 40; CURRENT_PROJECT_VERSION = 41;
DEVELOPMENT_TEAM = FCMA4QKS77; DEVELOPMENT_TEAM = FCMA4QKS77;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VDSSample/Info.plist; INFOPLIST_FILE = VDSSample/Info.plist;

View File

@ -138,7 +138,7 @@ class BadgeIndicatorViewController: BaseViewController<BadgeIndicator> {
horizontalPaddingTextField horizontalPaddingTextField
.numberPublisher .numberPublisher
.sink { [weak self] number in .sink { [weak self] number in
self?.component.horitonalPadding = number?.cgFloatValue self?.component.horizontalPadding = number?.cgFloatValue
}.store(in: &subscribers) }.store(in: &subscribers)
verticalPaddingTextField verticalPaddingTextField

View File

@ -236,7 +236,23 @@ public class BaseViewController<Component: UIView>: UIViewController, Initable ,
self?.activeTextField = nil self?.activeTextField = nil
}.store(in: &subscribers) }.store(in: &subscribers)
loadCustomRotors()
NotificationCenter.default.publisher(for: UIAccessibility.voiceOverStatusDidChangeNotification).sink { [weak self] _ in
if UIAccessibility.isVoiceOverRunning {
if let component = self?.component {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self?.loadCustomRotors()
UIAccessibility.post(notification: .screenChanged, argument: component)
}
}
}
}.store(in: &subscribers)
// Initially register the custom rotor if VoiceOver is on
if UIAccessibility.isVoiceOverRunning {
loadCustomRotors()
UIAccessibility.post(notification: .screenChanged, argument: component)
}
} }
func isViewHiddenByKeyboard(view: UIView, keyboardFrame: CGRect) -> Bool { func isViewHiddenByKeyboard(view: UIView, keyboardFrame: CGRect) -> Bool {
@ -286,7 +302,7 @@ public class BaseViewController<Component: UIView>: UIViewController, Initable ,
open func addContentTopView(view: UIView, edgeSpacing: CGFloat = 16.0) { open func addContentTopView(view: UIView, edgeSpacing: CGFloat = 16.0) {
view.translatesAutoresizingMaskIntoConstraints = false view.translatesAutoresizingMaskIntoConstraints = false
contentTopView.addSubview(view) contentTopView.addSubview(view)
view.pinToSuperView(.init(top: edgeSpacing, left: edgeSpacing, bottom: edgeSpacing, right: edgeSpacing)) view.pinToSuperView(.uniform(edgeSpacing))
} }
open func append(section: FormSection) { open func append(section: FormSection) {

View File

@ -63,10 +63,11 @@ class MenuCell: UITableViewCell {
} }
} }
class MenuViewController: UITableViewController, TooltipLaunchable { class MenuViewController: UITableViewController, TooltipLaunchable {
static let items: [MenuComponent] = [ static let items: [MenuComponent] = [
MenuComponent(title: "DropShadow Tester", completed: true, viewController: DropShadowViewController.self), MenuComponent(title: "DropShadow Tester", completed: true, viewController: DropShadowViewController.self),
// MenuComponent(title: "TableView Tester", completed: true, viewController: TableViewTestController.self), MenuComponent(title: "TableView Tester", completed: true, viewController: TableViewTestController.self),
MenuComponent(title: "Badge", completed: true, viewController: BadgeViewController.self), MenuComponent(title: "Badge", completed: true, viewController: BadgeViewController.self),
MenuComponent(title: "Badge Indicator", completed: true, viewController: BadgeIndicatorViewController.self), MenuComponent(title: "Badge Indicator", completed: true, viewController: BadgeIndicatorViewController.self),
MenuComponent(title: "Button", completed: true, viewController: ButtonViewController.self), MenuComponent(title: "Button", completed: true, viewController: ButtonViewController.self),
@ -85,7 +86,7 @@ class MenuViewController: UITableViewController, TooltipLaunchable {
MenuComponent(title: "RadioButton", completed: true, viewController: RadioButtonViewController.self), MenuComponent(title: "RadioButton", completed: true, viewController: RadioButtonViewController.self),
MenuComponent(title: "RadioButtonItem", completed: true, viewController: RadioButtonItemViewController.self), MenuComponent(title: "RadioButtonItem", completed: true, viewController: RadioButtonItemViewController.self),
MenuComponent(title: "RadioButtonGroup", completed: true, viewController: RadioButtonGroupViewController.self), MenuComponent(title: "RadioButtonGroup", completed: true, viewController: RadioButtonGroupViewController.self),
//MenuComponent(title: "TabsContainer", completed: false, viewController: TabsContainerViewController.self), // //MenuComponent(title: "TabsContainer", completed: false, viewController: TabsContainerViewController.self),
MenuComponent(title: "Tabs", completed: true, viewController: TabsViewController.self), MenuComponent(title: "Tabs", completed: true, viewController: TabsViewController.self),
MenuComponent(title: "TextArea", completed: false, viewController: TextAreaViewController.self), MenuComponent(title: "TextArea", completed: false, viewController: TextAreaViewController.self),
MenuComponent(title: "TextLink", completed: true, viewController: TextLinkViewController.self), MenuComponent(title: "TextLink", completed: true, viewController: TextLinkViewController.self),

View File

@ -172,7 +172,7 @@ public class TableViewTestController: UIViewController, Initable, Surfaceable {
} }
var items: [MenuComponent] { var items: [MenuComponent] {
batch1 all
} }
var all: [MenuComponent] { var all: [MenuComponent] {
@ -193,6 +193,7 @@ public class TableViewTestController: UIViewController, Initable, Surfaceable {
MenuComponent(title: "TextLinkCaret", completed: true, viewController: TextLinkCaretViewController.self), MenuComponent(title: "TextLinkCaret", completed: true, viewController: TextLinkCaretViewController.self),
MenuComponent(title: "TitleLockup", completed: true, viewController: TitleLockupViewController.self), MenuComponent(title: "TitleLockup", completed: true, viewController: TitleLockupViewController.self),
MenuComponent(title: "Tooltip", completed: true, viewController: TooltipViewController.self), MenuComponent(title: "Tooltip", completed: true, viewController: TooltipViewController.self),
MenuComponent(title: "TrailingTooltip", completed: true, viewController: TrailingTooltipLabelViewController.self),
] ]
} }
} }
@ -214,7 +215,7 @@ extension TableViewTestController : UITableViewDelegate, UITableViewDataSource {
let cell = UITableViewCell() let cell = UITableViewCell()
cell.contentView.addSubview(component) cell.contentView.addSubview(component)
sample.pin(edgeInset: .init(top: 16, left: 16, bottom: 16, right: 16)) sample.pin(edgeInset: .uniform(16))
cell.backgroundColor = surface.color cell.backgroundColor = surface.color
cell.layoutIfNeeded() cell.layoutIfNeeded()
return cell return cell