{"action":"created","issue":{"url":"https://api.github.com/repos/mwaterfall/MWPhotoBrowser/issues/367","labels_url":"https://api.github.com/repos/mwaterfall/MWPhotoBrowser/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/mwaterfall/MWPhotoBrowser/issues/367/comments","events_url":"https://api.github.com/repos/mwaterfall/MWPhotoBrowser/issues/367/events","html_url":"https://github.com/mwaterfall/MWPhotoBrowser/issues/367","id":57903757,"number":367,"title":"How to put a delete button along with share button like native Photos app","user":{"login":"RajChanchal","id":7058465,"avatar_url":"https://avatars.githubusercontent.com/u/7058465?v=3","gravatar_id":"","url":"https://api.github.com/users/RajChanchal","html_url":"https://github.com/RajChanchal","followers_url":"https://api.github.com/users/RajChanchal/followers","following_url":"https://api.github.com/users/RajChanchal/following{/other_user}","gists_url":"https://api.github.com/users/RajChanchal/gists{/gist_id}","starred_url":"https://api.github.com/users/RajChanchal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RajChanchal/subscriptions","organizations_url":"https://api.github.com/users/RajChanchal/orgs","repos_url":"https://api.github.com/users/RajChanchal/repos","events_url":"https://api.github.com/users/RajChanchal/events{/privacy}","received_events_url":"https://api.github.com/users/RajChanchal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-17T09:53:46Z","updated_at":"2015-07-28T10:51:58Z","closed_at":null,"body":"Hi,\r\nHow can I make the MWPhotoBrowser to look like native Photos app browser. I wanted to put the delete and share button at bottom, I don't need 'Edit' button though. Is there any way or code you might already have implemented? Or can you help implementing it?"},"comment":{"url":"https://api.github.com/repos/mwaterfall/MWPhotoBrowser/issues/comments/125554541","html_url":"https://github.com/mwaterfall/MWPhotoBrowser/issues/367#issuecomment-125554541","issue_url":"https://api.github.com/repos/mwaterfall/MWPhotoBrowser/issues/367","id":125554541,"user":{"login":"KKKKaras","id":10040534,"avatar_url":"https://avatars.githubusercontent.com/u/10040534?v=3","gravatar_id":"","url":"https://api.github.com/users/KKKKaras","html_url":"https://github.com/KKKKaras","followers_url":"https://api.github.com/users/KKKKaras/followers","following_url":"https://api.github.com/users/KKKKaras/following{/other_user}","gists_url":"https://api.github.com/users/KKKKaras/gists{/gist_id}","starred_url":"https://api.github.com/users/KKKKaras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KKKKaras/subscriptions","organizations_url":"https://api.github.com/users/KKKKaras/orgs","repos_url":"https://api.github.com/users/KKKKaras/repos","events_url":"https://api.github.com/users/KKKKaras/events{/privacy}","received_events_url":"https://api.github.com/users/KKKKaras/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T10:51:58Z","updated_at":"2015-07-28T10:51:58Z","body":"@RajChanchal   ok~  im a novice.\r\n\r\nI add the method at the MWPhotoBrowserDelegate   （ in the MWPhotoBrowser.h）\r\n- (void)deleteAnyPicture;\r\n\r\nthen  add  this  （MWPhotoBrowser.m）\r\n[_compileBtn addTarget:self action:@selector(delete:) forControlEvents:UIControlEventTouchUpInside];\r\n        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:_compileBtn];\r\n\r\n#pragma mark -补充删除-\r\n-(void)delete:(id)sender\r\n{\r\n//  user delegate\r\n    [self.delegate deleteAnyPicture];\r\n}\r\n----------------------------when use -------------------------\r\n- (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser {\r\n    \r\n    //if no photo  popViewControllerAnimated\r\n    if(_mwPhotos.count == 0)\r\n    {\r\n        \r\n        [self.navigationController popViewControllerAnimated:YES];\r\n    }\r\n    return _mwPhotos.count;\r\n}\r\n- (id <MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index {\r\n    if (index < _imgData.count)\r\n        return [_mwPhotos objectAtIndex:index];\r\n    return nil;\r\n}\r\n\r\n- (id <MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser thumbPhotoAtIndex:(NSUInteger)index\r\n{\r\n    if (index < _imgData.count)\r\n        return [_mwPhotos objectAtIndex:index];\r\n    return nil;\r\n}\r\n- (void)photoBrowser:(MWPhotoBrowser *)photoBrowser didDisplayPhotoAtIndex:(NSUInteger)index {\r\n    NSLog(@\"Did start viewing photo at index %lu\", (unsigned long)index);\r\n    \r\n_imgIndex=(unsigned long)index;// GET index \r\n}\r\n\r\n-(void)deleteAnyPicture// delegate  call this method\r\n {\r\n    NSLog(@\"you delete the %d photo\",_imgIndex);\r\n    [_mwPhotos removeObjectAtIndex:_imgIndex];\r\n\r\n    NSLog(@\"%@\",_imgData[_imgIndex]);\r\n    //判断删除了哪一张图片\r\n    [_ImgAndVedioData enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {\r\n        if([obj objectForKey:@\"fullImage\"]==_imgData[_imgIndex])\r\n        {\r\n            [_ImgAndVedioData removeObject:obj];\r\n        }\r\n    }];\r\n    [browser reloadData];\r\n    \r\n}\r\n//  the  _imgIndex  is int  。record photo‘s index  that you choose。\r\nmy English is poor 。im sorry  :("}}