JiongXing / PhotoBrowser

Elegant photo browser in Swift. 图片与视频浏览器。
MIT License
1.32k stars 207 forks source link

一点建议 #99

Closed zhanfengkuang closed 6 years ago

zhanfengkuang commented 6 years ago
public init(photoLoader: JXPhotoLoader,
                numberOfItems: @escaping () -> Int,
                localImage: @escaping (Int) -> UIImage?,
                autoloadURLString: @escaping (Int) -> String?) {
        self.photoLoader = photoLoader
        self.numberOfItemsCallback = numberOfItems
        self.localImageCallback = localImage
        self.autoloadURLStringCallback = autoloadURLString
    }

加载网络图片时, 既然是通过kingfisher 为何不将 localImageCallback autoloadURLStringCallback 放到loader中, 如果这两个回调有其他用途, 那么也可以给其默认值, 不然每次调用代码看起来臃肿

JiongXing commented 6 years ago

Loader和DataSource的分工不同,Loader只做网图加载。