|
|
@ -27,13 +27,13 @@ public class CaptionContainerView: UIView {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func updatePagerTransition(ratioComplete: CGFloat) {
|
|
|
|
func updatePagerTransition(ratioComplete: CGFloat) {
|
|
|
|
if let currentText = self.currentText, currentText.count > 1 {
|
|
|
|
if let currentText = self.currentText, currentText.count > 0 {
|
|
|
|
currentCaptionView.alpha = 1 - ratioComplete
|
|
|
|
currentCaptionView.alpha = 1 - ratioComplete
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
currentCaptionView.alpha = 0
|
|
|
|
currentCaptionView.alpha = 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if let pendingText = self.pendingText, pendingText.count > 1 {
|
|
|
|
if let pendingText = self.pendingText, pendingText.count > 0 {
|
|
|
|
pendingCaptionView.alpha = ratioComplete
|
|
|
|
pendingCaptionView.alpha = ratioComplete
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
pendingCaptionView.alpha = 0
|
|
|
|
pendingCaptionView.alpha = 0
|
|
|
@ -48,6 +48,8 @@ public class CaptionContainerView: UIView {
|
|
|
|
self.currentCaptionView = self.pendingCaptionView
|
|
|
|
self.currentCaptionView = self.pendingCaptionView
|
|
|
|
self.pendingCaptionView = oldCaptionView
|
|
|
|
self.pendingCaptionView = oldCaptionView
|
|
|
|
self.pendingText = nil
|
|
|
|
self.pendingText = nil
|
|
|
|
|
|
|
|
self.currentCaptionView.alpha = 1
|
|
|
|
|
|
|
|
self.pendingCaptionView.alpha = 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: Initializers
|
|
|
|
// MARK: Initializers
|
|
|
|