Skip to content

Releases: scenee/FloatingPanel

v1.3.1

30 Dec 00:53
Compare
Choose a tag to compare

This release includes many bugfixes of layout problems on v1.3.0 💪
Please update v1.3.0 to this version.

NOTES

  • I recommend to clean the framework with '⌘ + Shift + K' & rebuild it. Xcode's new build system doesn't rebuild it automatically so that you could use the old binary of this library.

New API

FloatingPanelControllerDelegate

func floatingPanel(_ vc: FloatingPanelController, shouldRecognizeSimultaneouslyWith gestureRecognizer: UIGestureRecognizer) -> Bool

See also Issue #76 and this sample code, https://github.com/SCENEE/FloatingPanel/blob/v1.3.1/Examples/Samples/Sources/ViewController.swift#L284

Changes

Now the view hierarchy is as below.
(This is also written on 'View hierarchy' in README)

FloatingPanelController.view(FloatingPanelPassThroughView)
 ├─ .backdropView(FloatingPanelBackdropView)
 └─ .surfaceView(FloatingPanelSurfaceView)
          ├─ .contentView(FloatingPanelController.contentViewController.view)
          └─ .grabberHandle(GrabberHandleView)
  • Remove FloatingPanelSurfaceWrapperView.
  • Remove the content wrapper view in FloatingPanelSurfaceView
  • Modify the logic of the surface view's height using AutoLayout entirely

Bugfixes

  • Any gestures don't wait for FloatingPanelController.panGestureRecognizer #76, #88
    • Add new delegate method to customize the failure requirements and simultaneousness of FloatingPanelController.panGestureRecognizer
  • Fix a layout problem on SafeArea.Top on a navigation bar with search bar
  • Fix content offsets of a tracking scroll view
  • Fix intrinsic height
  • Fix layout on presentation modally
  • Fix UI freeze on the presentation modally from the second time
  • Fix bugs on iOS 10
  • Fix swizzling UIViewController.dismiss(animated:)

Improvements

  • Improve Samples app
    • Add "Settings" panel
    • Add "Reorder" button to show a sample to disable a panel's pan gesture

v1.3.0

15 Dec 00:32
Compare
Choose a tag to compare

This release adds 3 great features. 💪💯
Thanks to @Durkslol, @TSCombine , @attheodo, @scandiumza for proposing new features. 🥇

NOTES

  1. Please see Backward compatibility section in this release note at first.
  2. I recommend to clean the framework with '⌘ + Shift + K' & rebuild it after you update it.
    • Xcode's new build system doesn't rebuild it automatically so that there is a possible to use the old binary of this library.

New features

  • Present it as a modality
  • Intrinsic height(content fitting height) #57
  • Show/Hide a panel without adding/removing it every time #64

New APIs

FloatingPanelController

  • show(animated:completion:)
  • hide(animated:completion:)

FloatingPanelLayout

  • FloatingPanelIntrinsicLayout

See "Use Intrinsic height layout" for detail,

FloatingPanelPosition

  • .hidden

Use cases

Present a floating panel as a Modality

let fpc = FloatingPanelController()
self.present(fpc, animated: true)

Add a floating panel to a container view.

let fpc = FloatingPanelController()
aContainerView.addSubview(fpc.view)
fpc.view.frame = aContainer.bounds // MUST
parent.addChild(fpc)
fpc.show(animated: true) { 
	self.didMove(toParent: self)
}
let fpc = FloatingPanelController()
fpc.hide(animated: true) {
        // If needed
	self.willMove(toParent: nil)
	self.view.removeFromSuperview()
	self.removeFromParent()
}

Backward compatibility

Please note 2 points for this release. These might make you change your code, but I believe and hope it would make this library better for you.

  • View hierarchy change
  • .hidden position

View hierarchy change

From this release, the view hierarchy managed FloatignPanelController is changed.

  • FloatignPanelController.view isn't surfaceView anymore.
  • The backdropView isn't inserted to the parent view.

FloatignPanelController.view is a root container view adding the surfaceView and backdropView.

.hidden position

  • The initial value of FloatignPanelController.position is .hidden
  • FloatignPanelController.position is set to .hidden after calling hide(animated:completion:) as below.
fpc.hide(animated: true) {
       print(fpc.position) // .hidden
}
  • FloatingPanelLayout.insetFor(position:) might need the following change.
class ModalSecondLayout: FloatingPanelLayout {
    func insetFor(position: FloatingPanelPosition) -> CGFloat? {
        switch position {
        case .full: return 18.0
        case .half: return 262.0
        case .tip: return 44.0
+        case .hidden: return nil
        }
    }
}

v1.2.3

07 Dec 10:10
Compare
Choose a tag to compare

Bugfixes

  • Fix a wobbling at the animation start
    • Let the default interaction animator be uninterruptible
  • Fix invalid backdrop alpha

V1.2.2

03 Dec 02:12
Compare
Choose a tag to compare

Bugfixes

  • Fix an invalid content offset on height change Ref #71
  • Fix panning at grabber area Ref #34, #71
    • It's a recovery to #34 behavior.

v1.2.1

26 Nov 04:20
Compare
Choose a tag to compare

New API

FloatingPanelControllerDelegate

func floatingPanelDidChangePosition(_ vc: FloatingPanelController) Ref #46

Bugfixes

  • Fix the gesture handling to make UITableViewRowAction work.
  • Fix the interactive animation interruption to make it interruptible
  • Fix removing backdrop view

v1.2.0

17 Nov 01:12
Compare
Choose a tag to compare

I've released v1.2.0!! This release has many improvements and bugfixes. As a result, the floating panel is more robust and fluid. I highly recommend to update it from the previous version.

It's all thank to you reports and contributions.

I would like to continue to enhance this UI component with you. Welcome to your report and PR.

New APIs

  • Add a removal interaction invoked when a floating pane is at the bottom position. Ref #8
  • Update the layout programmatically. Ref #39
  • Enable to customize the redirectional behavior.

FloatingPanelController

  • isRemovalInteractionEnabled: Enable the removal interaction(swipe down)
  • updateLayout(): Update the layout object from the delegate and apply it to the views. It might be useful in an animation.

FloatingPanelControllerDelegate

  • floatingPanelDidEndDraggingToRemove(_:withVelocity)
  • floatingPanelDidEndRemove(_:)

FloatingPanelBehavior

  • removalVelocity, removalProgress, removalInteractionAnimator(_:with): Customize the removal interaction
  • redirectionalProgress(_:from:to:) -> CGFloat: Customize the redirectional max progress.

Modified APIs

FloatingPanelController

- show(contentVC, sender: nil)
+ set(contentViewController: contentVC)

If you use v1.1.0, a build will be broken, but it's easy to fix it.
See #21 for the reason of this change.

Improvements

  • Now FloatingPanelController allows to display a floating panel on only 1 supported position.
  • Improve scroll view handling to make it robust and more consistent between scrolling a scroll view and dragging a floating panel.
  • Enable to drag the panel using the grab handler regardless of the scrolling position. Thanks, @ffittschen!
  • Improved shadow, not darkening content background. Thanks, @futuretap.

Bugfixes

  • Add missing constraint of the title in Stocks app Thanks, @kingcos!
  • Fix the surface view's background color is not updated when a value is set to FloatingPanelSurfaceView.backgroundColor. Ref #22
  • Fix a blackout of the backdrop when tip and half supported positions. Ref #27
  • Fix issues on a large title or translucent of UINavigationBar Ref #26, #28
  • Fix scrollview jumps after it moved programmatically Ref #35
  • Fix infinite recursion in FloatingPanel.responds(to:)

Misc

  • Update preconditions of the parent VC
  • Update Samples App to test issues.

v1.1.0

28 Oct 00:01
Compare
Choose a tag to compare

I've released v1.1.0 to have many bugfixes and improvements. Thank you for your report and contributions!

Please note that FloatingPanelLayout and FloatingPanelBehavior protocols have some backwards incompatible changes. But their changes were only applied for their optional methods so I didn't change the major version.

I would like to enhance this UI component with you. Welcome to your report and PR.

New APIs

  • FloatingPanelController.panGestureRecognizer.

API Changes

FloatingPanelLayout

  • Add FloatingPanelLayout default implementations of supportedPositions and prepareLayout(surfaceView:in:) for a common case.
  • Change supportedPosition type from Array to Set.
- var supportedPositions: [FloatingPanelPosition]
+ var supportedPositions: Set<FloatingPanelPosition>
  • Add FloatingPanelLayout consistence check.
  • Change the default landscape layout to fix #3.

FloatingPanelBehavior

  • Modify and Improve FloatingPanelBehavior protocol to be more clear.
- func presentAnimator(_ fpc: FloatingPanelController, from: FloatingPanelPosition, to: FloatingPanelPosition) -> UIViewPropertyAnimator 
+ func addAnimator(_ fpc: FloatingPanelController, to: FloatingPanelPosition) -> UIViewPropertyAnimator 

-  func dismissAnimator(_ fpc: FloatingPanelController, from: FloatingPanelPosition) -> UIViewPropertyAnimator
+ func removeAnimator(_ fpc: FloatingPanelController, from: FloatingPanelPosition) -> UIViewPropertyAnimator

+ func moveAnimator(_ fpc: FloatingPanelController, from: FloatingPanelPosition, to: FloatingPanelPosition) -> UIViewPropertyAnimator

Bugfixes

  • The child view controller of FloatingPanelController uses the bottom of safe layout guide expectedly.
  • Fix a critical bug on full and half anchor positions only.
  • Fix bugs of FloatingPanelLayout.{topInteractionBuffer,bottomInteractionBuffer}.
  • Fix failure requirements of the pan gesture #12.
  • Fix a Examples/Maps layout issue #1.
  • Fix errors in doc comments and README by PR #11 of @futuretap PR #11 and PR #16 of @0xflotus . Thank you!

Improvements

  • Improve the shadow layer of FloatingPanelSurfaceView.
  • Update Samples.app.
    • 2 floating panels in Tab bar
    • A nested scroll view sample
    • Touch gestures in a detail panel
  • Update README.
    • Add shields/TOC/Notes.
    • Update Usage to resolve common questions.

Misc

  • Support Travis CI.

v1.0.0

23 Oct 01:20
Compare
Choose a tag to compare

New API

To fix #1 issue

+ FloatingPanelController.adjustedContentInsets
+ FloatingPanelController.contentInsetAdjustmentBehavior

Changed API

- FloatingPanelController.add(toParent:belowView:animated)
+ FloatingPanelController.addPanel(toParent:belowView:animated)
- FloatingPanelController.removeFromParent(animated:completion:)
+ FloatingPanelController.removePanelFromParent(animated:completion:)

Enhancement

  • Modify FloatingPanelDefaultBehavior to improve Fluid behavior
  • Improve scroll view tracking
    • Projecting a content scrolling to the panel moving smoothly
    • Lock & unlock a scroll view
    • Intermediation of the delegate of a tracking scroll view

BugFixes

  • Fix backdrop layout and behavior bugs
  • Fix bugs on iOS10

Others

  • Add Samples app

I've released v1.0.0 because the APIs and behavior are sufficient to my requirements. But I would like to enhance this UI component with you. Welcome to your report and PR.

Best,