Skip to content

Commit

Permalink
Add FXIOS-7431 [v120] Add docc for bottom sheet (#16807)
Browse files Browse the repository at this point in the history
* Add docc for bottom sheet

* Revert package change
  • Loading branch information
lmarceau authored Oct 13, 2023
1 parent 21b3acd commit 375e1ad
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ import Common
import Foundation
import UIKit

/// Protocol followed by child of the bottom sheet, which holds the content shown in the bottom sheet.
public protocol BottomSheetChild: UIViewController {
/// Tells the child that the bottom sheet will get dismissed
func willDismiss()
}

/// Protocol followed by the bottom sheet view controller. Gives the possibility to dismiss the bottom sheet.
public protocol BottomSheetDismissProtocol {
func dismissSheetViewController(completion: (() -> Void)?)
}

/// A container that present from the bottom as a sheet
public class BottomSheetViewController: UIViewController,
BottomSheetDismissProtocol,
Themeable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Foundation
import UIKit

/// The view model used to configure a `BottomSheetViewController`
public struct BottomSheetViewModel {
private struct UX {
static let cornerRadius: CGFloat = 8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# ``ComponentLibrary/BottomSheetViewController``

TODO with FXIOS-7431
The bottom sheet is a modal view presented from the bottom as a pop over.

## Overview

TODO with FXIOS-7431
The `BottomSheetViewController` is a subclass of the `UIViewController`. The bottom sheet content is another view controller embedded inside this parent view controller. The bottom sheet itself is shown as a popover, meaning it's type of modal. Bottom sheet can be dismissed from the close button, by doing a swipe gesture or by clicking outside the sheet itself. Those properties can be configured with it's view model ``BottomSheetViewModel``.

## Illustration

> This image are illustrative only. For precise examples of iOS implementation, please run the SampleApplication.
![The BottomSheetViewController on iOS](BottomSheetView)

## Topics

Expand All @@ -16,4 +22,3 @@ TODO with FXIOS-7431

- ``BottomSheetChild``
- ``BottomSheetDismissProtocol``

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Theme=Light.pdf",
"filename" : "crossCircleFillExtraLargeLight.pdf",
"idiom" : "universal"
},
{
Expand All @@ -11,7 +11,7 @@
"value" : "dark"
}
],
"filename" : "Theme=Dark.pdf",
"filename" : "crossCircleFillExtraLargeDark.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class BottomSheetChildViewController: UIViewController, BottomSheetChild, Themea
// MARK: Themeable

func applyTheme() {
contentLabel.textColor = themeManager.currentTheme.colors.textPrimary
view.backgroundColor = themeManager.currentTheme.colors.layer1
}
}

0 comments on commit 375e1ad

Please sign in to comment.