Closed zhoujun706 closed 4 years ago
or notch index
the delegate function just can get after notch index, i want to get the index before change
Please read the README https://github.com/applidium/OverlayContainer#tracking-the-overlay
func overlayContainerViewController(_ containerViewController: OverlayContainerViewController,
willMoveOverlay overlayViewController: UIViewController,
toNotchAt index: Int)
this function index is toNotch , i want current notch, how can i get this like containerControlloer.currentNotchIndex
I just use moveOverlay() function, but i want recorde the notchindex before move
thankyou
You have to track the current index yourself:
var lastNotchReached = 0
func overlayContainerViewController(_ containerViewController: OverlayContainerViewController,
didMoveOverlay overlayViewController: UIViewController,
toNotchAt index: Int) {
self.lastNotchReached = index
}
``
thanks for your reply.
I will draw a picture for you tomorrow, then you will understand . Today is too late thanks again
Hello , please see this: thank you
I don't understand… since your overlay moved to the top, you should have a callback. I don't see it on your image.
For example, the KVO can get old value and new value. And now the OverlayContainerViewControllerDelegate function just can get the new value(index), I want the old value(index) .
Thank you : )
If you do https://github.com/applidium/OverlayContainer/issues/63#issuecomment-620578139, lastNotchReached
will correspond to the previous notch index
All right, thank you . I solve the problem as you say, but I define a property to recorde can or not update last index. Thank you
as title