Skip to content

Commit

Permalink
bug fixed for #304
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-0000 committed Apr 2, 2018
1 parent e8af321 commit dec02b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 5.0.8

#### Updated
- #304 CaptionViewForPhotoAtIndex is not work
- #302 Add method to remove all images for SKCache by filograno

## 5.0.7

#### Updated
Expand Down
6 changes: 3 additions & 3 deletions SKPhotoBrowser/SKPagingScrollView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ private extension SKPagingScrollView {
}

func createCaptionView(_ index: Int) -> SKCaptionView? {
// if let delegate = self.browser?.delegate {
// return delegate.captionViewForPhotoAtIndex?(index: index)
// }
if let delegate = self.browser?.delegate, let ownCaptionView = delegate.captionViewForPhotoAtIndex?(index: index) {
return ownCaptionView
}
guard let photo = browser?.photoAtIndex(index), photo.caption != nil else {
return nil
}
Expand Down
5 changes: 5 additions & 0 deletions SKPhotoBrowser/SKPhotoBrowserDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ import Foundation

/**
Tells the delegate that the controls view toggled visibility
- Parameter browser: reference to the calling SKPhotoBrowser
- Parameter hidden: the status of visibility control
*/
@objc optional func controlsVisibilityToggled(_ browser: SKPhotoBrowser, hidden: Bool)

/**
Allows the delegate to create its own caption view
- Parameter index: the index of the photo
*/
@objc optional func captionViewForPhotoAtIndex(index: Int) -> SKCaptionView?
}
Expand Down

0 comments on commit dec02b2

Please sign in to comment.