-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce BottomSheet configuration for customizing its appearance
- Loading branch information
1 parent
88e5a21
commit 821ac4c
Showing
7 changed files
with
139 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// BottomSheetConfiguration.swift | ||
// BottomSheetDemo | ||
// | ||
// Created by Mikhail Maslo on 15.08.2022. | ||
// Copyright © 2022 Joom. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
public struct BottomSheetConfiguration { | ||
public enum PullBarConfiguration { | ||
public struct PullBarAppearance { | ||
public let height: CGFloat | ||
|
||
public init(height: CGFloat) { | ||
self.height = height | ||
} | ||
} | ||
|
||
case hidden | ||
case visible(PullBarAppearance) | ||
|
||
public static let `default`: PullBarConfiguration = .visible(PullBarAppearance(height: 20)) | ||
} | ||
|
||
public struct ShadowConfiguration { | ||
public let backgroundColor: UIColor | ||
|
||
public init(backgroundColor: UIColor) { | ||
self.backgroundColor = backgroundColor | ||
} | ||
|
||
public static let `default` = ShadowConfiguration(backgroundColor: UIColor.black.withAlphaComponent(0.6)) | ||
} | ||
|
||
public let cornerRadius: CGFloat | ||
public let pullBarConfiguration: PullBarConfiguration | ||
public let shadowConfiguration: ShadowConfiguration | ||
|
||
public init( | ||
cornerRadius: CGFloat, | ||
pullBarConfiguration: PullBarConfiguration, | ||
shadowConfiguration: ShadowConfiguration | ||
) { | ||
self.cornerRadius = cornerRadius | ||
self.pullBarConfiguration = pullBarConfiguration | ||
self.shadowConfiguration = shadowConfiguration | ||
} | ||
|
||
public static let `default` = BottomSheetConfiguration( | ||
cornerRadius: 10, | ||
pullBarConfiguration: .default, | ||
shadowConfiguration: .default | ||
) | ||
} |
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
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