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

Missing withSlideshowColors() with SDWebImage #423

Open
crasholo opened this issue Jul 26, 2021 · 1 comment
Open

Missing withSlideshowColors() with SDWebImage #423

crasholo opened this issue Jul 26, 2021 · 1 comment

Comments

@crasholo
Copy link

Hi.
I'm using ImageSlideshow with some images loaded via SDWebImage.
My podfile has the entries (these two only):
pod 'SDWebImage', '~> 5.0'
pod "ImageSlideshow/SDWebImage"

but i get the error Type 'UIPageControl' has no member 'withSlideshowColors'

What am I missing o doing wrong?
Thanks

@mahesh-rideziro
Copy link

mahesh-rideziro commented Aug 5, 2021

Hi @crasholo

'withSlideshowColors' func is missing in the ImageSlideshow library. For your error, you can make a local extension like the below code then your issue will be resolved.

extension UIPageControl {

public static func withSlideshowColors() -> UIPageControl {
    let pageControl = UIPageControl()

    if #available(iOS 13.0, *) {
        pageControl.currentPageIndicatorTintColor = UIColor { traits in
            traits.userInterfaceStyle == .dark ? .white : .lightGray
        }
    } else {
        pageControl.currentPageIndicatorTintColor = .lightGray
    }
    
    if #available(iOS 13.0, *) {
        pageControl.pageIndicatorTintColor = UIColor { traits in
            traits.userInterfaceStyle == .dark ? .systemGray : .black
        }
    } else {
        pageControl.pageIndicatorTintColor = .black
    }

    return pageControl
}

}

cheer!!!

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

No branches or pull requests

2 participants