Search code examples
objective-cios7mwphotobrowser

MWPhotoBrowser - how to force to select just one photo on selection mode?


I am using MWPhotoBrowser in my app.

I just need to force to select only one photo on selection mode.

Is there any way or tip we can implement that functionality?

Thanks in advance!!


Solution

  • Bring the following changes in the implementation of delegate method of MWPhotoBrowser.

    - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index selectedChanged:(BOOL)selected {
        for (int i=0;i<selectedPhotos.count;i++)
        {
            [selectedPhotos replaceObjectAtIndex:i withObject:[NSNumber numberWithBool:NO]];
        }
        [selectedPhotos replaceObjectAtIndex:index withObject:[NSNumber numberWithBool:selected]];
    }