Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release-candidate' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Verkoeyen committed Oct 2, 2017
2 parents 7860a9b + 1c731c2 commit 92ab4a0
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 4 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 3.3.0

This minor release deprecates some behavior and replaces it with a new API.

## New deprecations

- `MDMTransitionWithFallback` nil behavior is now deprecated. In order to fall back to system
transitions you must now conform to `MDMTransitionWithFeasibility` and return NO.

## Source changes

* [Backport MDMTransitionWithFeasibility from the v4.0.0 release for v3.1 clients.](https://github.com/material-motion/transitioning-objc/commit/1f994d03c7971001cc8faafe61b3ed2f55bca118) (Jeff Verkoeyen)

## API changes

### MDMTransitionWithFeasibility

*new* protocol `MDMTransitionWithFeasibility`.

# 3.2.1

This patch release resolves Xcode 9 compiler warnings.
Expand Down
2 changes: 1 addition & 1 deletion MotionTransitioning.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "MotionTransitioning"
s.summary = "Light-weight API for building UIViewController transitions."
s.version = "3.2.1"
s.version = "3.3.0"
s.authors = "The Material Motion Authors"
s.license = "Apache 2.0"
s.homepage = "https://github.com/material-motion/transitioning-objc"
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- CatalogByConvention (2.1.1)
- MotionTransitioning (3.2.1)
- MotionTransitioning (3.3.0)

DEPENDENCIES:
- CatalogByConvention
Expand All @@ -12,7 +12,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43
MotionTransitioning: 01e7fcd6e2974985057109e0a4c98ea546cd5947
MotionTransitioning: caaa488e0469d93f004793b96a2ed04447af808d

PODFILE CHECKSUM: db2e7ac8d9d65704a2cbffa0b77e39a574cb7248

Expand Down
20 changes: 20 additions & 0 deletions src/MDMTransition.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,26 @@ NS_SWIFT_NAME(TransitionWithFallback)

@end

/**
A transition with feasibility can indicate whether it's capable of handling a given context.
*/
NS_SWIFT_NAME(TransitionWithFeasibility)
@protocol MDMTransitionWithFeasibility <MDMTransition>

/**
Asks the receiver whether it's capable of performing the transition with the given context.
If NO is returned, the receiver's startWithContext: will not be invoked.
If the transition is infeasible, then a default UIKit transition will be performed instead.
If YES is returned, the receiver's startWithContext: will be invoked.
The context's containerView will be nil during this call.
*/
- (BOOL)canPerformTransitionWithContext:(nonnull id<MDMTransitionContext>)context;

@end

/**
A transition with presentation is able to customize the overall presentation of the transition,
including adding temporary views and changing the destination frame of the presented view
Expand Down
10 changes: 9 additions & 1 deletion src/private/MDMViewControllerTransitionContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ - (nonnull instancetype)initWithTransition:(nonnull id<MDMTransition>)transition

_completionBlocks = [NSMutableArray array];

_transition = [self fallbackForTransition:_transition];
if ([_transition respondsToSelector:@selector(canPerformTransitionWithContext:)]) {
id<MDMTransitionWithFeasibility> withFeasibility = (id<MDMTransitionWithFeasibility>)_transition;
if (![withFeasibility canPerformTransitionWithContext:self]) {
_transition = nil;
}
} else {
_transition = [self fallbackForTransition:_transition];
}

if (!_transition) {
return nil;
}
Expand Down

0 comments on commit 92ab4a0

Please sign in to comment.