Home:ALL Converter>Alamofire request being fired more than once

Alamofire request being fired more than once

Ask Time:2016-04-17T07:35:48         Author:Terrance

Json Formatter

Im currently using the code below to download an image from a URL (NSData of image is needed) but for some reason the request is fired more than once in some cases (Times 2 or 3 times), I was wondering if there was something I'm doing wrong here and will it have an impact on memory or slow down my app? (This is implemented within a tableview cell, there is a condition set in place to not fire the request if the image within the current cell image already has an image which works a expected)

 Alamofire.request(.GET, imgURL)
                .response{ response in

                        if let image = response.2{
                      print("GIF image downloaded") //FIRED MORE THAN ONCE (2-3)
                    }else{
                        print("GIF image download failed")
                    }
            }

Author:Terrance,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/36671025/alamofire-request-being-fired-more-than-once
yy