-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1052 from adevinta/1051-bottomsheet-fix-width
[BottomSheet#1051] Fix width of bottom sheet.
- Loading branch information
Showing
4 changed files
with
98 additions
and
79 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
core/Sources/Components/BottomSheet/SwiftUI/PresentationDetent-MaxHeight.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// PresentationDetent-MaxHeight.swift | ||
// | ||
// | ||
// Created by Michael Zimmermann on 26.06.24. | ||
// Copyright © 2024 Adevinta. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
@available(iOS 16.0, *) | ||
public extension PresentationDetent { | ||
static let maxHeight = Self.custom(MaxHeightPresentationDetent.self) | ||
} | ||
|
||
@available(iOS 16.0, *) | ||
private struct MaxHeightPresentationDetent: CustomPresentationDetent { | ||
static func height(in context: Context) -> CGFloat? { | ||
return context.maxDetentValue - 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters