Compare commits

...

6 Commits

Author SHA1 Message Date
Shin Yamamoto 9b1cb68f0a Version 2.0.1 2020-10-19 19:22:53 +09:00
Shin Yamamoto 4ba8acaf08 Ease the default velocity for a panel removal (#395)
Because the current threshold(10.0) makes it hard to remove a panel.

Resolve #389
2020-10-19 19:20:16 +09:00
Shin Yamamoto 02d8d4516c Reset the moveAnimator prop after a move animation (#396)
* Reset the moveAnimator prop after a move animation

If `moveAnimator` isn't null, `FloatingPanelPanGestureRecognizer.touchesBegan`
detects `began` state quickly so that it doesn’t allow to work a tap gesture or
tap action in a panel.

Resolve #392

* Add 2 buttons in DebugTableViewController
2020-10-19 19:17:53 +09:00
Federico Zanetello 94829d2749 add missing commas (#387) 2020-10-07 20:11:04 +09:00
Shin Yamamoto 1522a0990f Merge pull request #372 from SCENEE/v2-dev
Release FloatingPanel 2.0.0
2020-10-03 09:01:19 +09:00
Shin Yamamoto 2e3bbaeec2 Merge pull request #386 from SCENEE/release-1.7.6
Release 1.7.6
2020-09-19 12:10:10 +09:00
5 changed files with 26 additions and 8 deletions
@@ -194,8 +194,8 @@ class MyPanelIntrinsicLayout: FloatingPanelLayout {
var initialState: FloatingPanelState { .full }
var anchors: [FloatingPanelState : FloatingPanelLayoutAnchoring] {
return [
.full: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 16.0, referenceGuide: .safeArea)
.half: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.5, referenceGuide: .safeArea)
.full: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 16.0, referenceGuide: .safeArea),
.half: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.5, referenceGuide: .safeArea),
.tip: FloatingPanelLayoutAnchor(absoluteInset: 44.0, edge: .bottom, referenceGuide: .safeArea)
]
}
@@ -142,6 +142,8 @@ class SampleListViewController: UIViewController {
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleSurface(tapGesture:)))
tapGesture.cancelsTouchesInView = false
tapGesture.numberOfTapsRequired = 2
// Prevents a delay to response a tap in menus of DebugTableViewController.
tapGesture.delaysTouchesEnded = false
mainPanelVC.surfaceView.addGestureRecognizer(tapGesture)
case .showNestedScrollView:
mainPanelVC.panGestureRecognizer.delegateProxy = self
@@ -684,6 +686,8 @@ class DebugTableViewController: InspectableViewController {
case animateScroll = "Animate Scroll"
case changeContentSize = "Change content size"
case reorder = "Reorder"
case moveToFull = "Move to Full"
case moveToHalf = "Move to Half"
}
var reorderButton: UIButton!
@@ -725,6 +729,10 @@ class DebugTableViewController: InspectableViewController {
case .reorder:
button.addTarget(self, action: #selector(reorderItems), for: .touchUpInside)
reorderButton = button
case .moveToFull:
button.addTarget(self, action: #selector(moveToFull), for: .touchUpInside)
case .moveToHalf:
button.addTarget(self, action: #selector(moveToHalf), for: .touchUpInside)
}
buttonStackView.addArrangedSubview(button)
}
@@ -785,6 +793,14 @@ class DebugTableViewController: InspectableViewController {
tableView.reloadData()
}
@objc func moveToFull() {
(self.parent as! FloatingPanelController).move(to: .full, animated: true)
}
@objc func moveToHalf() {
(self.parent as! FloatingPanelController).move(to: .half, animated: true)
}
@objc func close(sender: UIButton) {
// Remove FloatingPanel from a view
(self.parent as! FloatingPanelController).removePanelFromParent(animated: true, completion: nil)
+1 -1
View File
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "FloatingPanel"
s.version = "2.0.0"
s.version = "2.0.1"
s.summary = "FloatingPanel is a clean and easy-to-use UI component of a floating panel interface."
s.description = <<-DESC
FloatingPanel is a clean and easy-to-use UI component for a new interface introduced in Apple Maps, Shortcuts and Stocks app.
+6 -4
View File
@@ -131,6 +131,7 @@ class Core: NSObject, UIGestureRecognizerDelegate {
?? FloatingPanelDefaultBehavior().removePanelAnimator(vc, from: from, with: animationVector)
default:
move(to: to, with: 0) {
self.moveAnimator = nil
updateScrollView()
completion?()
}
@@ -717,15 +718,16 @@ class Core: NSObject, UIGestureRecognizerDelegate {
if let result = vc.delegate?.floatingPanel?(vc, shouldRemoveAt: vc.surfaceLocation, with: velocityVector) {
return result
}
let threshold = CGFloat(5.5)
switch layoutAdapter.position {
case .top:
return (velocityVector.dy <= -10.0)
return (velocityVector.dy <= -threshold)
case .left:
return (velocityVector.dx <= -10.0)
return (velocityVector.dx <= -threshold)
case .bottom:
return (velocityVector.dy >= 10.0)
return (velocityVector.dy >= threshold)
case .right:
return (velocityVector.dx >= 10.0)
return (velocityVector.dx >= threshold)
}
}
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<string>2.0.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>