Gif And Image Load in Background in Swift

Posted By : Amit Kumar Mishra | 26-Sep-2018

Sometimes you can,t load A gif in proper and faces some issues lot of search.

1- Gif load-

A. First, you go to your project and add " pod 'Kingfisher' " in your pod file

B. Then go to the terminal and write command "cd your file path"

C. Then write command "pod install" (it will take some time then install it)

D. Go to your project and use where you load your gif with this syntax "your image outlet name with a dot like (imageView.kf.setImage(with your imageUrl)) "

E. Run your app 

you can easily load your Gif and it does not block the UI and you scroll upward or downward easily. 

 

2- Image Load- 

A. First, you go to your project and add " pod 'AlamofireImage' " in your pod file

B. Then go to the terminal and write command "cd your file path"

C. Then write command "pod install" (it will take some time then install it)

D. Go to your project and use where you load your image with this syntax "your image outlet name with a dot like (imageView.af.setImage(with your imageUrl)) "

E. Run your app 

you can easily load your Image and it does not block the UI and you scroll upward or downward easily. 

 

Both are the very light and tested pod for ios developer for easy development in ios and save lots of time to handle the image and gif to proper load and Crash your app.

sometimes memory issues face because image or gif take to more cache memory and block UI then app can't run properly. you just install and run your app is light.

In gif pod basically, use in Swift 4 and above newer versions, it provides a lot of handling to load in the background your gif. It can't affect the app.

 

About Author

Author Image
Amit Kumar Mishra

Amit Kumar Mishra is working as an iOS Application developer and he is very dedicated towards his work.

Request for Proposal

Name is required

Comment is required

Sending message..