From e5934c2720011dcf87f03e4fb6cf299c5631e30c Mon Sep 17 00:00:00 2001 From: Adrian Schoenig Date: Tue, 30 Aug 2022 18:59:59 +1000 Subject: [PATCH] Add `cardTitleHeightDidChanged` for dynamic card title height --- .../TGCardViewController/TGCardViewController.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sources/TGCardViewController/TGCardViewController.swift b/Sources/TGCardViewController/TGCardViewController.swift index 2d07caf..9262abd 100644 --- a/Sources/TGCardViewController/TGCardViewController.swift +++ b/Sources/TGCardViewController/TGCardViewController.swift @@ -1195,6 +1195,17 @@ extension TGCardViewController { } } + /// Call this whenever the height of the current card's title has changed. + /// + /// Generally not necessary to call, unless where you use a custom card title and it's height changed + /// after the card was first presented. + public func cardTitleHeightDidChanged() { + topCardView?.updateConstraintsIfNeeded() + topCardView?.layoutIfNeeded() + + updateCardStructure(card: topCardView, position: cardPosition) + } + private func updateForNewPosition(position: TGCardPosition) { previousCardPosition = position