From 446bb7712aa33864aedbe80dd97ff6c53674b0c3 Mon Sep 17 00:00:00 2001 From: Martin De Simone Date: Mon, 25 Sep 2023 22:05:34 -0300 Subject: [PATCH] Update closures --- .../Features/Article/ArticleViewController.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SampleApp/Viafoura/Features/Article/ArticleViewController.swift b/SampleApp/Viafoura/Features/Article/ArticleViewController.swift index deaa19be..717c0c36 100644 --- a/SampleApp/Viafoura/Features/Article/ArticleViewController.swift +++ b/SampleApp/Viafoura/Features/Article/ArticleViewController.swift @@ -132,14 +132,14 @@ class ArticleViewController: UIViewController, StoryboardCreateable { return } - let callbacks: VFActionsCallbacks = { type in + let callbacks: VFActionsCallbacks = { [weak self] type in switch type { case .writeNewCommentPressed(let actionType): - self.presentNewCommentViewController(actionType: actionType) + self?.presentNewCommentViewController(actionType: actionType) case .seeMoreCommentsPressed: break case .openProfilePressed(let userUUID, let presentationType): - self.presentProfileViewController(userUUID: userUUID, presentationType: presentationType) + self?.presentProfileViewController(userUUID: userUUID, presentationType: presentationType) default: break } @@ -189,15 +189,15 @@ class ArticleViewController: UIViewController, StoryboardCreateable { return } - let callbacks: VFActionsCallbacks = { type in + let callbacks: VFActionsCallbacks = { [weak self] type in switch type { case .notificationPressed(let presentationType): switch presentationType { case .profile(let userUUID): - self.presentProfileViewController(userUUID: userUUID, presentationType: .feed) + self?.presentProfileViewController(userUUID: userUUID, presentationType: .feed) break case .content(let containerUUID, let contentUUID, let containerId): - self.presentArticle(containerId: containerId, contentUUID: contentUUID) + self?.presentArticle(containerId: containerId, contentUUID: contentUUID) break } default: