From c8b382cc892b5ab131b2c84c9aa85458a70ded01 Mon Sep 17 00:00:00 2001 From: Damodaram Date: Thu, 22 Apr 2021 20:44:42 +0530 Subject: [PATCH] moved behaviour --- MVMCoreUI/Behaviors/GetContactBehavior.swift | 10 ++-------- .../Behaviors/Protocols/PageBehaviorProtocol.swift | 6 ------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/MVMCoreUI/Behaviors/GetContactBehavior.swift b/MVMCoreUI/Behaviors/GetContactBehavior.swift index eaf3d5d9..b36f778b 100644 --- a/MVMCoreUI/Behaviors/GetContactBehavior.swift +++ b/MVMCoreUI/Behaviors/GetContactBehavior.swift @@ -21,7 +21,7 @@ public class PageGetContactBehaviorModel: PageBehaviorModelProtocol { public init() {} } -public class PageGetContactBehavior: PageVisibilityBehavior,PageNextBatchActionBehavior { +public class PageGetContactBehavior: PageVisibilityBehavior { var delegate: MVMCoreUIDelegateObject? @@ -45,7 +45,7 @@ public class PageGetContactBehavior: PageVisibilityBehavior,PageNextBatchActionB } } - func getContacts() { + public func getContacts() { guard let rootMolecules = delegate?.moleculeDelegate?.getRootMolecules() else { return } let store = CNContactStore() let consumers: [PageGetContactBehaviorConsumerProtocol] = rootMolecules.allMoleculesOfType() @@ -57,10 +57,4 @@ public class PageGetContactBehavior: PageVisibilityBehavior,PageNextBatchActionB } public func onPageHidden(_ delegateObject: MVMCoreUIDelegateObject?) {} - - public func nextBatchAction(_ delegateObject: MVMCoreUIDelegateObject?) { - if CNContactStore.authorizationStatus(for: .contacts) == .authorized { - getContacts() - } - } } diff --git a/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift b/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift index 87df7007..e7db54bc 100644 --- a/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift +++ b/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift @@ -39,12 +39,6 @@ public protocol PageLocalDataShareBehavior: PageBehaviorProtocol { func receiveLocalPageData(_ data:[AnyHashable: Any], _ delegateObject: MVMCoreUIDelegateObject) } -public protocol PageNextBatchActionBehavior: PageBehaviorProtocol { - - func nextBatchAction(_ delegateObject: MVMCoreUIDelegateObject?) - -} - public protocol PageCustomActionHandlerBehavior: PageBehaviorProtocol { func handleAction(type actionType: String?, information: [AnyHashable : Any]?, additionalData: [AnyHashable : Any]?) -> Bool