Skip to content

Commit

Permalink
Merge branch 'release/2.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Boldt committed Aug 18, 2019
2 parents 0acbbd5 + 887797a commit 39bc6a3
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.2.2 (2019-5-8)
- fixed iOS13 issues

## 2.2.1 (2019-5-6)
- decreased minimum deployment target to iOS10

Expand Down
2 changes: 1 addition & 1 deletion Jelly.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Pod::Spec.new do |s|
s.name = 'Jelly'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.'

s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Foundation
final class CoverAnimator: NSObject {
private let presentationType : PresentationType
private let presentation : CoverPresentation
private var currentPropertyAnimator: UIViewPropertyAnimator?

init(presentationType: PresentationType, presentation: CoverPresentation) {
self.presentationType = presentationType
Expand All @@ -14,11 +15,15 @@ final class CoverAnimator: NSObject {
extension CoverAnimator : UIViewControllerAnimatedTransitioning {
func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let propertyAnimator = createPropertyAnimator(using: transitionContext)
currentPropertyAnimator = propertyAnimator
propertyAnimator.startAnimation()
}

func interruptibleAnimator(using transitionContext: UIViewControllerContextTransitioning) -> UIViewImplicitlyAnimating {
return createPropertyAnimator(using: transitionContext)
// According to Apple's document:
// "You must return the same animator object for the duration of the transition."
// https://developer.apple.com/documentation/uikit/uiviewcontrolleranimatedtransitioning/1829434-interruptibleanimator
return currentPropertyAnimator ?? createPropertyAnimator(using: transitionContext)
}

func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Foundation
final class FadeAnimator: NSObject {
private let presentationType : PresentationType
private let presentation : FadePresentation
private var currentPropertyAnimator: UIViewPropertyAnimator?

init(presentationType: PresentationType, presentation: FadePresentation) {
self.presentationType = presentationType
Expand All @@ -13,7 +14,7 @@ final class FadeAnimator: NSObject {

extension FadeAnimator : UIViewControllerAnimatedTransitioning {
func interruptibleAnimator(using transitionContext: UIViewControllerContextTransitioning) -> UIViewImplicitlyAnimating {
return createPropertyAnimator(using: transitionContext)
return currentPropertyAnimator ?? createPropertyAnimator(using: transitionContext)
}

func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
Expand All @@ -22,6 +23,7 @@ extension FadeAnimator : UIViewControllerAnimatedTransitioning {

func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let propertyAnimator = createPropertyAnimator(using: transitionContext)
currentPropertyAnimator = propertyAnimator
propertyAnimator.startAnimation()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Foundation
final class SlideAnimator: NSObject {
private let presentationType : PresentationType
private let presentation : SlidePresentation
private var currentPropertyAnimator: UIViewPropertyAnimator?

init(presentationType: PresentationType, presentation: SlidePresentation) {
self.presentationType = presentationType
Expand All @@ -18,11 +19,12 @@ extension SlideAnimator : UIViewControllerAnimatedTransitioning {

func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let propertyAnimator = createPropertyAnimator(using: transitionContext)
currentPropertyAnimator = propertyAnimator
propertyAnimator.startAnimation()
}

func interruptibleAnimator(using transitionContext: UIViewControllerContextTransitioning) -> UIViewImplicitlyAnimating {
return createPropertyAnimator(using: transitionContext)
return currentPropertyAnimator ?? createPropertyAnimator(using: transitionContext)
}

func createPropertyAnimator(using transitionContext: UIViewControllerContextTransitioning) -> UIViewPropertyAnimator{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Jelly-Animators: Elegant Viewcontroller Animations in Swift](https://github.com/SebastianBoldt/Jelly/blob/master/Github/Jellyfish.png?raw=true)

<a href="https://paypal.me/boldtsebastian"><img src="https://img.shields.io/badge/paypal-donate-blue.svg?longCache=true&style=flat-square" alt="current version" /></a>
<a href="https://cocoapods.org/pods/Jelly"><img src="https://img.shields.io/badge/version-2.2.1-green.svg?longCache=true&style=flat-square" alt="current version" /></a>
<a href="https://cocoapods.org/pods/Jelly"><img src="https://img.shields.io/badge/version-2.2.2-green.svg?longCache=true&style=flat-square" alt="current version" /></a>
<a href="http://twitter.com/sebastianboldt"><img src="https://img.shields.io/badge/[email protected]?longCache=true&style=flat-square" alt="twitter handle" /></a>
<a href="https://developer.apple.com/swift"><img src="https://img.shields.io/badge/swift5.0-compatible-orange.svg?longCache=true&style=flat-square" alt="Swift 4.2 compatible" /></a>
<a href="https://www.apple.com/de/ios/ios-12/"><img src="https://img.shields.io/badge/platform-iOS-lightgray.svg?longCache=true&style=flat-square" alt="platform" /></a>
Expand Down

0 comments on commit 39bc6a3

Please sign in to comment.