Load images from NSURL async with RestKit

后端 未结 2 1813
余生分开走
余生分开走 2021-02-09 17:39

Is there a wrapper or some sort of built-in functionality available in RestKit to load a UIImage from an NSURL asynchronously using callba

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-09 18:10

    Not sure about a RestKit solution, but SDWebImage is a library that will let you easily load images asynchronously by adding a category to UIImageView, so all you have to write is this (for example):

    [myImageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
                   placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
    

提交回复
热议问题