Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Update Pod
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyyoung committed May 24, 2016
1 parent e16895f commit c6ede6f
Show file tree
Hide file tree
Showing 6 changed files with 1,440 additions and 576 deletions.
1,963 changes: 1,415 additions & 548 deletions Meizi.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Meizi/MeiziViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <UIKit/UIKit.h>
#import <SYPhotoBrowser/SYPhotoBrowser.h>
#import <HMSegmentedControl/HMSegmentedControl.h>

@interface MeiziViewController : UIViewController
Expand Down
24 changes: 10 additions & 14 deletions Meizi/MeiziViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import "MeiziRequest.h"
#import "MeiziCell.h"
#import "Meizi.h"
#import "AppDelegate.h"

@interface MeiziViewController () <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>

Expand Down Expand Up @@ -128,7 +129,7 @@ - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSe
}

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
NSInteger perLine = UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)?3:5;
NSInteger perLine = ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait)?3:5;
return CGSizeMake(kScreenWidth/perLine-1, kScreenWidth/perLine-1);
}

Expand All @@ -142,26 +143,21 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
[self.collectionView performBatchUpdates:^{
[self.collectionView setCollectionViewLayout:self.collectionView.collectionViewLayout animated:YES];
} completion:nil];
}];
[self.collectionView.collectionViewLayout invalidateLayout];
[self.collectionView.collectionViewLayout finalizeCollectionViewUpdates];
}

#pragma mark - CollectionView Delegate

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
NSMutableArray *photoArray = [NSMutableArray array];
NSMutableArray *photoURLArray = [NSMutableArray array];
for (Meizi *meizi in self.meiziArray) {
MWPhoto *photo = [MWPhoto photoWithURL:[NSURL URLWithString:meizi.largeSrc]];
photo.caption = meizi.title;
[photoArray addObject:photo];
[photoURLArray addObject:meizi.src];
}
MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithPhotos:photoArray];
browser.alwaysShowControls = YES;
[browser setCurrentPhotoIndex:indexPath.row];
[self.navigationController pushViewController:browser animated:YES];
SYPhotoBrowser *photoBrowser = [[SYPhotoBrowser alloc] initWithImageSourceArray:photoURLArray caption:nil delegate:self];
photoBrowser.enableStatusBarHidden = NO;
photoBrowser.pageControlStyle = SYPhotoBrowserPageControlStyleLabel;
[((AppDelegate *)[UIApplication sharedApplication].delegate).window.rootViewController presentViewController:photoBrowser animated:YES completion:nil];
}

#pragma mark - Property method
Expand Down
1 change: 0 additions & 1 deletion Meizi/PrefixHeader.pch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#import <MJRefresh/MJRefresh.h>
#import <MJExtension/MJExtension.h>
#import <SVProgressHUD/SVProgressHUD.h>
#import <MWPhotoBrowser/MWPhotoBrowser.h>
#import <SDWebImage/UIImageView+WebCache.h>
#import <UIActivityIndicator-for-SDWebImage/UIImageView+UIActivityIndicatorForSDWebImage.h>

Expand Down
6 changes: 5 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
platform :ios, '8.0'
inhibit_all_warnings!

target 'Meizi' do

pod 'AFNetworking'
pod 'YYCache'
pod 'hpple'
Expand All @@ -10,4 +12,6 @@ pod 'SDWebImage'
pod 'SVProgressHUD'
pod 'UIActivityIndicator-for-SDWebImage'
pod 'HMSegmentedControl'
pod 'MWPhotoBrowser'
pod 'SYPhotoBrowser'

end
21 changes: 9 additions & 12 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ PODS:
- DACircularProgress (2.3.1)
- HMSegmentedControl (1.5.2)
- hpple (0.2.0)
- MBProgressHUD (0.9.2)
- MJExtension (3.0.10)
- MJRefresh (3.1.0)
- MWPhotoBrowser (2.1.2):
- DACircularProgress (~> 2.3)
- MBProgressHUD (~> 0.9)
- SDWebImage (!= 3.7.2, ~> 3.7)
- SDWebImage (3.7.5):
- SDWebImage/Core (= 3.7.5)
- SDWebImage/Core (3.7.5)
- SDWebImage (3.7.6):
- SDWebImage/Core (= 3.7.6)
- SDWebImage/Core (3.7.6)
- SVProgressHUD (2.0.3)
- SYPhotoBrowser (2.1):
- DACircularProgress
- SDWebImage
- UIActivityIndicator-for-SDWebImage (1.2):
- SDWebImage (~> 3.7)
- YYCache (1.0.3)
Expand All @@ -38,9 +36,9 @@ DEPENDENCIES:
- hpple
- MJExtension
- MJRefresh
- MWPhotoBrowser
- SDWebImage
- SVProgressHUD
- SYPhotoBrowser
- UIActivityIndicator-for-SDWebImage
- YYCache

Expand All @@ -49,12 +47,11 @@ SPEC CHECKSUMS:
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
HMSegmentedControl: 83b9686022d2176fb6457d2bdb61e5d6393fed7d
hpple: 3b765f96fc2cd56ad1a49aef6f7be5cb2aa64b57
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548
MJRefresh: 743e6404967d1c2c688472ea3ecfde247d872db4
MWPhotoBrowser: 5836d7aa041dc05a13de380c246826578adc5ea5
SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461
SDWebImage: c325cf02c30337336b95beff20a13df489ec0ec9
SVProgressHUD: b0830714205bea1317ea1a2ebc71e5633af334d4
SYPhotoBrowser: 68be184ed938d9fa23cc94c60e638e9322a53677
UIActivityIndicator-for-SDWebImage: 7bf7ebbf0ed1747dedc0d6e949c4603a6d0f9e0c
YYCache: 282f35b5b0990833d0b7a06d864a87141a021da2

Expand Down

0 comments on commit c6ede6f

Please sign in to comment.