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

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

Open
YuStephen opened this issue Sep 21, 2018 · 1 comment
Open

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

YuStephen opened this issue Sep 21, 2018 · 1 comment

Comments

@YuStephen
Copy link

YuStephen commented Sep 21, 2018

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)
}
@SMFakhir
Copy link

It seems so.

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

2 participants