added new behaviors for select all boxes.
This commit is contained in:
parent
00dc4c2a47
commit
97ecf292dd
@ -108,6 +108,7 @@
|
||||
0A9D09222433796500D2E6C0 /* CarouselIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9D091C2433796500D2E6C0 /* CarouselIndicator.swift */; };
|
||||
0AA33B3A2398524F0067DD0F /* Toggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA33B392398524F0067DD0F /* Toggle.swift */; };
|
||||
0AA4D2E125CAEC72008DB32D /* AccessibilityModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA4D2E025CAEC72008DB32D /* AccessibilityModelProtocol.swift */; };
|
||||
0AAB7855267B86F900DD6437 /* SelectAllBoxesBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAB7854267B86F900DD6437 /* SelectAllBoxesBehavior.swift */; };
|
||||
0AB000BA24BF63490090C5E7 /* ModalListPageTemplateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB000B924BF63490090C5E7 /* ModalListPageTemplateModel.swift */; };
|
||||
0AB000BC24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB000BB24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift */; };
|
||||
0AB764D124460F6300E7FE72 /* UIDatePicker+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB764D024460F6300E7FE72 /* UIDatePicker+Extension.swift */; };
|
||||
@ -674,6 +675,7 @@
|
||||
0AA33B33239813C50067DD0F /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = "<group>"; };
|
||||
0AA33B392398524F0067DD0F /* Toggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toggle.swift; sourceTree = "<group>"; };
|
||||
0AA4D2E025CAEC72008DB32D /* AccessibilityModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilityModelProtocol.swift; sourceTree = "<group>"; };
|
||||
0AAB7854267B86F900DD6437 /* SelectAllBoxesBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectAllBoxesBehavior.swift; sourceTree = "<group>"; };
|
||||
0AB000B924BF63490090C5E7 /* ModalListPageTemplateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalListPageTemplateModel.swift; sourceTree = "<group>"; };
|
||||
0AB000BB24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalStackPageTemplateModel.swift; sourceTree = "<group>"; };
|
||||
0AB764D024460F6300E7FE72 /* UIDatePicker+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIDatePicker+Extension.swift"; sourceTree = "<group>"; };
|
||||
@ -1316,6 +1318,7 @@
|
||||
27F97369246750BE00CAB5C5 /* ScreenBrightnessModifierBehavior.swift */,
|
||||
D23A900826125FFB007E14CE /* GetContactBehavior.swift */,
|
||||
0A01DE262626236300C2CAAC /* PlayAudioBehavior.swift */,
|
||||
0AAB7854267B86F900DD6437 /* SelectAllBoxesBehavior.swift */,
|
||||
);
|
||||
path = Behaviors;
|
||||
sourceTree = "<group>";
|
||||
@ -2718,6 +2721,7 @@
|
||||
011D959B240451E3000E3791 /* RuleRequiredModel.swift in Sources */,
|
||||
526A265C240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift in Sources */,
|
||||
D2A92886241ACD99004E01C6 /* ProgrammaticTableViewController.swift in Sources */,
|
||||
0AAB7855267B86F900DD6437 /* SelectAllBoxesBehavior.swift in Sources */,
|
||||
BBAA4F05243D8E3B005AAD5F /* RadioBoxesModel.swift in Sources */,
|
||||
01509D952327ED1900EF99AA /* HeadlineBodyLinkToggle.swift in Sources */,
|
||||
AA104ADA244734DB004D2810 /* HeadersH1LandingPageHeader.swift in Sources */,
|
||||
|
||||
60
MVMCoreUI/Behaviors/SelectAllBoxesBehavior.swift
Normal file
60
MVMCoreUI/Behaviors/SelectAllBoxesBehavior.swift
Normal file
@ -0,0 +1,60 @@
|
||||
//
|
||||
// SelectAllBoxesBehavior.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Kevin Christiano on 6/17/21.
|
||||
// Copyright © 2021 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
public class SelectAllBoxesBehaviorModel: PageBehaviorModelProtocol {
|
||||
public class var identifier: String { "selectAllBoxesBehavior" }
|
||||
public var shouldAllowMultipleInstances: Bool { false }
|
||||
|
||||
public init() { }
|
||||
}
|
||||
|
||||
public class SelectAllBoxesBehavior: PageCustomActionHandlerBehavior {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Active Model
|
||||
//--------------------------------------------------
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Delegate
|
||||
//--------------------------------------------------
|
||||
|
||||
var delegate: MVMCoreUIDelegateObject?
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Init
|
||||
//--------------------------------------------------
|
||||
|
||||
public required init(model: PageBehaviorModelProtocol, delegateObject: MVMCoreUIDelegateObject?) {
|
||||
self.delegate = delegateObject
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Custom Action
|
||||
//--------------------------------------------------
|
||||
|
||||
// Either play or pause
|
||||
public func handleAction(type actionType: String?, information: [AnyHashable: Any]?, additionalData: [AnyHashable: Any]?) -> Bool {
|
||||
|
||||
guard actionType == "selectAllBoxes" else { return false }
|
||||
|
||||
// Update the model. play -> pause OR pause -> play
|
||||
if true {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
// TODO: Tell Template to update this cell (needs to be built). Currently it updates all cells.
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
public func onPageHidden(_ delegateObject: MVMCoreUIDelegateObject?) {
|
||||
// TODO: Stop player
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user