Skip to content

Commit c28f612

Browse files
authored
Merge pull request #10 from scotbond/swift2.3
Swift 2.3
2 parents 6cb4dd8 + 47849d1 commit c28f612

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

INSPhotoGallery/INSPhotosTransitionAnimator.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioni
8686
if let toView = transitionContext.viewForKey(UITransitionContextToViewKey),
8787
let toViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) {
8888
toView.frame = transitionContext.finalFrameForViewController(toViewController)
89-
if let containerView = transitionContext.containerView() where !toView.isDescendantOfView(containerView) {
89+
let containerView = transitionContext.containerView()
90+
91+
if !toView.isDescendantOfView(containerView) {
9092
containerView.addSubview(toView)
9193
}
9294
}
9395

9496
if dismissing {
9597
if let fromView = transitionContext.viewForKey(UITransitionContextFromViewKey) {
96-
transitionContext.containerView()?.bringSubviewToFront(fromView)
98+
transitionContext.containerView().bringSubviewToFront(fromView)
9799
}
98100
}
99101
}
@@ -116,9 +118,7 @@ class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioni
116118

117119
func performZoomingAnimationWithTransitionContext(transitionContext: UIViewControllerContextTransitioning) {
118120

119-
guard let containerView = transitionContext.containerView() else {
120-
return
121-
}
121+
let containerView = transitionContext.containerView()
122122
guard let startingView = startingView, let endingView = endingView else {
123123
return
124124
}
@@ -185,4 +185,4 @@ class INSPhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioni
185185
}
186186
transitionContext.completeTransition(!transitionContext.transitionWasCancelled())
187187
}
188-
}
188+
}

INSPhotoGallery/INSPhotosViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,12 @@ public class INSPhotosViewController: UIViewController, UIPageViewControllerData
373373
}
374374

375375
public override func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool {
376-
if let _ = currentPhoto?.image ?? currentPhotoViewController?.scalingImageView.image where shouldHandleLongPressGesture && action == #selector(NSObject.copy(_:)) {
376+
if let _ = currentPhoto?.image ?? currentPhotoViewController?.scalingImageView.image where shouldHandleLongPressGesture && action == #selector(NSObject.copy) {
377377
return true
378378
}
379379
return false
380380
}
381-
381+
382382
// MARK: - Status Bar
383383

384384
public override func prefersStatusBarHidden() -> Bool {

INSPhotoGallery/UIVIew+INSPhotoViewer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extension UIView {
3939

4040
return snapshotedView
4141
} else {
42-
return snapshotViewAfterScreenUpdates(true)
42+
return snapshotViewAfterScreenUpdates(true)!
4343
}
4444
}
4545

0 commit comments

Comments
 (0)