Digital PCT265 story PCT-135: Revert onPageNew signature change.
This commit is contained in:
parent
d377ec84b7
commit
75104dbe4d
@ -261,9 +261,8 @@ open class AccessibilityHandlerBehavior: PageVisibilityBehavior, PageMoleculeTra
|
||||
accessibilityHandler = AccessibilityHandler.shared() //Protocol Mandatory init method.
|
||||
}
|
||||
|
||||
open func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?) -> [MoleculeModelProtocol]? {
|
||||
open func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?) {
|
||||
accessibilityHandler?.onPageNew(rootMolecules: rootMolecules, delegateObject)
|
||||
return nil
|
||||
}
|
||||
|
||||
open func willShowPage(_ delegateObject: MVMCoreUIDelegateObject?) {
|
||||
|
||||
@ -263,6 +263,9 @@ import MVMCore
|
||||
if let replaced = try? newTemplateModel.replaceChildMolecule(with: molecule) {
|
||||
// Only recognize the molecules that actually changed.
|
||||
debugLog("Behavior updated \(changes) in template model.")
|
||||
changes = changes.filter({ model in
|
||||
behaviorUpdatedModels.contains { $0.id == model.id }
|
||||
})
|
||||
behaviorUpdatedModels.append(contentsOf: changes)
|
||||
} else {
|
||||
debugLog("Failed to replace \(molecule) in the template model.")
|
||||
|
||||
@ -30,7 +30,7 @@ public extension PageBehaviorProtocol {
|
||||
*/
|
||||
|
||||
public protocol PageMoleculeTransformationBehavior: PageBehaviorProtocol {
|
||||
func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?) -> [MoleculeModelProtocol]?
|
||||
func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?)
|
||||
func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?, changes: inout [MoleculeModelProtocol]) -> [MoleculeModelProtocol]?
|
||||
func willSetupMolecule(with model: MoleculeModelProtocol, updating view: MoleculeViewProtocol?)
|
||||
func didSetupMolecule(view: MoleculeViewProtocol, withModel: MoleculeModelProtocol)
|
||||
@ -42,11 +42,11 @@ public protocol PageMoleculeTransformationBehavior: PageBehaviorProtocol {
|
||||
|
||||
public extension PageMoleculeTransformationBehavior {
|
||||
// All optional.
|
||||
func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?) -> [MoleculeModelProtocol]? {
|
||||
var changes = [any MoleculeModelProtocol]()
|
||||
return onPageNew(rootMolecules: rootMolecules, delegateObject, changes: &changes)
|
||||
func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?) {}
|
||||
func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?, changes: inout [MoleculeModelProtocol]) -> [MoleculeModelProtocol]? {
|
||||
onPageNew(rootMolecules: rootMolecules, delegateObject) // Call the original signature.
|
||||
return nil // Don't return any tranformations.
|
||||
}
|
||||
func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?, changes: inout [MoleculeModelProtocol]) -> [MoleculeModelProtocol]? { return nil }
|
||||
func willSetupMolecule(with model: MoleculeModelProtocol, updating view: MoleculeViewProtocol?) {}
|
||||
func didSetupMolecule(view: MoleculeViewProtocol, withModel: MoleculeModelProtocol) {}
|
||||
func willSetupNavigationBar(with model: NavigationItemModelProtocol, updating view: UINavigationBar) {}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user