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.

  • Memory leak when filtering with Core image
  • Xcode 9 - Localization Issue Warning Storyboard
  • Difference between properties and variables in iOS header file?
  • How to update each custom tableview cell data at the same time?
  • How can I get the iOS device CPU architecture in runtime
  • Use UIImagePickerController in landscape mode in Swift 2.0
  • 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 ;).