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

Commit 92ab4a0

Browse files
author
Jeff Verkoeyen
committed
Merge branch 'release-candidate' into stable
2 parents 7860a9b + 1c731c2 commit 92ab4a0

File tree

5 files changed

+51
-4
lines changed

5 files changed

+51
-4
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# 3.3.0
2+
3+
This minor release deprecates some behavior and replaces it with a new API.
4+
5+
## New deprecations
6+
7+
- `MDMTransitionWithFallback` nil behavior is now deprecated. In order to fall back to system
8+
transitions you must now conform to `MDMTransitionWithFeasibility` and return NO.
9+
10+
## Source changes
11+
12+
* [Backport MDMTransitionWithFeasibility from the v4.0.0 release for v3.1 clients.](https://github.com/material-motion/transitioning-objc/commit/1f994d03c7971001cc8faafe61b3ed2f55bca118) (Jeff Verkoeyen)
13+
14+
## API changes
15+
16+
### MDMTransitionWithFeasibility
17+
18+
*new* protocol `MDMTransitionWithFeasibility`.
19+
120
# 3.2.1
221

322
This patch release resolves Xcode 9 compiler warnings.

MotionTransitioning.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "MotionTransitioning"
33
s.summary = "Light-weight API for building UIViewController transitions."
4-
s.version = "3.2.1"
4+
s.version = "3.3.0"
55
s.authors = "The Material Motion Authors"
66
s.license = "Apache 2.0"
77
s.homepage = "https://github.com/material-motion/transitioning-objc"

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- CatalogByConvention (2.1.1)
3-
- MotionTransitioning (3.2.1)
3+
- MotionTransitioning (3.3.0)
44

55
DEPENDENCIES:
66
- CatalogByConvention
@@ -12,7 +12,7 @@ EXTERNAL SOURCES:
1212

1313
SPEC CHECKSUMS:
1414
CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43
15-
MotionTransitioning: 01e7fcd6e2974985057109e0a4c98ea546cd5947
15+
MotionTransitioning: caaa488e0469d93f004793b96a2ed04447af808d
1616

1717
PODFILE CHECKSUM: db2e7ac8d9d65704a2cbffa0b77e39a574cb7248
1818

src/MDMTransition.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,26 @@ NS_SWIFT_NAME(TransitionWithFallback)
7272

7373
@end
7474

75+
/**
76+
A transition with feasibility can indicate whether it's capable of handling a given context.
77+
*/
78+
NS_SWIFT_NAME(TransitionWithFeasibility)
79+
@protocol MDMTransitionWithFeasibility <MDMTransition>
80+
81+
/**
82+
Asks the receiver whether it's capable of performing the transition with the given context.
83+
84+
If NO is returned, the receiver's startWithContext: will not be invoked.
85+
If the transition is infeasible, then a default UIKit transition will be performed instead.
86+
87+
If YES is returned, the receiver's startWithContext: will be invoked.
88+
89+
The context's containerView will be nil during this call.
90+
*/
91+
- (BOOL)canPerformTransitionWithContext:(nonnull id<MDMTransitionContext>)context;
92+
93+
@end
94+
7595
/**
7696
A transition with presentation is able to customize the overall presentation of the transition,
7797
including adding temporary views and changing the destination frame of the presented view

src/private/MDMViewControllerTransitionContext.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@ - (nonnull instancetype)initWithTransition:(nonnull id<MDMTransition>)transition
4646

4747
_completionBlocks = [NSMutableArray array];
4848

49-
_transition = [self fallbackForTransition:_transition];
49+
if ([_transition respondsToSelector:@selector(canPerformTransitionWithContext:)]) {
50+
id<MDMTransitionWithFeasibility> withFeasibility = (id<MDMTransitionWithFeasibility>)_transition;
51+
if (![withFeasibility canPerformTransitionWithContext:self]) {
52+
_transition = nil;
53+
}
54+
} else {
55+
_transition = [self fallbackForTransition:_transition];
56+
}
57+
5058
if (!_transition) {
5159
return nil;
5260
}

0 commit comments

Comments
 (0)