diff --git a/README.md b/README.md index fb85f72..4738477 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,8 @@ SKPhotoBrowser [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Cocoapods Compatible](https://img.shields.io/cocoapods/v/SKPhotoBrowser.svg?style=flat)](http://cocoadocs.org/docsets/SKPhotoBrowser) -[![Swift 2.0](https://img.shields.io/badge/Swift-2.0-orange.svg?style=flat)](https://developer.apple.com/swift/) -Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift2.0, based on [IDMPhotoBrowser](https://github.com/ideaismobile/IDMPhotoBrowser), [MWPhotoBrowser](https://github.com/mwaterfall/MWPhotoBrowser). +Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift, based on [IDMPhotoBrowser](https://github.com/ideaismobile/IDMPhotoBrowser), [MWPhotoBrowser](https://github.com/mwaterfall/MWPhotoBrowser). ## features - Can display one or more images by providing either `UIImage` objects, or string of URL array. @@ -16,7 +15,7 @@ Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written - Landscape handling. - Delete photo support(by offbye). By set displayDelete=true show a delete icon in statusbar, deleted indexes can be obtain from delegate func didDeleted -![sample](Screenshots/example01.gif) +![sample](Screenshots/example02.gif) ## Requirements - iOS 8.0+ diff --git a/SKPhotoBrowser.podspec b/SKPhotoBrowser.podspec index 7fc6c4b..e8d1619 100644 --- a/SKPhotoBrowser.podspec +++ b/SKPhotoBrowser.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SKPhotoBrowser" - s.version = "1.7.0" + s.version = "1.7.1" s.summary = "Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift2.0." s.homepage = "https://github.com/suzuki-0000/SKPhotoBrowser" s.license = { :type => "MIT", :file => "LICENSE" } diff --git a/SKPhotoBrowserExample/SKPhotoBrowserExample/Base.lproj/Main.storyboard b/SKPhotoBrowserExample/SKPhotoBrowserExample/Base.lproj/Main.storyboard index 9e76a95..539e8d5 100644 --- a/SKPhotoBrowserExample/SKPhotoBrowserExample/Base.lproj/Main.storyboard +++ b/SKPhotoBrowserExample/SKPhotoBrowserExample/Base.lproj/Main.storyboard @@ -1,7 +1,7 @@ - + - + diff --git a/SKPhotoBrowserExample/SKPhotoBrowserExample/ViewController.swift b/SKPhotoBrowserExample/SKPhotoBrowserExample/ViewController.swift index 522fd5f..164664e 100644 --- a/SKPhotoBrowserExample/SKPhotoBrowserExample/ViewController.swift +++ b/SKPhotoBrowserExample/SKPhotoBrowserExample/ViewController.swift @@ -10,6 +10,9 @@ import UIKit import SKPhotoBrowser class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, SKPhotoBrowserDelegate { + private final let screenBound = UIScreen.mainScreen().bounds + private var screenWidth: CGFloat { return screenBound.size.width } + private var screenHeight: CGFloat { return screenBound.size.height } @IBOutlet weak var collectionView: UICollectionView! var images = [SKPhoto]() @@ -92,6 +95,14 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection presentViewController(browser, animated: true, completion: {}) } + func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { + if UIDevice.currentDevice().userInterfaceIdiom == .Pad { + return CGSize(width: screenWidth/2 - 5, height: 300) + } else { + return CGSize(width: screenWidth/2 - 5, height: 200) + } + } + // MARK: - SKPhotoBrowserDelegate func didShowPhotoAtIndex(index: Int) { collectionView.visibleCells().forEach({$0.hidden = false}) diff --git a/Screenshots/example02.gif b/Screenshots/example02.gif new file mode 100644 index 0000000..326bce0 Binary files /dev/null and b/Screenshots/example02.gif differ