 import UIKit
 
 @objc public protocol PhotoCollectionViewDataSource: NSObjectProtocol {
-    func photoColletionView(_ photoCollectionView: PhotoCollectionView, imageAt index: Int) -> UIImage
     func numPhotos(in photoCollectionView: PhotoCollectionView) -> Int
+    
+    @objc optional func photoColletionView(_ photoCollectionView: PhotoCollectionView, imageAt index: Int) -> UIImage?
+    @objc optional func photoCollectionView(_ photoCollectionView: PhotoCollectionView, urlImageAt index: Int) -> URL?
 }
 
 @IBDesignable

        var nextOffset = CGPoint.zero
        
        for i in 0..<numShow {
            let image = dataSource.photoColletionView(self, imageAt: i)
            if i == 0 {
                isVertical = image.size.width < image.size.height
            }
            var itemSize = CGSize.zero
            let offset = nextOffset

            }

            let photoView = PhotoView(frame: CGRect(origin: offset, size: itemSize))
            if let image = image {
                photoView.setImage(image)
            } else if let url = dataSource.photoCollectionView?(self, urlImageAt: i) {
                photoView.setUrl(url: url, photoCache: PhotoCache.default)
            }
            if numImage > maxImage && i == numShow - 1 {
                addMoreLabel(in: photoView, numMore: numImage - numShow)
            }
