I have followed all the links on Google and StackOverFlow, unfortunately, I could not find any reliable solution Specifically for iPad devices.
I am using the sample code from 
CodePudding user response:
Your code looks fine. It seems like there is conflict between Upside Down and Landscape here. In Info tab, unchecking the iPad Orientation state Upside Down could fix the problem.
Output:


