Skip to content

Commit 32734eb

Browse files
committed
Merge branch 'release/4.2.0'
2 parents 38dc99d + a27eece commit 32734eb

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

Zoomy/Classes/Classes/ImageZoomController.swift

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,29 @@ extension ImageZoomController: UIScrollViewDelegate {
479479

480480
//MARK: UIGestureRecognizerDelegate
481481
extension ImageZoomController: UIGestureRecognizerDelegate {
482-
483482
public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
483+
if gestureRecognizer == imageViewPinchGestureRecognizer,
484+
gestureRecognizer.numberOfTouches > 1,
485+
otherGestureRecognizer is UIPanGestureRecognizer &&
486+
otherGestureRecognizer != imageViewPanGestureRecognizer {
487+
return false
488+
}
484489
return true
485490
}
486491

492+
public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool {
493+
if gestureRecognizer == imageViewPinchGestureRecognizer,
494+
gestureRecognizer.numberOfTouches > 1,
495+
otherGestureRecognizer is UIPanGestureRecognizer &&
496+
otherGestureRecognizer != imageViewPanGestureRecognizer {
497+
return true
498+
}
499+
return false
500+
}
501+
487502
public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
488503
guard let action = gestureRecognizerActions[gestureRecognizer] else { return true }
489504

490505
return !(action is Action.None)
491506
}
492-
}
507+
}

Zoomy/Classes/Classes/ImageZoomControllerIsPresentingScrollViewOverlayState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private extension ImageZoomControllerIsPresentingScrollViewOverlayState {
180180
case .smallerThanAnsestorView:
181181
return owner.settings.primaryBackgroundColor
182182
case .fillsAnsestorView:
183-
return owner.settings.secundaryBackgroundColor
183+
return owner.settings.secondaryBackgroundColor
184184
}
185185
}
186186

Zoomy/Classes/Extensions/ImageZoomControllerSettings+Equatable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extension ImageZoomControllerSettings: Equatable {
99
lhs.isEnabled == rhs.isEnabled &&
1010
lhs.shouldDisplayBackground == rhs.shouldDisplayBackground &&
1111
lhs.primaryBackgroundColor == rhs.primaryBackgroundColor &&
12-
lhs.secundaryBackgroundColor == rhs.secundaryBackgroundColor &&
12+
lhs.secondaryBackgroundColor == rhs.secondaryBackgroundColor &&
1313
lhs.neededTranslationToDismissOverlayOnScrollBounce == rhs.neededTranslationToDismissOverlayOnScrollBounce
1414
}
1515
}

Zoomy/Classes/Structs/ImageZoomControllerSettings.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public struct ImageZoomControllerSettings: ConfigurableUsingClosure {
3131

3232
/// BackgroundView's color will animate to this value when content becomes bigger than or equal to any dimension of the view it's displayed in
3333
/// This will only have effect when shouldDisplayBackground is set to true
34-
public var secundaryBackgroundColor = UIColor.black
34+
public var secondaryBackgroundColor = UIColor.black
3535

3636
/// The scale at which the primary backgroundColor will be fully visible, alpha is lower before that
3737
public var primaryBackgroundColorThreshold: ImageViewScale = 2
@@ -134,9 +134,9 @@ public extension ImageZoomControllerSettings {
134134
return settings
135135
}
136136

137-
func with(secundaryBackgroundColor: UIColor) -> Settings {
137+
func with(secondaryBackgroundColor: UIColor) -> Settings {
138138
var settings = self
139-
settings.secundaryBackgroundColor = secundaryBackgroundColor
139+
settings.secondaryBackgroundColor = secondaryBackgroundColor
140140
return settings
141141
}
142142

0 commit comments

Comments
 (0)