Search code examples
iosxamarin.iossdwebimage

How to use SDWebImage Binding with Xamarin,IOS


I'm trying to load image from web in UIImageView in Xamarin.IOS with SDWebImage nuget but i am unable to accomplish this task


Solution

  • Because SDWebImage is available on CocoaPod .So you can use Objective Sharpie to bind the library.Firstly you should download Objective Sharpie from here to your mac.

    Once Objective Sharpie is successfully installed, open a terminal and use the commands Objective Sharpie has to offer:

    $ sharpie pod init -f ios SDWebImage 
    

    Once your CocoaPod has been set up, you can now create the binding:

    $ sharpie pod bind
    

    This will result in the CocoaPod Xcode project being built and then evaluated and parsed by Objective Sharpie. A lot of console output will be generated, but should result in the binding definition at the end just like:

    (... lots of build output ...)
    
    Parsing 19 header files...
    
    Binding...
    [write] ApiDefinitions.cs
    [write] StructsAndEnums.cs
    
    Done.
    

    However ,there are some errors in ApiDefinitions.cs and StructsAndEnums.cs.Here is a similar case that you can refer .

    By addition ,if you want to load image ,you can use FFImageLoading.