fix aaptions with just 1 character aren’t displayed when opening the image
This commit is contained in:
parent
9ca4c83b70
commit
a6b63c827e
|
@ -27,13 +27,13 @@ public class CaptionContainerView: UIView {
|
|||
}
|
||||
|
||||
func updatePagerTransition(ratioComplete: CGFloat) {
|
||||
if let currentText = self.currentText, currentText.count > 1 {
|
||||
if let currentText = self.currentText, currentText.count > 0 {
|
||||
currentCaptionView.alpha = 1 - ratioComplete
|
||||
} else {
|
||||
currentCaptionView.alpha = 0
|
||||
}
|
||||
|
||||
if let pendingText = self.pendingText, pendingText.count > 1 {
|
||||
if let pendingText = self.pendingText, pendingText.count > 0 {
|
||||
pendingCaptionView.alpha = ratioComplete
|
||||
} else {
|
||||
pendingCaptionView.alpha = 0
|
||||
|
@ -48,6 +48,8 @@ public class CaptionContainerView: UIView {
|
|||
self.currentCaptionView = self.pendingCaptionView
|
||||
self.pendingCaptionView = oldCaptionView
|
||||
self.pendingText = nil
|
||||
self.currentCaptionView.alpha = 1
|
||||
self.pendingCaptionView.alpha = 0
|
||||
}
|
||||
|
||||
// MARK: Initializers
|
||||
|
|
Loading…
Reference in New Issue