스토리 보드 기반 앱이 있고 MWPhotoBrowser를 사용하고 싶습니다. MWPhotoBrowser를 cocoaPods를 사용하여 프로젝트에 추가했습니다. 내 스토리 보드에서는 PhotoBrowserViewController라는 뷰 컨트롤러가 있는데, 다른 뷰 컨트롤러의 단추에서 푸시를 통해 액세스했습니다. 내 PhotoBrowerViewController에서 내가 추가 한 사진이 아니라 내가 설정 한 제목 만 볼 수 있습니까? 누구든지 나를 도울 수 있습니까? 당신이 두 번째 MWPhotoBrowserDelegate
MWPhotoBrowser를 스토리 보드 기반 앱에서 사용하는 방법은 무엇입니까?
이 클래스를 확인 된 경우
PhotoBrowserViewController.h
#import <UIKit/UIKit.h>
#import "MWPhotoBrowser.h"
@interface PhotoBrowserViewController : UIViewController<MWPhotoBrowserDelegate>
@property (nonatomic, strong) NSMutableArray *photos;
@end
PhotoBrowserViewController.m
#import "PhotoBrowserViewController.h"
@interface PhotoBrowserViewController()
@end
@implementation PhotoBrowserViewController
- (void)awakeFromNib
{
self.title = @"MWPhotoBrowser";
MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
browser.displayActionButton = YES;
[self.photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://www.ournorthstar.com/wp-content/uploads/2013/10/test1.jpg"]]];
}
- (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser {
return _photos.count;
}
- (id <MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index {
if (index < _photos.count)
return [_photos objectAtIndex:index];
return nil;
}
@end
생각? –