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

Images is not showing with the url #17

Open
veersr9 opened this issue Jul 22, 2019 · 0 comments
Open

Images is not showing with the url #17

veersr9 opened this issue Jul 22, 2019 · 0 comments

Comments

@veersr9
Copy link

veersr9 commented Jul 22, 2019

Why images is not showing with the url ? It was showing before uninstall but after uninstall then reinstall it is now showing only indicator is moving.

`extension HomeVC: PhotoCollectionViewDataSource, PhotoCollectionViewDelegate {

func photoCollectionView(_ photoCollectionView: PhotoCollectionView, photoSource index: Int) -> PhotoSource {
    
    let mediatype = arrayMedia[index].mediaType
    if mediatype == 0 {
        let mediaurl = arrayMedia[index].mediaUrls
        let device = UIDevice.modelName
        for allsubimages in mediaurl {
            let url = (allsubimages as AnyObject).object(forKey: "url") as? String
            print(url)
            let size = (allsubimages as AnyObject).object(forKey: "size") as? String
            let _id = (allsubimages as AnyObject).object(forKey: "_id") as? String
            
            
            switch device {
            case "iPhone 4", "iPhone 4s", "iPhone 5", "iPhone 5s", "iPhone 5c", "iPhone SE", "Simulator iPhone 4", "Simulator iPhone 4s", "Simulator iPhone 5", "Simulator iPhone 5s", "Simulator iPhone 5c", "Simulator iPhone SE":
                if size == "40x40"
                {
                    imagesFromData = url
                    break
                }
                
                
            case "iPhone 6", "iPhone 6s", "iPhone 7", "iPhone 8", "Simulator iPhone 6", "Simulator iPhone 6s", "Simulator iPhone 7", "Simulator iPhone 8":
                if size == "75x75"
                {
                    imagesFromData = url
                    break
                }
                
            case "iPhone 6 Plus","iPhone 6s Plus","iPhone 7 Plus","iPhone 8 Plus","Simulator iPhone 6s Plus", "Simulator iPhone 7 Plus", "Simulator iPhone 6 Plus", "Simulator iPhone 8 Plus" :
                if size == "125x125"
                {
                    imagesFromData = url
                    break
                }
                
                
            case "iPhone X","iPhone XS","iPhone XS Max","iPhone XR", "Simulator iPhone XR", "Simulator iPhone XS Max", "Simulator iPhone XS", "Simulator iPhone X" :
                if size == "275x275"
                {
                    imagesFromData = url
                    break
                }
                
                
            default:
                break
            }
        }
    } else { // For Video URL
        
    }
    
    return .url(URL(string: imagesFromData!))
    
}

func numPhotos(in photoCollectionView: PhotoCollectionView) -> Int {
    return arrayMedia.count
}

}`

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

1 participant