This is a cool little feature I found in iOS 11. When you get the camera close to horizontal, two crosshairs appear. You can then line them up to make sure your phone is horizontal.
It makes taking pictures documents really easy (although Notes in iOS 11 is even better for that)