[update]minor update for example. readme.
This commit is contained in:
parent
cc91489501
commit
5b7b2f7f01
|
|
@ -3,9 +3,8 @@ SKPhotoBrowser
|
|||
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](http://cocoadocs.org/docsets/SKPhotoBrowser)
|
||||
[](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
|
||||
|
||||

|
||||

|
||||
|
||||
## Requirements
|
||||
- iOS 8.0+
|
||||
|
|
|
|||
|
|
@ -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" }
|
||||
|
|
|
|||
|
|
@ -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-->
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
Loading…
Reference in New Issue