Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit780234b

Browse files
authored
Merge pull request#401 from 52inc/xcode12
Xcode12 Fixes to issue#400
2 parents780fc8e +82d023d commit780234b

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

‎Pulley.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.newdo |s|
1010
s.name='Pulley'
11-
s.version=ENV['LIB_VERSION'] ||'2.8.4'
11+
s.version=ENV['LIB_VERSION'] ||'2.8.5'
1212
s.summary='A library to imitate the iOS 10 Maps UI.'
1313

1414
# This description is used to generate tags and improve search results.

‎Pulley.xcodeproj/xcshareddata/xcschemes/PulleyDemo.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<CommandLineArguments>
6363
<CommandLineArgument
6464
argument ="-UIViewLayoutFeedbackLoopDebuggingThreshold 100"
65-
isEnabled ="YES">
65+
isEnabled ="NO">
6666
</CommandLineArgument>
6767
</CommandLineArguments>
6868
</LaunchAction>

‎Pulley/PrimaryContentViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ extension PrimaryContentViewController: PulleyPrimaryContentControllerDelegate {
7070

7171
func drawerChangedDistanceFromBottom(drawer:PulleyViewController, distance:CGFloat, bottomSafeArea:CGFloat)
7272
{
73+
// As of iOS 14, setting the constant on the constraint causes viewDidLayoutSubviews() to be call
74+
// on the PulleyViewController. This was causing issues with the drawer scroll view in 2.8.2+, see fix
75+
// for issue #400 and update 2.8.5
7376
guard drawer.currentDisplayMode==.drawerelse{
7477

7578
temperatureLabelBottomConstraint.constant= temperatureLabelBottomDistance

‎PulleyLib/PulleyViewController.swift

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,29 @@ public typealias PulleyAnimationCompletionBlock = ((_ finished: Bool) -> Void)
131131
return.collapsed
132132
}
133133
}
134-
134+
135135
publicoverridefunc isEqual(_ object:Any?)->Bool{
136136
guardlet position= objectas?PulleyPositionelse{
137137
returnfalse
138138
}
139139

140140
returnself.rawValue== position.rawValue
141141
}
142+
143+
publicoverridevardescription:String{
144+
switch rawValue{
145+
case0:
146+
return"collapsed"
147+
case1:
148+
return"partiallyrevealed"
149+
case2:
150+
return"open"
151+
case3:
152+
return"closed"
153+
default:
154+
return"collapsed"
155+
}
156+
}
142157
}
143158

144159
/// Represents the current display mode for Pulley
@@ -630,6 +645,8 @@ open class PulleyViewController: UIViewController, PulleyDrawerViewControllerDel
630645

631646
fileprivatevarisAnimatingDrawerPosition:Bool=false
632647

648+
fileprivatevarisChangingDrawerPosition:Bool=false
649+
633650
/// The height of the open position for the drawer
634651
privatevarheightOfOpenDrawer:CGFloat{
635652

@@ -955,7 +972,14 @@ open class PulleyViewController: UIViewController, PulleyDrawerViewControllerDel
955972

956973
maskDrawerVisualEffectView()
957974
maskBackgroundDimmingView()
958-
setDrawerPosition(position: drawerPosition, animated:false)
975+
976+
// Do not need to set the the drawer position in layoutSubview if the position of the drawer is changing
977+
// and the view is being layed out. If the drawer position is changing and the view is layed out (i.e.
978+
// a value or constraints are bing updated) the drawer is always set to the last position,
979+
// and no longer scrolls properly.
980+
ifself.isChangingDrawerPosition==false{
981+
setDrawerPosition(position: drawerPosition, animated:false)
982+
}
959983
}
960984

961985
// MARK: Private State Updates
@@ -1527,6 +1551,7 @@ extension PulleyViewController: UIScrollViewDelegate {
15271551

15281552
publicfunc scrollViewDidEndDragging(_ scrollView:UIScrollView, willDecelerate decelerate:Bool){
15291553

1554+
15301555
if scrollView== drawerScrollView
15311556
{
15321557
// Find the closest anchor point and snap there.
@@ -1650,6 +1675,12 @@ extension PulleyViewController: UIScrollViewDelegate {
16501675
}
16511676
}
16521677

1678+
publicfunc scrollViewWillBeginDragging(_ scrollView:UIScrollView){
1679+
if scrollView== drawerScrollView{
1680+
self.isChangingDrawerPosition=true
1681+
}
1682+
}
1683+
16531684
publicfunc scrollViewWillEndDragging(_ scrollView:UIScrollView, withVelocity velocity:CGPoint, targetContentOffset:UnsafeMutablePointer<CGPoint>){
16541685

16551686
prepareFeedbackGenerator()
@@ -1660,6 +1691,7 @@ extension PulleyViewController: UIScrollViewDelegate {
16601691

16611692
// Halt intertia
16621693
targetContentOffset.pointee= scrollView.contentOffset
1694+
self.isChangingDrawerPosition=false
16631695
}
16641696
}
16651697

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp