Giter Site home page Giter Site logo

photocollectionview's People

Contributors

codacy-badger avatar noblakit01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

photocollectionview's Issues

problem with data source

Hi, i'm having problems with the lastest version, I set the datasource = self but the function is not triggered

Images is not showing with the url

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
}

}`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.