Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 26.0.1 # 26.1 is missing simulators on GitHub, as of November 2025
xcode-version: 26.4 # macos-26 ships an iOS platform compatible with 26.4; 26.0 is no longer downloadable
- uses: actions/checkout@v4
- name: Build TGCardVC
run: set -o pipefail && xcodebuild -workspace . -scheme TGCardViewController -destination 'platform=iOS Simulator,name=iPhone 17' | xcbeautify
Expand Down
23 changes: 22 additions & 1 deletion Sources/TGCardViewController/TGCardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,26 @@ open class TGCardViewController: UIViewController {
public var locationButtonPosition: TGButtonPosition = .top

private var defaultButtons: [UIView]!


/// Views to overlay on the top-right of the map *for every card*, in addition
/// to whatever each card's own `topMapToolBarItems` specifies. Use this for
/// controls that should be reachable from any screen — a profile button, a
/// global assistant entry point, etc.
///
/// Items are arranged vertically. Per-card items (from `TGCard.topMapToolBarItems`)
/// appear *below* these persistent ones in the same column.
///
/// - SeeAlso: `persistentBottomMapToolBarItems`
public var persistentTopMapToolBarItems: [UIView] = [] {
didSet { if isViewLoaded, defaultButtons != nil { updateMapToolbarItems() } }
}

/// Bottom-right counterpart of `persistentTopMapToolBarItems`. Items here are
/// arranged horizontally; per-card `bottomMapToolBarItems` appear to the right.
public var persistentBottomMapToolBarItems: [UIView] = [] {
didSet { if isViewLoaded, defaultButtons != nil { updateMapToolbarItems() } }
}

private var allowFloatingViews: Bool = true

public var draggingCardEnabled: Bool {
Expand Down Expand Up @@ -1861,6 +1880,7 @@ extension TGCardViewController {
// Because we want to relocate buttons in the top toolbar
// to the bottom toolbar when header is present, so it is
// important that we set up bottom toolbar first!
bottomViews.append(contentsOf: persistentBottomMapToolBarItems)
if let newBottoms = card?.bottomMapToolBarItems {
bottomViews.append(contentsOf: newBottoms)
}
Expand All @@ -1872,6 +1892,7 @@ extension TGCardViewController {
}

// Now we can proceed with setting up toolbar at the top.
topViews.append(contentsOf: persistentTopMapToolBarItems)
if let newTops = card?.topMapToolBarItems {
topViews.append(contentsOf: newTops)
}
Expand Down
Loading