Skip to content

Commit

Permalink
Improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
3lvis committed Oct 20, 2016
1 parent 3ade1af commit 0b81930
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,25 @@ Pinch-to-zoom works seamlessly in images.
From your UICollectionView:

```swift
override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: IndexPath) {
override public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
guard let collectionView = self.collectionView else { return }

let viewerController = ViewerController(initialIndexPath: indexPath, collectionView: collectionView)
viewerController.dataSource = self

let headerView = HeaderView()
headerView.viewDelegate = self
self.viewerController?.headerView = headerView

let footerView = FooterView()
footerView.viewDelegate = self
self.viewerController?.footerView = footerView
viewerController.dataSource = self

self.presentViewController(viewerController, animated: false, completion: nil)
}

extension CollectionController: ViewerControllerDataSource {
func viewerController(viewerController: ViewerController, itemAtIndexPath indexPath: IndexPath) -> Viewable {
func viewerController(_ viewerController: ViewerController, viewableAt indexPath: IndexPath) -> Viewable {
return self.photos[indexPath.row]
}
}
Expand Down

0 comments on commit 0b81930

Please sign in to comment.