Skip to content

Error on MediaBrowser(media: [Media]) #59

@YuStephen

Description

@YuStephen

Hello sir, when i use code like bottom to browser ,it doesn't show image and swipegesture doesn't work. so it's must have a delegate?

func showPhotoBrowser(photos: [Any], atIndex: Int, viewController: UIViewController) {
    
    var tempArray = [Media]()
    
    for i in photos{
        if i is UIImage{
            let photo = Media(image: i as! UIImage)
            tempArray .append(photo)
        }
        
        if i is String{
            let photo = Media(url: i as! URL)
            tempArray .append(photo)
        }
    }
    
    let browser = MediaBrowser(media: tempArray)
    browser.setCurrentIndex(at: atIndex)
    let nc = UINavigationController.init(rootViewController: browser)
    nc.modalTransitionStyle = .crossDissolve
    viewController.present(nc, animated: true, completion: nil)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions