From 854c840112aff8ed7fe7caba80cbfe5ac8f2c3a0 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Fri, 10 Nov 2017 00:08:08 +0800 Subject: [PATCH] Fix crash for escaping block --- Sources/Views/InputBarItem.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Views/InputBarItem.swift b/Sources/Views/InputBarItem.swift index 7406d19b..77491ac2 100644 --- a/Sources/Views/InputBarItem.swift +++ b/Sources/Views/InputBarItem.swift @@ -183,8 +183,8 @@ open class InputBarButtonItem: UIButton { open func setSize(_ newValue: CGSize?, animated: Bool) { size = newValue if animated, let position = parentStackViewPosition { - messageInputBar?.performLayout(animated) { - self.messageInputBar?.layoutStackViews([position]) + messageInputBar?.performLayout(animated) { [weak self] in + self?.messageInputBar?.layoutStackViews([position]) } } }