diff --git a/e-Hentai.xcodeproj/project.pbxproj b/e-Hentai.xcodeproj/project.pbxproj index 4c8f9496..51478501 100644 --- a/e-Hentai.xcodeproj/project.pbxproj +++ b/e-Hentai.xcodeproj/project.pbxproj @@ -39,6 +39,12 @@ 01519AF51A3053BA0091C985 /* IPadDownloadManagerCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01519AF41A3053BA0091C985 /* IPadDownloadManagerCell.xib */; }; 015755421A3055B4009083B4 /* IPadSearchFilterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 015755411A3055B4009083B4 /* IPadSearchFilterViewController.xib */; }; 015B89E819FF9B2500CFA9DE /* SupportKitLocalizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 015B89E619FF9B2500CFA9DE /* SupportKitLocalizable.strings */; }; + 0162712D1A538F08005DCD29 /* MeetAVParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 0162712B1A538F08005DCD29 /* MeetAVParser.m */; }; + 016271381A539845005DCD29 /* VideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 016271351A539845005DCD29 /* VideoViewController.m */; }; + 016271391A539845005DCD29 /* VideoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 016271361A539845005DCD29 /* VideoViewController.xib */; }; + 0162713D1A5398CF005DCD29 /* VideoCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0162713B1A5398CF005DCD29 /* VideoCollectionViewCell.m */; }; + 0162713E1A5398CF005DCD29 /* VideoCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0162713C1A5398CF005DCD29 /* VideoCollectionViewCell.xib */; }; + 016271401A53E097005DCD29 /* IPadVideoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0162713F1A53E097005DCD29 /* IPadVideoViewController.xib */; }; 0163C7D719D8FD5300105ECF /* DownloadedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0163C7D619D8FD5300105ECF /* DownloadedViewController.m */; }; 0163E4721A3FD019007C3D58 /* DiveExHentai.m in Sources */ = {isa = PBXBuildFile; fileRef = 0163E4711A3FD019007C3D58 /* DiveExHentai.m */; }; 016A359F19B6FB8A00E3371A /* HentaiParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 016A359E19B6FB8A00E3371A /* HentaiParser.m */; }; @@ -156,6 +162,15 @@ 015755411A3055B4009083B4 /* IPadSearchFilterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = IPadSearchFilterViewController.xib; path = SearchFilterViewController/IPadSearchFilterViewController.xib; sourceTree = ""; }; 015B89E419FF9AC900CFA9DE /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = ""; }; 015B89E719FF9B2500CFA9DE /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/SupportKitLocalizable.strings"; sourceTree = ""; }; + 0162712A1A538F08005DCD29 /* MeetAVParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MeetAVParser.h; sourceTree = ""; }; + 0162712B1A538F08005DCD29 /* MeetAVParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MeetAVParser.m; sourceTree = ""; }; + 016271341A539845005DCD29 /* VideoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoViewController.h; sourceTree = ""; }; + 016271351A539845005DCD29 /* VideoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoViewController.m; sourceTree = ""; }; + 016271361A539845005DCD29 /* VideoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VideoViewController.xib; sourceTree = ""; }; + 0162713A1A5398CF005DCD29 /* VideoCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoCollectionViewCell.h; sourceTree = ""; }; + 0162713B1A5398CF005DCD29 /* VideoCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoCollectionViewCell.m; sourceTree = ""; }; + 0162713C1A5398CF005DCD29 /* VideoCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VideoCollectionViewCell.xib; sourceTree = ""; }; + 0162713F1A53E097005DCD29 /* IPadVideoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IPadVideoViewController.xib; sourceTree = ""; }; 0163C7D519D8FD5300105ECF /* DownloadedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DownloadedViewController.h; path = DownloadedViewController/DownloadedViewController.h; sourceTree = ""; }; 0163C7D619D8FD5300105ECF /* DownloadedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DownloadedViewController.m; path = DownloadedViewController/DownloadedViewController.m; sourceTree = ""; }; 0163E4701A3FD019007C3D58 /* DiveExHentai.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiveExHentai.h; sourceTree = ""; }; @@ -437,6 +452,29 @@ path = Hpple; sourceTree = ""; }; + 016271271A538F08005DCD29 /* MeetParser */ = { + isa = PBXGroup; + children = ( + 0162712A1A538F08005DCD29 /* MeetAVParser.h */, + 0162712B1A538F08005DCD29 /* MeetAVParser.m */, + ); + path = MeetParser; + sourceTree = ""; + }; + 016271311A539845005DCD29 /* VideoViewController */ = { + isa = PBXGroup; + children = ( + 016271341A539845005DCD29 /* VideoViewController.h */, + 016271351A539845005DCD29 /* VideoViewController.m */, + 016271361A539845005DCD29 /* VideoViewController.xib */, + 0162713F1A53E097005DCD29 /* IPadVideoViewController.xib */, + 0162713A1A5398CF005DCD29 /* VideoCollectionViewCell.h */, + 0162713B1A5398CF005DCD29 /* VideoCollectionViewCell.m */, + 0162713C1A5398CF005DCD29 /* VideoCollectionViewCell.xib */, + ); + path = VideoViewController; + sourceTree = ""; + }; 0163C7D419D8FC5600105ECF /* DownloadedViewController */ = { isa = PBXGroup; children = ( @@ -613,6 +651,7 @@ children = ( 013F8F061A490B66002B8C47 /* RealmModels */, 0137F40919C1684500528359 /* HentaiDownloadCenter */, + 016271271A538F08005DCD29 /* MeetParser */, 0150033319B6E5E90055F47D /* HentaiParser */, 0163E46F1A3FD019007C3D58 /* DiveExHentai */, 0150033619B6E5E90055F47D /* ThirdParty */, @@ -629,6 +668,7 @@ 01758F711A3FE05300677BA2 /* ExMainViewController */, 0118081119B6F06200FE0DA1 /* PhotoViewController */, 0163C7D419D8FC5600105ECF /* DownloadedViewController */, + 016271311A539845005DCD29 /* VideoViewController */, 019926A019ADDB83009F814B /* Images.xcassets */, 0199268F19ADDB83009F814B /* Supporting Files */, ); @@ -769,6 +809,8 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 016271401A53E097005DCD29 /* IPadVideoViewController.xib in Resources */, + 0162713E1A5398CF005DCD29 /* VideoCollectionViewCell.xib in Resources */, 017AE5C31A00D24600317939 /* SearchFilterViewController.xib in Resources */, 0180D91C1A021282002554FC /* exterior@3x.png in Resources */, 019926A119ADDB83009F814B /* Images.xcassets in Resources */, @@ -799,6 +841,7 @@ 015B89E819FF9B2500CFA9DE /* SupportKitLocalizable.strings in Resources */, 0180D92C1A02140E002554FC /* settings@3x.png in Resources */, 015755421A3055B4009083B4 /* IPadSearchFilterViewController.xib in Resources */, + 016271391A539845005DCD29 /* VideoViewController.xib in Resources */, 0180D9281A02139F002554FC /* phone2@3x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -852,10 +895,12 @@ 013F8F111A490D59002B8C47 /* HentaiSaveLibrary_HentaiResult.m in Sources */, 019290221A25D6C70094B423 /* DaiPortalBlockAnalysis.m in Sources */, 0150034619B6E5E90055F47D /* XPathQuery.m in Sources */, + 0162713D1A5398CF005DCD29 /* VideoCollectionViewCell.m in Sources */, 01FB6FD419E23FB4006CBEF2 /* NSString+Hentai.m in Sources */, 013F8F0E1A490BB1002B8C47 /* HentaiSaveLibrary_HentaiInfo.m in Sources */, 016BBF0F19B94E4F0015E11E /* LightWeightPlist+HandleCache.m in Sources */, 0118081619B6F06200FE0DA1 /* HentaiNavigationController.m in Sources */, + 016271381A539845005DCD29 /* VideoViewController.m in Sources */, 016BBF1519B953D40015E11E /* HentaiDownloadImageOperation.m in Sources */, 01758F741A3FE07400677BA2 /* ExMainViewController.m in Sources */, 013F8F141A490DBA002B8C47 /* HentaiSaveLibrary_Images.m in Sources */, @@ -875,6 +920,7 @@ 019290251A25D6C70094B423 /* NSObject+DaiPortal.m in Sources */, 01BBD60119E3D428003538CF /* HentaiPhotoCell.m in Sources */, 013F8F171A490E06002B8C47 /* HentaiSaveLibrary.m in Sources */, + 0162712D1A538F08005DCD29 /* MeetAVParser.m in Sources */, 016BBF1119B94E4F0015E11E /* LightWeightPlist.m in Sources */, 019290211A25D6C70094B423 /* DaiPortal.m in Sources */, 016BBF0B19B94E4F0015E11E /* FilesManager.m in Sources */, diff --git a/e-Hentai/MeetParser/MeetAVParser.h b/e-Hentai/MeetParser/MeetAVParser.h new file mode 100644 index 00000000..af599db1 --- /dev/null +++ b/e-Hentai/MeetParser/MeetAVParser.h @@ -0,0 +1,22 @@ +// +// MeetAVParser.h +// e-Hentai +// +// Created by 啟倫 陳 on 2014/12/26. +// Copyright (c) 2014年 ChilunChen. All rights reserved. +// + +#import + +typedef enum { + MeetParserStatusNetworkFail = -1, + MeetParserStatusParseFail, + MeetParserStatusSuccess +} MeetParserStatus; + +@interface MeetAVParser : NSObject + ++ (void)requestListForQuery:(NSString *)query completion:(void (^)(MeetParserStatus status, NSArray *listArray))completion; ++ (void)parseVideoFrom:(NSString *)urlString completion:(void (^)(MeetParserStatus status, NSString *videoURL))completion; + +@end diff --git a/e-Hentai/MeetParser/MeetAVParser.m b/e-Hentai/MeetParser/MeetAVParser.m new file mode 100644 index 00000000..67e8d701 --- /dev/null +++ b/e-Hentai/MeetParser/MeetAVParser.m @@ -0,0 +1,108 @@ +// +// MeetAVParser.m +// e-Hentai +// +// Created by 啟倫 陳 on 2014/12/26. +// Copyright (c) 2014年 ChilunChen. All rights reserved. +// + +#import "MeetAVParser.h" + +#import + +@implementation MeetAVParser + +#pragma mark - class method + ++ (void)requestListForQuery:(NSString *)query completion:(void (^)(MeetParserStatus status, NSArray *listArray))completion { + NSString *queryString = [NSString stringWithFormat:@"http://www.meetav.com/search_result.php?query=%@&type=videos&submit=Search", query]; + + [NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[queryString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]] queue:[self defaultOperationQueue] completionHandler: ^(NSURLResponse *response, NSData *data, NSError *connectionError) { + if (connectionError) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(MeetParserStatusNetworkFail, nil); + }); + return; + } + + NSMutableArray *listArray = [NSMutableArray array]; + TFHpple *xpathParser = [[TFHpple alloc] initWithHTMLData:data encoding:@"utf-8"]; + NSArray *pageURL = [xpathParser searchWithXPathQuery:@"//h2 [@style='display:none']//a"]; + NSArray *thumbURL = [xpathParser searchWithXPathQuery:@"//div [@class='vid_thumb']//a//img"]; + + if ([pageURL count]) { + for (int i=0; i<[pageURL count]; i++) { + TFHppleElement *eachURL = pageURL[i]; + TFHppleElement *eachThumbURL = thumbURL[i]; + [listArray addObject:@{ @"title":[eachURL text], @"url":[eachURL attributes][@"href"], @"thumb":[eachThumbURL attributes][@"src"] }]; + } + dispatch_async(dispatch_get_main_queue(), ^{ + completion(MeetParserStatusSuccess, listArray); + }); + } + else { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(MeetParserStatusParseFail, nil); + }); + } + }]; +} + ++ (void)parseVideoFrom:(NSString *)urlString completion:(void (^)(MeetParserStatus status, NSString *videoURL))completion { + [self setCompletion:completion]; + [[self meetAVWebView] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]]; +} + +#pragma mark - UIWebViewDelegate + ++ (void)webViewDidFinishLoad:(UIWebView *)webView { + NSString *hq_video_file = [self.meetAVWebView stringByEvaluatingJavaScriptFromString:@"hq_video_file"]; + if (hq_video_file) { + if ([[hq_video_file pathExtension] isEqualToString:@"mp4"]) { + [self completion](MeetParserStatusSuccess, hq_video_file); + } + else { + [self completion](MeetParserStatusParseFail, nil); + } + [webView stopLoading]; + [self setMeetAVWebView:nil]; + } +} + ++ (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { + [self completion](MeetParserStatusNetworkFail, nil); + [webView stopLoading]; + [self setMeetAVWebView:nil]; +} + +#pragma mark - runtime objects + ++ (void)setMeetAVWebView:(UIWebView *)meetAVWebView { + objc_setAssociatedObject(self, @selector(meetAVWebView), meetAVWebView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + ++ (UIWebView *)meetAVWebView { + if (!objc_getAssociatedObject(self, _cmd)) { + UIWebView *meetAVWebView = [UIWebView new]; + meetAVWebView.delegate = (id )self; + [self setMeetAVWebView:meetAVWebView]; + } + return objc_getAssociatedObject(self, _cmd); +} + ++ (void)setCompletion:(void (^)(MeetParserStatus status, NSString *videoURL))completion { + objc_setAssociatedObject(self, @selector(completion), completion, OBJC_ASSOCIATION_COPY_NONATOMIC); +} + ++ (void (^)(MeetParserStatus status, NSString *videoURL))completion { + return objc_getAssociatedObject(self, _cmd); +} + ++ (NSOperationQueue *)defaultOperationQueue { + if (!objc_getAssociatedObject(self, _cmd)) { + objc_setAssociatedObject(self, _cmd, [NSOperationQueue new], OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + return objc_getAssociatedObject(self, _cmd); +} + +@end diff --git a/e-Hentai/Menu.plist b/e-Hentai/Menu.plist index 65197111..3085d11d 100644 --- a/e-Hentai/Menu.plist +++ b/e-Hentai/Menu.plist @@ -18,6 +18,14 @@ controller ExMainViewController + + displayName + MeetAV(試閱) + image + exterior + controller + VideoViewController + displayName 已下載 diff --git a/e-Hentai/SliderViewController/SliderViewController.h b/e-Hentai/SliderViewController/SliderViewController.h index 7ec48ba1..585bdf76 100644 --- a/e-Hentai/SliderViewController/SliderViewController.h +++ b/e-Hentai/SliderViewController/SliderViewController.h @@ -10,7 +10,8 @@ #import "MainViewController.h" #import "MenuViewController.h" +#import "VideoViewController.h" -@interface SliderViewController : IIViewDeckController +@interface SliderViewController : IIViewDeckController @end diff --git a/e-Hentai/SliderViewController/SliderViewController.m b/e-Hentai/SliderViewController/SliderViewController.m index 139505dc..0b4d73e7 100644 --- a/e-Hentai/SliderViewController/SliderViewController.m +++ b/e-Hentai/SliderViewController/SliderViewController.m @@ -26,6 +26,16 @@ - (void)needToPushViewController:(UIViewController *)controller { [hentaiNavigation pushViewController:controller animated:YES]; } +#pragma mark - VideoViewControllerDelegate + +- (void)needToPresentMovieViewController:(MPMoviePlayerViewController *)controller { + UIWindow *newWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + UIViewController *rootViewController = [UIViewController new]; + newWindow.rootViewController = rootViewController; + [newWindow makeKeyAndVisible]; + [rootViewController presentMoviePlayerViewControllerAnimated:controller]; +} + #pragma mark - MenuViewControllerDelegate //切換 controller diff --git a/e-Hentai/VideoViewController/IPadVideoViewController.xib b/e-Hentai/VideoViewController/IPadVideoViewController.xib new file mode 100644 index 00000000..6801cc85 --- /dev/null +++ b/e-Hentai/VideoViewController/IPadVideoViewController.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/e-Hentai/VideoViewController/VideoCollectionViewCell.h b/e-Hentai/VideoViewController/VideoCollectionViewCell.h new file mode 100644 index 00000000..66857ddb --- /dev/null +++ b/e-Hentai/VideoViewController/VideoCollectionViewCell.h @@ -0,0 +1,16 @@ +// +// VideoCollectionViewCell.h +// e-Hentai +// +// Created by 啟倫 陳 on 2014/12/31. +// Copyright (c) 2014年 ChilunChen. All rights reserved. +// + +#import + +@interface VideoCollectionViewCell : UICollectionViewCell + +@property (weak, nonatomic) IBOutlet UIImageView *cellImageView; +@property (weak, nonatomic) IBOutlet UILabel *cellLabel; + +@end diff --git a/e-Hentai/VideoViewController/VideoCollectionViewCell.m b/e-Hentai/VideoViewController/VideoCollectionViewCell.m new file mode 100644 index 00000000..8c666cb1 --- /dev/null +++ b/e-Hentai/VideoViewController/VideoCollectionViewCell.m @@ -0,0 +1,24 @@ +// +// VideoCollectionViewCell.m +// e-Hentai +// +// Created by 啟倫 陳 on 2014/12/31. +// Copyright (c) 2014年 ChilunChen. All rights reserved. +// + +#import "VideoCollectionViewCell.h" + +@implementation VideoCollectionViewCell + +#pragma mark - life cycle + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil]; + self = arrayOfViews[0]; + } + return self; +} + +@end diff --git a/e-Hentai/VideoViewController/VideoCollectionViewCell.xib b/e-Hentai/VideoViewController/VideoCollectionViewCell.xib new file mode 100644 index 00000000..67a3e460 --- /dev/null +++ b/e-Hentai/VideoViewController/VideoCollectionViewCell.xib @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/e-Hentai/VideoViewController/VideoViewController.h b/e-Hentai/VideoViewController/VideoViewController.h new file mode 100644 index 00000000..2a866953 --- /dev/null +++ b/e-Hentai/VideoViewController/VideoViewController.h @@ -0,0 +1,29 @@ +// +// VideoViewController.h +// e-Hentai +// +// Created by 啟倫 陳 on 2014/12/26. +// Copyright (c) 2014年 ChilunChen. All rights reserved. +// + +#import "ColorThemeViewController.h" + +#import + +#import "VideoCollectionViewCell.h" + +@protocol VideoViewControllerDelegate; + +@interface VideoViewController : ColorThemeViewController + +@property (nonatomic, weak) id delegate; +@property (weak, nonatomic) IBOutlet UICollectionView *meetAVCollectionView; + +@end + +@protocol VideoViewControllerDelegate + +@required +- (void)needToPresentMovieViewController:(MPMoviePlayerViewController *)controller; + +@end diff --git a/e-Hentai/VideoViewController/VideoViewController.m b/e-Hentai/VideoViewController/VideoViewController.m new file mode 100644 index 00000000..0bc452e8 --- /dev/null +++ b/e-Hentai/VideoViewController/VideoViewController.m @@ -0,0 +1,80 @@ +// +// VideoViewController.m +// e-Hentai +// +// Created by 啟倫 陳 on 2014/12/26. +// Copyright (c) 2014年 ChilunChen. All rights reserved. +// + +#import "VideoViewController.h" + +#import "MeetAVParser.h" + +@interface VideoViewController () + +@property (nonatomic, strong) NSArray *listArray; + +@end + +@implementation VideoViewController + +#pragma mark - UICollectionViewDataSource + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return [self.listArray count]; +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + VideoCollectionViewCell *cell = (VideoCollectionViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"VideoCollectionViewCell" forIndexPath:indexPath]; + NSURL *imageURL = [NSURL URLWithString:self.listArray[indexPath.row][@"thumb"]]; + [cell.cellImageView sd_setImageWithURL:imageURL]; + cell.cellLabel.text = self.listArray[indexPath.row][@"title"]; + return cell; +} + +#pragma mark - UICollectionViewDelegate + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + [SVProgressHUD show]; + @weakify(self); + [MeetAVParser parseVideoFrom:self.listArray[indexPath.row][@"url"] completion:^(MeetParserStatus status, NSString *videoURL) { + @strongify(self); + if (status == MeetParserStatusSuccess) { + MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:videoURL]]; + [self.delegate needToPresentMovieViewController:player]; + [SVProgressHUD dismiss]; + } + else { + [UIAlertView hentai_alertViewWithTitle:@"錯誤 >X<" message:@"影片格式錯誤或是網路錯誤~ >x<" cancelButtonTitle:@"不好意思~ >X<"]; + } + }]; +} + +#pragma mark - life cycle + +- (id)init { + self = [super initWithNibName:xibName bundle:nil]; + if (self) { + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + self.title = @"MeetAV"; + [self.meetAVCollectionView registerClass:[VideoCollectionViewCell class] forCellWithReuseIdentifier:@"VideoCollectionViewCell"]; + + [SVProgressHUD show]; + [MeetAVParser requestListForQuery:@"鬼父" completion:^(MeetParserStatus status, NSArray *listArray) { + if (status == MeetParserStatusSuccess) { + self.listArray = listArray; + [self.meetAVCollectionView reloadData]; + } + else { + [UIAlertView hentai_alertViewWithTitle:@"錯誤 >X<" message:@"先選到別的功能吧~" cancelButtonTitle:@"謝謝~ >X<"]; + } + [SVProgressHUD dismiss]; + }]; +} + +@end diff --git a/e-Hentai/VideoViewController/VideoViewController.xib b/e-Hentai/VideoViewController/VideoViewController.xib new file mode 100644 index 00000000..312ba438 --- /dev/null +++ b/e-Hentai/VideoViewController/VideoViewController.xib @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/e-Hentai/e-Hentai-Prefix.pch b/e-Hentai/e-Hentai-Prefix.pch index 66aa281e..1c3b34ca 100644 --- a/e-Hentai/e-Hentai-Prefix.pch +++ b/e-Hentai/e-Hentai-Prefix.pch @@ -26,6 +26,7 @@ #import "NSObject+DaiPortal.h" #import "Pgyer.h" #import "Flurry.h" + #import "MeetAVParser.h" //from pod #import