Best practices for managing facebook friends pics in iOS App

i’m working on an iOS app which has a tableview containing facebook friends’ list, I want to manage this list for scrolling performance.

i don’t want to load the images each time user open that friend list view, and for that images can be saved locally but at the same time it would not be a good practice as users can change their profile pictures after we already saved older ones to file system.

  • Storing images locally on an iOS device
  • what is the code to detect whether ios app running in iPhone, iPhone Retina display, or iPad?
  • Handling Image Store to Firebase with Swift
  • UIImage initWithContentsOfFile doesn't work
  • Replace a particular color inside an image with another color
  • Is there way to get metadata of the image file in iOS?
  • So i just wondering what is the best way to manage this?

    Also how can i get those images in best possible optimized size?

    thanks in advance

    2 Solutions Collect From Internet About “Best practices for managing facebook friends pics in iOS App”

    You might be able to use setImageWithURL:placeholderImage: in the UIImageView class in AFNetworking to load a placeholder (or existing image) and then request the latest image which will get updated when fetched.

    The docs are here:

    http://afnetworking.org/Documentation/Categories/UIImageView+AFNetworking.html

    The project is here:

    https://github.com/AFNetworking/AFNetworking/

    UIImageView should take care of resizing the images.

    Well if you want to set placeholder image it is possible. The FBProfilePictureView is a UIView but if take a look into the code you’ll see that they add UIImageView to it. That’s why you can use:

    for (UIView *view in cell.faceImageView.subviews) {
        if ([view isKindOfClass:[UIImageView class]]) {
            [(UIImageView*)view setImage:[UIImage imageNamed:@"placeholder"]];
            break;
        }
    }
    

    Ofc, that’s a workaround. However until they provide better thing you don’t have to mess here with AFNetworking(which is a great lib btw) and finding facebook image url ;).