Skip to content

Commit

Permalink
Fix: #34 INSPhotosViewController datasource public?
Browse files Browse the repository at this point in the history
  • Loading branch information
m1entus committed Feb 8, 2018
1 parent 4a593e4 commit f5dd5b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions INSPhotoGallery/INSPhotosInteractionAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

import UIKit

class INSPhotosInteractionAnimator: NSObject, UIViewControllerInteractiveTransitioning {
public class INSPhotosInteractionAnimator: NSObject, UIViewControllerInteractiveTransitioning {
var animator: UIViewControllerAnimatedTransitioning?
var viewToHideWhenBeginningTransition: UIView?
var shouldAnimateUsingAnimator: Bool = false

private var transitionContext: UIViewControllerContextTransitioning?

func startInteractiveTransition(_ transitionContext: UIViewControllerContextTransitioning) {
public func startInteractiveTransition(_ transitionContext: UIViewControllerContextTransitioning) {
viewToHideWhenBeginningTransition?.alpha = 0.0
self.transitionContext = transitionContext
}
Expand Down
6 changes: 3 additions & 3 deletions INSPhotoGallery/INSPhotosTransitionAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import UIKit

class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioning {
public class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioning {
var dismissing: Bool = false

var startingView: UIView?
Expand Down Expand Up @@ -53,7 +53,7 @@ class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioni
}
}

func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
if shouldPerformZoomingAnimation {
return animationDurationWithZooming
}
Expand All @@ -69,7 +69,7 @@ class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioni

// MARK:- UIViewControllerAnimatedTransitioning

func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
setupTransitionContainerHierarchyWithTransitionContext(transitionContext)

// There is issue with startingView frame when performFadeAnimation
Expand Down
14 changes: 7 additions & 7 deletions INSPhotoGallery/INSPhotosViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ open class INSPhotosViewController: UIViewController, UIPageViewControllerDataSo
}

// MARK: - Private
private(set) var pageViewController: UIPageViewController!
private(set) var dataSource: INSPhotosDataSource
public private(set) var pageViewController: UIPageViewController!
public private(set) var dataSource: INSPhotosDataSource

let interactiveAnimator: INSPhotosInteractionAnimator = INSPhotosInteractionAnimator()
let transitionAnimator: INSPhotosTransitionAnimator = INSPhotosTransitionAnimator()
public let interactiveAnimator: INSPhotosInteractionAnimator = INSPhotosInteractionAnimator()
public let transitionAnimator: INSPhotosTransitionAnimator = INSPhotosTransitionAnimator()

private(set) lazy var singleTapGestureRecognizer: UITapGestureRecognizer = {
public private(set) lazy var singleTapGestureRecognizer: UITapGestureRecognizer = {
return UITapGestureRecognizer(target: self, action: #selector(INSPhotosViewController.handleSingleTapGestureRecognizer(_:)))
}()
private(set) lazy var panGestureRecognizer: UIPanGestureRecognizer = {
public private(set) lazy var panGestureRecognizer: UIPanGestureRecognizer = {
return UIPanGestureRecognizer(target: self, action: #selector(INSPhotosViewController.handlePanGestureRecognizer(_:)))
}()

Expand Down Expand Up @@ -323,7 +323,7 @@ open class INSPhotosViewController: UIViewController, UIPageViewControllerDataSo

// MARK: - UIPageViewControllerDataSource / UIPageViewControllerDelegate

private func initializePhotoViewControllerForPhoto(_ photo: INSPhotoViewable) -> INSPhotoViewController {
public func initializePhotoViewControllerForPhoto(_ photo: INSPhotoViewable) -> INSPhotoViewController {
let photoViewController = INSPhotoViewController(photo: photo)
singleTapGestureRecognizer.require(toFail: photoViewController.doubleTapGestureRecognizer)
photoViewController.longPressGestureHandler = { [weak self] gesture in
Expand Down

0 comments on commit f5dd5b3

Please sign in to comment.