Skip to content

Commit

Permalink
Revise the doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
scenee committed Nov 24, 2021
1 parent 04ea9b1 commit 020a6ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ fpc.layout = MyPanelLayout()
fpc.invalidateLayout() // If needed
```

Note: If you already set a `FloatingPanelControllerDelegate` object to `FloatingPanelController.delegate`, `invalidateLayout()` overrides a layout object which assigned to `FloatingPanelController.layout` just before calling it, with one returned by the delegate object.
Note: If you already set `FloatingPanelController.delegate` to a `FloatingPanelControllerDelegate` object , `invalidateLayout()` overrides a layout object which assigned to `FloatingPanelController.layout` just before calling it, with one returned by the delegate object.

2. Returns an appropriate layout object in one of 2 `floatingPanel(_:layoutFor:)` delegates.

Expand Down
13 changes: 7 additions & 6 deletions Sources/Controller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ open class FloatingPanelController: UIViewController {

/// The layout object that the controller manages
///
/// You need to call ``invalidateLayout()`` if you want to apply a new layout object immediately
/// into the panel.
/// You need to call ``invalidateLayout()`` if you want to apply a new layout object into the panel
/// immediately.
@objc
public var layout: FloatingPanelLayout {
get { _layout }
Expand Down Expand Up @@ -608,11 +608,12 @@ open class FloatingPanelController: UIViewController {

/// Invalidates all layout information of the panel and apply the ``layout`` property into it immediately.
///
/// This lays out subviews of the view that the controller manages immediately according to the ``layout``
/// property by calling `layoutIfNeeded()` of the view. Thus it can be called in an animation block.
/// This lays out subviews of the view that the controller manages with the ``layout`` property by
/// calling the view's `layoutIfNeeded()`. Thus this method can be called in an animation block to
/// animate the panel layout's changes.
///
/// If the controller has a delegate object, this will lay out them using the layout object returned by
/// `floatingPanel(_:layoutFor:)` for the current `UITraitCollection`.
/// If the controller has a delegate object, this will lay them out using the layout object returned by
/// `floatingPanel(_:layoutFor:)` delegate method for the current `UITraitCollection`.
@objc
public func invalidateLayout() {
if let newLayout = self.delegate?.floatingPanel?(self, layoutFor: traitCollection) {
Expand Down

0 comments on commit 020a6ad

Please sign in to comment.