diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b9710..4422048 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +# 1.1.1 + +This is a patch fix release to address build issues within Google's build environment. + +## Source changes + +* [Add missing UIKit.h header imports.](https://github.com/material-motion/transitioning-objc/commit/3b653bdd1758a5c47d277af36369e977b3774095) (Jeff Verkoeyen) + +## Non-source changes + +* [Update Podfile.lock.](https://github.com/material-motion/transitioning-objc/commit/8185ae402e6952e2727af8b7ff0cb4c712d05623) (Jeff Verkoeyen) +* [Add sliding menu as an example (#21)](https://github.com/material-motion/transitioning-objc/commit/4654e4c9c4c4ff49ac007f4b16eaa2458d86f98c) (Eric Tang) + # 1.1.0 This minor release introduces two new features to the Transition protocol family. diff --git a/Podfile.lock b/Podfile.lock index 8a3cc06..72dd94b 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,6 +1,6 @@ PODS: - CatalogByConvention (2.1.1) - - Transitioning (1.0.0) + - Transitioning (1.1.1) DEPENDENCIES: - CatalogByConvention @@ -12,7 +12,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43 - Transitioning: d2d2d0609e0acf133f7049ff5ddbe7ca16973f07 + Transitioning: ea1a8225812799c7ff07630af17008ab5e306bf3 PODFILE CHECKSUM: 1949e62e9d70d554783c0bb931d6b52780775cfb diff --git a/Transitioning.podspec b/Transitioning.podspec index 3c65497..55c9d44 100644 --- a/Transitioning.podspec +++ b/Transitioning.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Transitioning" s.summary = "Light-weight API for building UIViewController transitions." - s.version = "1.1.0" + s.version = "1.1.1" s.authors = "The Material Motion Authors" s.license = "Apache 2.0" s.homepage = "https://github.com/material-motion/transitioning-objc" diff --git a/examples/MenuExample.swift b/examples/MenuExample.swift new file mode 100644 index 0000000..b200a22 --- /dev/null +++ b/examples/MenuExample.swift @@ -0,0 +1,82 @@ +/* + Copyright 2017-present The Material Motion Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import UIKit +import Transitioning + +class MenuExampleViewController: ExampleViewController { + + func didTap() { + let modalViewController = ModalViewController() + modalViewController.transitionController.transition = MenuTransition() + present(modalViewController, animated: true) + } + + override func viewDidLoad() { + super.viewDidLoad() + + let label = UILabel(frame: view.bounds) + label.autoresizingMask = [.flexibleWidth, .flexibleHeight] + label.textColor = .white + label.textAlignment = .center + label.text = "Tap to start the transition" + view.addSubview(label) + + let tap = UITapGestureRecognizer(target: self, action: #selector(didTap)) + view.addGestureRecognizer(tap) + } + + override func exampleInformation() -> ExampleInfo { + return .init(title: type(of: self).catalogBreadcrumbs().last!, + instructions: "Tap to present a modal transition.") + } +} + +private final class MenuTransition: NSObject, TransitionWithPresentation { + func presentationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController?) -> UIPresentationController? { + return nil + } + + func defaultModalPresentationStyle() -> UIModalPresentationStyle { + return .overCurrentContext + } + + func start(with context: TransitionContext) { + let foreView = context.foreViewController.view! + if(context.direction == .forward) { + foreView.frame.origin.x = -1 * foreView.frame.width + UIView.animate( + withDuration: context.duration, + animations: { + foreView.frame.origin.x = -1 * (foreView.frame.width / 2) + }, + completion: { _ in + context.transitionDidEnd() + } + ) + } else { + UIView.animate( + withDuration: context.duration, + animations: { + foreView.frame.origin.x = -1 * foreView.frame.width + }, + completion: { _ in + context.transitionDidEnd() + } + ) + } + } +} diff --git a/examples/apps/Catalog/TableOfContents.swift b/examples/apps/Catalog/TableOfContents.swift index f7903ad..f3933c9 100644 --- a/examples/apps/Catalog/TableOfContents.swift +++ b/examples/apps/Catalog/TableOfContents.swift @@ -20,6 +20,10 @@ extension FadeExampleViewController { class func catalogBreadcrumbs() -> [String] { return ["1. Fade transition"] } } +extension MenuExampleViewController { + class func catalogBreadcrumbs() -> [String] { return ["2. Menu transition"] } +} + extension CustomPresentationExampleViewController { - class func catalogBreadcrumbs() -> [String] { return ["2. Custom presentation transitions"] } + class func catalogBreadcrumbs() -> [String] { return ["3. Custom presentation transitions"] } } diff --git a/examples/apps/Catalog/TransitionsCatalog.xcodeproj/project.pbxproj b/examples/apps/Catalog/TransitionsCatalog.xcodeproj/project.pbxproj index a7d9fd6..482a5ed 100644 --- a/examples/apps/Catalog/TransitionsCatalog.xcodeproj/project.pbxproj +++ b/examples/apps/Catalog/TransitionsCatalog.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 072A063B1EEE26A900B9B5FC /* MenuExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 072A063A1EEE26A900B9B5FC /* MenuExample.swift */; }; 6629151E1ED5E0E0002B9A5D /* CustomPresentationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6629151D1ED5E0E0002B9A5D /* CustomPresentationExample.swift */; }; 662915201ED5E137002B9A5D /* ModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6629151F1ED5E137002B9A5D /* ModalViewController.swift */; }; 662915231ED64A10002B9A5D /* TransitionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 662915221ED64A10002B9A5D /* TransitionTests.swift */; }; @@ -46,6 +47,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 072A063A1EEE26A900B9B5FC /* MenuExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuExample.swift; sourceTree = ""; }; 0C2327F961D4F16DEBF0EEB8 /* Pods-UnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UnitTests.debug.xcconfig"; path = "../../../Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests.debug.xcconfig"; sourceTree = ""; }; 2408A4B72C0BA93CC963452F /* Pods_UnitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_UnitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3734DFFD1C84494E48784617 /* Pods-TransitionsCatalog.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TransitionsCatalog.release.xcconfig"; path = "../../../Pods/Target Support Files/Pods-TransitionsCatalog/Pods-TransitionsCatalog.release.xcconfig"; sourceTree = ""; }; @@ -169,6 +171,7 @@ 6629151D1ED5E0E0002B9A5D /* CustomPresentationExample.swift */, 66BBC7731ED729A70015CB9B /* FadeExample.h */, 66BBC7741ED729A70015CB9B /* FadeExample.m */, + 072A063A1EEE26A900B9B5FC /* MenuExample.swift */, ); name = examples; path = ../..; @@ -472,6 +475,7 @@ 666FAA841D384A6B000363DA /* AppDelegate.swift in Sources */, 66BBC76F1ED4C8790015CB9B /* HexColor.swift in Sources */, 66BBC7751ED729A80015CB9B /* FadeExample.m in Sources */, + 072A063B1EEE26A900B9B5FC /* MenuExample.swift in Sources */, 66BBC76D1ED4C8790015CB9B /* ExampleViewController.swift in Sources */, 667A3F541DEE273000CB3A99 /* TableOfContents.swift in Sources */, 66BBC7701ED4C8790015CB9B /* Layout.swift in Sources */, diff --git a/src/UIViewController+TransitionController.h b/src/UIViewController+TransitionController.h index 1feaf84..b1f5279 100644 --- a/src/UIViewController+TransitionController.h +++ b/src/UIViewController+TransitionController.h @@ -15,6 +15,7 @@ */ #import +#import @protocol MDMTransitionController; diff --git a/src/private/MDMPresentationTransitionController.h b/src/private/MDMPresentationTransitionController.h index b620bba..22fe219 100644 --- a/src/private/MDMPresentationTransitionController.h +++ b/src/private/MDMPresentationTransitionController.h @@ -15,6 +15,7 @@ */ #import +#import #import "MDMTransitionController.h"