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

Commit 1991d50

Browse files
author
Jeff Verkoeyen
committed
Merge branch 'release-candidate' into stable
2 parents 003ec84 + 1fffbae commit 1991d50

File tree

7 files changed

+104
-35
lines changed

7 files changed

+104
-35
lines changed

.kokoro

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,55 @@
11
#!/bin/bash
2+
#
3+
# Copyright 2017-present The Material Motion Authors. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
216

317
# Fail on any error.
418
set -e
519

620
# Display commands to stderr.
721
set -x
822

23+
KOKORO_RUNNER_VERSION="v3.*"
24+
25+
fix_bazel_imports() {
26+
if [ -z "$KOKORO_BUILD_NUMBER" ]; then
27+
repo_prefix=""
28+
else
29+
repo_prefix="github/repo/"
30+
fi
31+
32+
# Fixes a bug in bazel where objc_library targets have a _ prefix.
33+
find "${repo_prefix}tests/unit" -type f -name '*.swift' -exec sed -i '' -E "s/import Motion(.+)/import _Motion\1/" {} + || true
34+
stashed_dir=$(pwd)
35+
reset_imports() {
36+
# Undoes our source changes from above.
37+
find "${stashed_dir}/${tests_dir_prefix}tests/unit" -type f -name '*.swift' -exec sed -i '' -E "s/import _Motion(.+)/import Motion\1/" {} + || true
38+
}
39+
trap reset_imports EXIT
40+
}
41+
942
if [ ! -d .kokoro-ios-runner ]; then
1043
git clone https://github.com/material-foundation/kokoro-ios-runner.git .kokoro-ios-runner
1144
fi
1245

1346
pushd .kokoro-ios-runner
1447
git fetch > /dev/null
15-
TAG=$(git tag -l "v3*" | sort | tail -n1)
16-
git checkout $TAG > /dev/null
48+
TAG=$(git tag --sort=v:refname -l "$KOKORO_RUNNER_VERSION" | tail -n1)
49+
git checkout "$TAG" > /dev/null
1750
popd
1851

19-
if [ -z "$KOKORO_BUILD_NUMBER" ]; then
20-
tests_dir_prefix=""
21-
else
22-
tests_dir_prefix="github/repo/"
23-
fi
24-
25-
# Fixes a bug in bazel where objc_library targets have a _ prefix.
26-
find ${tests_dir_prefix}tests/unit -type f -name '*.swift' -exec sed -i '' -E "s/import Motion(.+)/import _Motion\1/" {} + || true
27-
stashed_dir=$(pwd)
28-
reset_imports() {
29-
# Undoes our source changes from above.
30-
find ${stashed_dir}/${tests_dir_prefix}tests/unit -type f -name '*.swift' -exec sed -i '' -E "s/import _Motion(.+)/import Motion\1/" {} + || true
31-
}
32-
trap reset_imports EXIT
52+
fix_bazel_imports
3353

3454
./.kokoro-ios-runner/bazel.sh test //:UnitTests 8.1.0
3555

BUILD

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2017-present The Material Motion Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
115
# Description:
216
# Light-weight API for building UIViewController transitions.
317

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 4.0.2
2+
3+
This patch release fixes a bug where the frames of custom presented views would be incorrectly set
4+
to the view controller's frame.
5+
6+
## Source changes
7+
8+
* [Add support for transitions with custom presented views. (#55)](https://github.com/material-motion/motion-transitioning-objc/commit/2564bfdf42a2ba7c550656b95bc7dc98019468bb) (featherless)
9+
10+
## Non-source changes
11+
12+
* [Standardize the kokoro and bazel files. (#51)](https://github.com/material-motion/motion-transitioning-objc/commit/588b63dfae7471f3377041caa08496ef1fa74ced) (featherless)
13+
114
# 4.0.1
215

316
This patch release resolves a build warning and migrates the project's continuous integration to

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 = "4.0.1"
4+
s.version = "4.0.2"
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 (4.0.1)
3+
- MotionTransitioning (4.0.2)
44

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

1313
SPEC CHECKSUMS:
1414
CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43
15-
MotionTransitioning: 277501a1a1e6121c0ab523e6a3e00d64659c3367
15+
MotionTransitioning: 9885e68bd1501f1f8244b2e40081acd8cf3ac461
1616

1717
PODFILE CHECKSUM: 25d5942fb7698339a03667bb46c3fbb77529b92d
1818

WORKSPACE

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2017-present The Material Motion Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
git_repository(
216
name = "build_bazel_rules_apple",
317
remote = "https://github.com/bazelbuild/rules_apple.git",
@@ -7,5 +21,5 @@ git_repository(
721
git_repository(
822
name = "bazel_ios_warnings",
923
remote = "https://github.com/material-foundation/bazel_ios_warnings.git",
10-
commit = "3e61cb5b60f52c8b9c77b5d62364d8b4d25e528f",
24+
tag = "v1.0.1",
1125
)

src/private/MDMViewControllerTransitionCoordinator.m

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -313,35 +313,43 @@ - (void)initiateTransition {
313313
_root.transitionContext = _transitionContext;
314314

315315
UIViewController *from = [_transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
316-
if (from) {
316+
UIView *fromView = [_transitionContext viewForKey:UITransitionContextFromViewKey];
317+
if (fromView == nil) {
318+
fromView = from.view;
319+
}
320+
if (fromView != nil && fromView == from.view) {
317321
CGRect finalFrame = [_transitionContext finalFrameForViewController:from];
318322
if (!CGRectIsEmpty(finalFrame)) {
319-
from.view.frame = finalFrame;
323+
fromView.frame = finalFrame;
320324
}
321325
}
322326

323327
UIViewController *to = [_transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
324-
if (to) {
328+
UIView *toView = [_transitionContext viewForKey:UITransitionContextToViewKey];
329+
if (toView == nil) {
330+
toView = to.view;
331+
}
332+
if (toView != nil && toView == to.view) {
325333
CGRect finalFrame = [_transitionContext finalFrameForViewController:to];
326334
if (!CGRectIsEmpty(finalFrame)) {
327-
to.view.frame = finalFrame;
335+
toView.frame = finalFrame;
328336
}
329337

330-
switch (_direction) {
331-
case MDMTransitionDirectionForward:
332-
[_transitionContext.containerView addSubview:to.view];
333-
break;
338+
if (toView.superview == nil) {
339+
switch (_direction) {
340+
case MDMTransitionDirectionForward:
341+
[_transitionContext.containerView addSubview:toView];
342+
break;
334343

335-
case MDMTransitionDirectionBackward:
336-
if (!to.view.superview) {
337-
[_transitionContext.containerView insertSubview:to.view atIndex:0];
338-
}
339-
break;
344+
case MDMTransitionDirectionBackward:
345+
[_transitionContext.containerView insertSubview:toView atIndex:0];
346+
break;
347+
}
340348
}
341-
342-
[to.view layoutIfNeeded];
343349
}
344350

351+
[toView layoutIfNeeded];
352+
345353
[_root attemptFallback];
346354
[self anticipateOnlyExplicitAnimations];
347355

0 commit comments

Comments
 (0)