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

I'm trying to display images from JSON. But the Images are not showing up ? #18

Closed
AruLNadhaN opened this issue Feb 16, 2016 · 2 comments

Comments

@AruLNadhaN
Copy link

     override func viewDidLoad() {
        super.viewDidLoad()
      Banners { (imagesource) in
            if imagesource != nil {
                self.bannershow()
            }
        }
  }

    func Banners(completionHandler: ([AlamofireSource]?) -> ()) -> (){
Alamofire.request(.GET, "http://46.101.121.31/mobileapp/gps/api.php?rquest=get_banners")
            .responseJSON{ response in
                if let data = response.result.value{
                    let json = JSON(data)
                    let count = json["image_path"].count
                    for index in 0...count-1 {
                        let image :String = json["image_path"][index].stringValue
                        let source : AlamofireSource = AlamofireSource(urlString: image)!
                        print(image)
                        self.Banner.append(source)
                    }
                    completionHandler(self.Banner)
                }
        }
    }

    func bannershow(){
        self.slideshow.backgroundColor = UIColor.whiteColor()
        self.slideshow.slideshowInterval = 2.0
        self.slideshow.contentScaleMode = UIViewContentMode.ScaleToFill
        self.slideshow.setImageInputs(self.Banner)
        let recognizer = UITapGestureRecognizer(target: self, action: "click")
        self.slideshow.addGestureRecognizer(recognizer)
    }
@danieltorrer
Copy link

Did you solve it? I'm having the same issue, images are not showing up.

@zvonicek
Copy link
Owner

Possible duplicate with #17 , please follow up on this issue there or reopen the issue if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants