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

After getting data from the Server and when i try to load if show blank white screen #17

Closed
O-mkar opened this issue Jan 26, 2016 · 6 comments
Labels

Comments

@O-mkar
Copy link

O-mkar commented Jan 26, 2016

Here is code
i try to set it to new images which are downloaded self.homeSlideShow.setImageInputs(convertToAlmofireSource(sliderImages))

//Code for getting data

Alamofire.request(apiMethod("banners"), createUrl("banners", getPram: ["":""]), headers: headers)
            .responseSwiftyJSON({ (request, response, json, error) in
                if error == nil {
                    let jsonData = json
                    if jsonData["error"].bool == false {
                        sliderImages.removeAll()
                        for item in jsonData["data"]{
                            sliderImages.append(createImgUrl("banners", imgName: item.1["img"].string!))
                        }
                        dataSource.setValue(sliderImages, forKey: "banners")
                        self.homeSlideShow.setImageInputs(convertToAlmofireSource(sliderImages))

                    }else if jsonData["error"].bool == true {
                        self.presentViewController(createAlert(jsonData["message"].string!), animated: true, completion: nil)
                    }
                }else{

                    self.presentViewController(createAlert("internet"), animated: true, completion: nil)

                }
            })

//convert function

func convertToAlmofireSource(images: [String]) -> [AlamofireSource]{
    let img = images
    var sliderImg = [AlamofireSource]()
    for item in img {
        sliderImg.append(AlamofireSource(urlString: item)!)
    }

    return sliderImg
}

Everthing works fine just it show white screen when i load new images

@dasoga
Copy link

dasoga commented Mar 16, 2016

Some update to this issue?, I have the same problem.

@zvonicek
Copy link
Owner

@dasoga, @O-mkar, thank you for the report. I've managed to reproduce the bug and will look into that as soon as possible.

@zvonicek
Copy link
Owner

I think I may have found the problem. The possible fix is committed in master. @dasoga and other guys, could you please try it that it fixes your problem? If so, I'll release a new version.

@dasoga
Copy link

dasoga commented Mar 17, 2016

@zvonicek Sure, let me try, right now...

@dasoga
Copy link

dasoga commented Mar 17, 2016

@zvonicek Is working good dude. Thanks a lot!

@zvonicek
Copy link
Owner

@dasoga Thanks! I've just released new version with the bugfix.

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

No branches or pull requests

3 participants