From ced6589becb102abc96de8f3e8b95fda130e68d9 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Thu, 18 Aug 2022 15:59:28 -0700 Subject: [PATCH] Fix a retain cycle for story toggle buttons --- .../Group Reply Sheet/StoryGroupRepliesAndViewsSheet.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/HomeView/Stories/Replies & Views Sheets/Group Reply Sheet/StoryGroupRepliesAndViewsSheet.swift b/Signal/src/ViewControllers/HomeView/Stories/Replies & Views Sheets/Group Reply Sheet/StoryGroupRepliesAndViewsSheet.swift index dcaca6869d..f3aa9970e6 100644 --- a/Signal/src/ViewControllers/HomeView/Stories/Replies & Views Sheets/Group Reply Sheet/StoryGroupRepliesAndViewsSheet.swift +++ b/Signal/src/ViewControllers/HomeView/Stories/Replies & Views Sheets/Group Reply Sheet/StoryGroupRepliesAndViewsSheet.swift @@ -114,7 +114,7 @@ class StoryGroupRepliesAndViewsSheet: InteractiveSheetViewController { func createToggleButton(title: String, block: @escaping () -> Void) -> UIButton { let button = OWSButton() - button.block = { + button.block = { [unowned button] in guard !button.isSelected else { return } block() }