How to get top most overlay in ionic when we are using multiple overlays in ionic?

I am using ion-modal and ion-picker, in some scenarios both will be popped up, in that case how to find out which one is top most overlay?