[update]minor update for example. readme.

This commit is contained in:
suzuki_keishi 2016-03-17 19:43:52 +09:00
parent cc91489501
commit 5b7b2f7f01
5 changed files with 16 additions and 6 deletions

View File

@ -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+

View File

@ -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" }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="qgG-zu-Htx">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="14F1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="qgG-zu-Htx">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--Local Images-->

View File

@ -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})

BIN
Screenshots/example02.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB