Search code examples
iosuiviewcontrolleruiscrollviewphoto-gallery

iOS, are "swipe to view next image" and "tap to hide ui" default functionalities?


I noticed that quite a few applications that allow you to view images have a couple default behaviors:

  1. You can pinch do zoom, rotate and swipe to show the previous and next images
  2. You can tap to hide the rest of the UI, and the UI is semi transparent

Since those behaviors are exactly the same on Apple's and Third Party (I.E.: Dropbox) applications, I was wondering if it is some sort of default controller provided by Apple (like UIImagePicker to take pictures).

If YES, which how can I use that controller? if NO, any suggestions on how I can implement it?


Solution

  • No, although you will see this implemented in a lot of apps, and it feel consistent, it is not something out of the box.

    Swipe to next image is in fact a scroll view with images inside, using the scroll view delegate to "snap" to an image as the user moved from left to right.

    Tap to show/hide UI is also just a UITapGestureRecognizer set up to animate show/hide the controls.