Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading spinner before image loads #17

Open
nkhaitan opened this issue Mar 30, 2016 · 3 comments
Open

Loading spinner before image loads #17

nkhaitan opened this issue Mar 30, 2016 · 3 comments

Comments

@nkhaitan
Copy link

Hello,

Is there a way we could have a progress spinner show up before the image loads completely?

Thanks,

Nilesh

@evgenyneu
Copy link
Owner

Hi, @nkhaitan, no, unfortunately the slideshow does not show a spinner right now.

This will a good feature to add. Feel free to submit a pull request. It can be done by adding a new settings property:

scrollView.auk.settings.showSpinnerWhileLoading = true

I personally prefer placeholder images.

// Show placeholder image while remote image is being downloaded.
scrollView.auk.settings.placeholderImage = UIImage(named: "placeholder.jpg")

You can see how it works and looks in the demo app.

@nkhaitan
Copy link
Author

Thanks a lot man! Will look into it. Also, is there a way I can add a button on the bottom right of each image?

@evgenyneu
Copy link
Owner

@nkhaitan, yes, it can be done. Each page in the scroll view is an instance of AukPage class which is a UIView subclass.

You can fork the library and add other subviews such as buttons into it. What we can also do is expose a public property that contains those pages in the form of UIViews, something like this:

let slideshowPages = scrollView.auk.pages // Array of UIView objects
slideshowPages[0].addSubview(button) // Add a button to the page of the slideshow
// Position the button with Auto Layout on the bottom right.

This will make it easier for other people to add subviews to pages without a need to maintain their own fork of the library. Feel free to submit a pull request with the pages property. There is already a helper method that returns the array of pages AukScrollViewContent.aukPages(scrollView: UIScrollView). It returns an array of AukPage objects. I would prefer to cast it to UIView before returning them to the user from the public pages property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants