Skip to content

Commit

Permalink
Swift 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
amitpdev committed Sep 15, 2016
1 parent 6cb4dd8 commit 47849d1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions INSPhotoGallery/INSPhotosTransitionAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,16 @@ class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioni
if let toView = transitionContext.viewForKey(UITransitionContextToViewKey),
let toViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) {
toView.frame = transitionContext.finalFrameForViewController(toViewController)
if let containerView = transitionContext.containerView() where !toView.isDescendantOfView(containerView) {
let containerView = transitionContext.containerView()

if !toView.isDescendantOfView(containerView) {
containerView.addSubview(toView)
}
}

if dismissing {
if let fromView = transitionContext.viewForKey(UITransitionContextFromViewKey) {
transitionContext.containerView()?.bringSubviewToFront(fromView)
transitionContext.containerView().bringSubviewToFront(fromView)
}
}
}
Expand All @@ -116,9 +118,7 @@ class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioni

func performZoomingAnimationWithTransitionContext(transitionContext: UIViewControllerContextTransitioning) {

guard let containerView = transitionContext.containerView() else {
return
}
let containerView = transitionContext.containerView()
guard let startingView = startingView, let endingView = endingView else {
return
}
Expand Down Expand Up @@ -185,4 +185,4 @@ class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioni
}
transitionContext.completeTransition(!transitionContext.transitionWasCancelled())
}
}
}
4 changes: 2 additions & 2 deletions INSPhotoGallery/INSPhotosViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ public class INSPhotosViewController: UIViewController, UIPageViewControllerData
}

public override func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool {
if let _ = currentPhoto?.image ?? currentPhotoViewController?.scalingImageView.image where shouldHandleLongPressGesture && action == #selector(NSObject.copy(_:)) {
if let _ = currentPhoto?.image ?? currentPhotoViewController?.scalingImageView.image where shouldHandleLongPressGesture && action == #selector(NSObject.copy) {
return true
}
return false
}

// MARK: - Status Bar

public override func prefersStatusBarHidden() -> Bool {
Expand Down
2 changes: 1 addition & 1 deletion INSPhotoGallery/UIVIew+INSPhotoViewer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension UIView {

return snapshotedView
} else {
return snapshotViewAfterScreenUpdates(true)
return snapshotViewAfterScreenUpdates(true)!
}
}

Expand Down

0 comments on commit 47849d1

Please sign in to comment.