From 2b8e28735e490a866e0b0f94b16d81148c5cd0fd Mon Sep 17 00:00:00 2001 From: featherless Date: Wed, 26 Jun 2019 07:34:49 -0400 Subject: [PATCH 1/5] Bump the Swift version to 4.0. (#67) This will allow the project to build on Xcode 11. --- Podfile | 2 +- Podfile.lock | 2 +- examples/ContextualExample.swift | 4 ++-- examples/FadeExample.m | 2 +- examples/FadeExample.swift | 2 +- examples/MenuExample.swift | 2 +- examples/NavControllerFadeExample.swift | 2 +- examples/apps/Catalog/TableOfContents.swift | 14 ++++++++------ .../TransitionsCatalog.xcodeproj/project.pbxproj | 9 +++------ examples/supplemental/ModalViewController.swift | 2 +- 10 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Podfile b/Podfile index 735e230..71bf2ff 100644 --- a/Podfile +++ b/Podfile @@ -1,6 +1,6 @@ workspace 'MotionTransitioning.xcworkspace' use_frameworks! -platform :ios, '8.0' +platform :ios, '9.0' target "TransitionsCatalog" do pod 'CatalogByConvention' diff --git a/Podfile.lock b/Podfile.lock index ee1eccd..98141be 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -18,6 +18,6 @@ SPEC CHECKSUMS: CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43 MotionTransitioning: afdc2fb08fc6e8744dab4f160b3764c9bde59338 -PODFILE CHECKSUM: 25d5942fb7698339a03667bb46c3fbb77529b92d +PODFILE CHECKSUM: c1fb58e87919bf8979e1ee2b4db99797e975d789 COCOAPODS: 1.6.0 diff --git a/examples/ContextualExample.swift b/examples/ContextualExample.swift index 7000b87..6f78520 100644 --- a/examples/ContextualExample.swift +++ b/examples/ContextualExample.swift @@ -21,7 +21,7 @@ import MotionTransitioning class ContextualExampleViewController: ExampleViewController { - func didTap(_ tapGesture: UITapGestureRecognizer) { + @objc func didTap(_ tapGesture: UITapGestureRecognizer) { let controller = DestinationViewController() // A contextual transition is provided with information relevant to the transition, such as the @@ -142,7 +142,7 @@ private class DestinationViewController: ExampleViewController { view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTap))) } - func didTap() { + @objc func didTap() { dismiss(animated: true) } } diff --git a/examples/FadeExample.m b/examples/FadeExample.m index 1631a2c..bae1437 100644 --- a/examples/FadeExample.m +++ b/examples/FadeExample.m @@ -43,7 +43,7 @@ - (void)didTap { - (void)viewDidLoad { [super viewDidLoad]; - self.view.backgroundColor = [UIColor backgroundColor]; + self.view.backgroundColor = [UIColor whiteColor]; UILabel *label = [[UILabel alloc] initWithFrame:self.view.bounds]; label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; diff --git a/examples/FadeExample.swift b/examples/FadeExample.swift index 552659b..81e61c3 100644 --- a/examples/FadeExample.swift +++ b/examples/FadeExample.swift @@ -22,7 +22,7 @@ import MotionTransitioning class FadeExampleViewController: ExampleViewController { - func didTap() { + @objc func didTap() { let modalViewController = ModalViewController() // The transition controller is an associated object on all UIViewController instances that diff --git a/examples/MenuExample.swift b/examples/MenuExample.swift index f72fe30..6bf2b72 100644 --- a/examples/MenuExample.swift +++ b/examples/MenuExample.swift @@ -19,7 +19,7 @@ import MotionTransitioning class MenuExampleViewController: ExampleViewController { - func didTap() { + @objc func didTap() { let modalViewController = ModalViewController() modalViewController.mdm_transitionController.transition = MenuTransition() present(modalViewController, animated: true) diff --git a/examples/NavControllerFadeExample.swift b/examples/NavControllerFadeExample.swift index fdf5b73..d57cf41 100644 --- a/examples/NavControllerFadeExample.swift +++ b/examples/NavControllerFadeExample.swift @@ -22,7 +22,7 @@ import MotionTransitioning class NavControllerFadeExampleViewController: ExampleViewController { - func didTap() { + @objc func didTap() { let modalViewController = ModalViewController() modalViewController.title = "Example view controller" diff --git a/examples/apps/Catalog/TableOfContents.swift b/examples/apps/Catalog/TableOfContents.swift index e805ded..0b17656 100644 --- a/examples/apps/Catalog/TableOfContents.swift +++ b/examples/apps/Catalog/TableOfContents.swift @@ -14,28 +14,30 @@ limitations under the License. */ +import Foundation + // MARK: Catalog by convention extension ContextualExampleViewController { - class func catalogBreadcrumbs() -> [String] { return ["Contextual transition"] } + @objc class func catalogBreadcrumbs() -> [String] { return ["Contextual transition"] } } extension FadeExampleViewController { - class func catalogBreadcrumbs() -> [String] { return ["Fade transition"] } + @objc class func catalogBreadcrumbs() -> [String] { return ["Fade transition"] } } extension NavControllerFadeExampleViewController { - class func catalogBreadcrumbs() -> [String] { return ["Fade transition (nav controller)"] } + @objc class func catalogBreadcrumbs() -> [String] { return ["Fade transition (nav controller)"] } } extension MenuExampleViewController { - class func catalogBreadcrumbs() -> [String] { return ["Menu transition"] } + @objc class func catalogBreadcrumbs() -> [String] { return ["Menu transition"] } } extension PhotoAlbumExampleViewController { - class func catalogBreadcrumbs() -> [String] { return ["Photo album transition"] } + @objc class func catalogBreadcrumbs() -> [String] { return ["Photo album transition"] } } extension CustomPresentationExampleViewController { - class func catalogBreadcrumbs() -> [String] { return ["Custom presentation transitions"] } + @objc class func catalogBreadcrumbs() -> [String] { return ["Custom presentation transitions"] } } diff --git a/examples/apps/Catalog/TransitionsCatalog.xcodeproj/project.pbxproj b/examples/apps/Catalog/TransitionsCatalog.xcodeproj/project.pbxproj index 9bd3406..1fa1ff4 100644 --- a/examples/apps/Catalog/TransitionsCatalog.xcodeproj/project.pbxproj +++ b/examples/apps/Catalog/TransitionsCatalog.xcodeproj/project.pbxproj @@ -447,6 +447,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -709,6 +710,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -755,6 +757,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -771,7 +774,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.Catalog; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -786,7 +788,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.Catalog; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; }; name = Release; }; @@ -802,7 +803,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.CatalogTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestHarness.app/TestHarness"; }; name = Debug; @@ -819,7 +819,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.CatalogTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestHarness.app/TestHarness"; }; name = Release; @@ -836,7 +835,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.TestHarness; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -852,7 +850,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.TestHarness; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/examples/supplemental/ModalViewController.swift b/examples/supplemental/ModalViewController.swift index 8fb078a..e1d62b1 100644 --- a/examples/supplemental/ModalViewController.swift +++ b/examples/supplemental/ModalViewController.swift @@ -38,7 +38,7 @@ class ModalViewController: ExampleViewController { return .lightContent } - func didTap() { + @objc func didTap() { dismiss(animated: true) } } From 0a9568b21375bb5e04e5cf10123eaa06b63f80bd Mon Sep 17 00:00:00 2001 From: featherless Date: Wed, 26 Jun 2019 08:04:29 -0400 Subject: [PATCH 2/5] Always add the toView to the container. (#68) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On iOS 13, the to view for default transitions has changed from the view controller to a container view. Prior to this change, this meant that our transitions would not add the "to" view to the view hierarchy, resulting in the transition getting in to a confusing visual state. After this change, we always add the "to" view to the view hierarchy if it does not already have a parent. Repro steps: 1. Open the catalog on an iOS 13 simulator/device. 2. Open the contextual transition example. 3. Tap the blue square. Expected behavior: the transition completes, showing a pink view controller. Actual behavior: the transition never appears to complete, and no pink view controller is shown. | Before | After | |:----|:----| | ![Simulator Screen Shot - iPhone Xʀ - 2019-06-26 at 07 54 02](https://user-images.githubusercontent.com/45670/60177728-a439c600-97e7-11e9-8dea-39aecfd25ffe.png) | ![Simulator Screen Shot - iPhone Xʀ - 2019-06-26 at 07 53 21](https://user-images.githubusercontent.com/45670/60177723-9edc7b80-97e7-11e9-8c9f-08bf6f33dc3c.png) | --- .../MDMViewControllerTransitionCoordinator.m | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/private/MDMViewControllerTransitionCoordinator.m b/src/private/MDMViewControllerTransitionCoordinator.m index d6e1d06..ed77563 100644 --- a/src/private/MDMViewControllerTransitionCoordinator.m +++ b/src/private/MDMViewControllerTransitionCoordinator.m @@ -336,17 +336,17 @@ - (void)initiateTransition { if (!CGRectIsEmpty(finalFrame)) { toView.frame = finalFrame; } + } - if (toView.superview == nil) { - switch (_direction) { - case MDMTransitionDirectionForward: - [_transitionContext.containerView addSubview:toView]; - break; + if (toView.superview == nil) { + switch (_direction) { + case MDMTransitionDirectionForward: + [_transitionContext.containerView addSubview:toView]; + break; - case MDMTransitionDirectionBackward: - [_transitionContext.containerView insertSubview:toView atIndex:0]; - break; - } + case MDMTransitionDirectionBackward: + [_transitionContext.containerView insertSubview:toView atIndex:0]; + break; } } From ec158b88bffcc7f09330de869640ff067c3c57cb Mon Sep 17 00:00:00 2001 From: featherless Date: Wed, 26 Jun 2019 08:04:50 -0400 Subject: [PATCH 3/5] Automatic changelog preparation for release. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e8877d..49a0eaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# #develop# + + TODO: Enumerate changes. + + # 7.0.0 This major release drops official support for iOS 8. From fd07baa45d15b28f920f00a46929c71969070882 Mon Sep 17 00:00:00 2001 From: featherless Date: Wed, 26 Jun 2019 08:06:01 -0400 Subject: [PATCH 4/5] Update the changelog. --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49a0eaf..48e5995 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ -# #develop# +# 7.0.1 - TODO: Enumerate changes. +This patch release fixes a bug on iOS 13 where the presented view controller would not be added to +the view hierarchy. + +## Source changes + +* [Always add the toView to the container. (#68)](https://github.com/material-motion/motion-transitioning-objc/commit/0a9568b21375bb5e04e5cf10123eaa06b63f80bd) (featherless) # 7.0.0 From fbe5b9a732f8512e7ad03a6810e3d5f22dcabd3c Mon Sep 17 00:00:00 2001 From: featherless Date: Wed, 26 Jun 2019 08:06:10 -0400 Subject: [PATCH 5/5] Bump the release. --- MotionTransitioning.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MotionTransitioning.podspec b/MotionTransitioning.podspec index 1cf4e56..50e0db5 100644 --- a/MotionTransitioning.podspec +++ b/MotionTransitioning.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "MotionTransitioning" s.summary = "Light-weight API for building UIViewController transitions." - s.version = "7.0.0" + s.version = "7.0.1" s.authors = "The Material Motion Authors" s.license = "Apache 2.0" s.homepage = "https://github.com/material-motion/transitioning-objc"