Skip to content

Commit

Permalink
Add cardTitleHeightDidChanged for dynamic card title height
Browse files Browse the repository at this point in the history
  • Loading branch information
nighthawk committed Aug 30, 2022
1 parent 1c10182 commit e5934c2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/TGCardViewController/TGCardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e5934c2

Please sign in to comment.