Set UIImageView image using a url

后端 未结 10 715
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 02:24

Is it possible to read a url to an image and set a UIImageView to the image at this url?

10条回答
  •  自闭症患者
    2020-12-08 03:06

    use AFNetworking category UIImageView+AFNetworking.h

     #import "UIImageView+AFNetworking.h
    
    
    [profileImageView setImageWithURL:[NSURL URLWithString:photoURL] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    

提交回复
热议问题