user2722667
user2722667

Reputation: 8661

Swift ios is it possible to swipe between images using UIImageView

First off, I am new to swift / ios.

In my viewcontroller I have a UIImageView, in that I load in an URL form an extrenal API in order to show an image.

What I want to do now is to to be able to swipe between image(s), so I dont want a pageviewcontroller.

Is this possible to do with a UIImageView? If so please share any example / github library, it would help alot.

Thanks in advance,

Upvotes: 0

Views: 2229

Answers (1)

Duncan C
Duncan C

Reputation: 131418

No, you can't really swipe between images using an image view. You could, however, put an image view inside another view and swipe/pan to slide between images. That is a fair amount of work to implement.

You should not be so quick to reject UIPageViewController. It has a slide style as an alternative to the page curl style. It handles what you want to do beautifully. Setting up a page view controller is a lot like setting up a table view or a collection view.

Do a search in the Xcode help system on "PhotoScroller". That will point you to a demo app that provides a UI for scrolling through a series of images. It handles tiling of large images so it's more than you need, but it serves as an example of the UI I think you are after.

Upvotes: 2

Related Questions