Skip to content
Merged
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
22 changes: 17 additions & 5 deletions Sources/TGCardViewController/TGCardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ open class TGCardViewController: UIViewController {
fileprivate static let tapAnimationDuration = 0.25

fileprivate static let mapShadowVisibleAlpha: CGFloat = 0.25

fileprivate static let floatingHeaderTopMargin: CGFloat = 20

fileprivate static let iOS26CornerRadius: CGFloat = 32
}

public enum Mode {
Expand Down Expand Up @@ -323,9 +325,14 @@ open class TGCardViewController: UIViewController {
cardWrapperEffectView.effect = UIGlassEffect(style: .regular)
headerEffectView.effect = UIGlassEffect(style: .regular)
#endif
cardWrapperEffectView.cornerConfiguration = .corners(radius: 12)

headerEffectView.cornerConfiguration = .corners(topLeftRadius: nil, topRightRadius: nil, bottomLeftRadius: 12, bottomRightRadius: 12)
cardWrapperEffectView.cornerConfiguration = .corners(radius: UICornerRadius.fixed(Constants.iOS26CornerRadius))

headerEffectView.cornerConfiguration = .corners(
topLeftRadius: nil,
topRightRadius: nil,
bottomLeftRadius: UICornerRadius.fixed(Constants.iOS26CornerRadius),
bottomRightRadius: UICornerRadius.fixed(Constants.iOS26CornerRadius)
)
} else {
cardWrapperEffectView.effect = nil
headerEffectView.effect = nil
Expand Down Expand Up @@ -1953,7 +1960,12 @@ extension TGCardViewController {
private func updateHeaderStyle() {
@MainActor
func applyCornerStyle(to view: UIView) {
let radius: CGFloat = 12
let radius: CGFloat
if #available(iOS 26.0, *) {
radius = Constants.iOS26CornerRadius
} else {
radius = 12
}
let roundAllCorners = cardIsNextToMap(in: traitCollection)

view.layer.maskedCorners = roundAllCorners
Expand Down
Loading