zvonicek / ImageSlideshow

Swift image slideshow with circular scrolling, timer and full screen viewer
MIT License
1.77k stars 474 forks source link

Missing withSlideshowColors() with SDWebImage #423

Open crasholo opened 3 years ago

crasholo commented 3 years ago

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 commented 3 years ago

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!!!