Skip to content
This repository has been archived by the owner on Nov 21, 2017. 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 Nov 18, 2016
2 parents 3f6f73c + 5ddd13e commit c4df629
Show file tree
Hide file tree
Showing 19 changed files with 592 additions and 118 deletions.
4 changes: 2 additions & 2 deletions .arcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"arc.feature.start.default": "origin/develop",
"unit.xcode": {
"build": {
"workspace": "MaterialMotionCoreAnimationTransitionsPlugin.xcworkspace",
"workspace": "MaterialMotionCoreAnimationTransitions.xcworkspace",
"scheme": "UnitTests",
"configuration": "Debug",
"destination": "platform=iOS Simulator,name=iPhone 6s"
},
"coverage": {
"product": "MaterialMotionCoreAnimationTransitionsPlugin.framework/MaterialMotionCoreAnimationTransitionsPlugin"
"product": "MaterialMotionCoreAnimationTransitions.framework/MaterialMotionCoreAnimationTransitions"
},
"pre-build": "pod install"
}
Expand Down
10 changes: 5 additions & 5 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module: MaterialMotionCoreAnimationTransitionsPlugin
module: MaterialMotionCoreAnimationTransitions
module_version: 1.0.0
sdk: iphonesimulator
xcodebuild_arguments:
- -workspace
- MaterialMotionCoreAnimationTransitionsPlugin.xcworkspace
- MaterialMotionCoreAnimationTransitions.xcworkspace
- -scheme
- MaterialMotionCoreAnimationTransitionsPlugin
github_url: https://github.com/material-motion/coreanimation-transitions-plugin-swift
github_file_prefix: https://github.com/material-motion/coreanimation-transitions-plugin-swift/tree/v1.0.0
- MaterialMotionCoreAnimationTransitions
github_url: https://github.com/material-motion/coreanimation-transitions-swift
github_file_prefix: https://github.com/material-motion/coreanimation-transitions-swift/tree/v1.0.0
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
3.0
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ before_install:
script:
- set -o pipefail
- arcanist/bin/arc unit --everything --trace
- xcodebuild build -workspace MaterialMotionCoreAnimationTransitionsPlugin.xcworkspace -scheme Catalog -sdk "iphonesimulator10.0" -destination "name=iPhone 6s,OS=10.0" ONLY_ACTIVE_ARCH=YES | xcpretty -c;
- xcodebuild build -workspace MaterialMotionCoreAnimationTransitions.xcworkspace -scheme Catalog -sdk "iphonesimulator10.0" -destination "name=iPhone 6s,OS=10.0" ONLY_ACTIVE_ARCH=YES | xcpretty -c;
after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is the list of Core Animation Transitions Material Motion Plugin authors for copyright purposes.
# This is the list of Core Animation transitions for Material Motion (Swift) authors for copyright purposes.
#
# This does not necessarily list everyone who has contributed code, since in
# some cases, their employer may be the copyright holder. To see the full list
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 1.0.0

Initial release includes the TransitionTween plan.

## Source changes

* [Add unit tests for TransitionTween.](https://github.com/material-motion/coreanimation-transitions-swift/commit/85ef3ab4f3f52167322bce2503fdd8e0d87c3966) (Jeff Verkoeyen)
* [Add TransitionTween implementation.](https://github.com/material-motion/coreanimation-transitions-swift/commit/a9d44be9df7caef8449c17276226617606b381f9) (Jeff Verkoeyen)

## API changes

### TransitionTween

*new* class: `TransitionTween`

## Non-source changes

* [Automatic changelog preparation for release.](https://github.com/material-motion/coreanimation-transitions-swift/commit/ab937db0d83eaef10790d81ee2619845d9e8fb30) (Jeff Verkoeyen)
* [Rename example files.](https://github.com/material-motion/coreanimation-transitions-swift/commit/944deab908ece0f36c3af74a3ffd791370a639ad) (Jeff Verkoeyen)
* [Add features guide and how to.](https://github.com/material-motion/coreanimation-transitions-swift/commit/a5bf738c50df65c8d4760d007137f0a0bdd80bfb) (Jeff Verkoeyen)
* [Ran yo mm-github.](https://github.com/material-motion/coreanimation-transitions-swift/commit/62b7b6ca04839ba9b0d298ddde0becb7bf70a2fc) (Jeff Verkoeyen)
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
Pod::Spec.new do |s|
s.name = "MaterialMotionCoreAnimationTransitionsPlugin"
s.summary = "Core Animation Transitions Material Motion Plugin"
s.name = "MaterialMotionCoreAnimationTransitions"
s.summary = "Core Animation transitions for Material Motion (Swift)"
s.version = "1.0.0"
s.authors = "The Material Motion Authors"
s.license = "Apache 2.0"
s.homepage = "https://github.com/material-motion/coreanimation-transitions-plugin-swift"
s.source = { :git => "https://github.com/material-motion/coreanimation-transitions-plugin-swift.git", :tag => "v" + s.version.to_s }
s.homepage = "https://github.com/material-motion/coreanimation-transitions-swift"
s.source = { :git => "https://github.com/material-motion/coreanimation-transitions-swift.git", :tag => "v" + s.version.to_s }
s.platform = :ios, "8.0"
s.requires_arc = true

s.source_files = "src/*.{swift}", "src/private/*.{swift}"

s.dependency "MaterialMotionTransitions", "~> 1.0"
s.dependency "MaterialMotionCoreAnimation", "~> 2.0"
end
6 changes: 3 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
abstract_target 'MaterialMotionCoreAnimationTransitionsPlugin' do
abstract_target 'MaterialMotionCoreAnimationTransitions' do
pod 'CatalogByConvention'

pod 'MaterialMotionCoreAnimationTransitionsPlugin', :path => './'
pod 'MaterialMotionCoreAnimationTransitions', :path => './'

workspace 'MaterialMotionCoreAnimationTransitionsPlugin.xcworkspace'
workspace 'MaterialMotionCoreAnimationTransitions.xcworkspace'
use_frameworks!

target "Catalog" do
Expand Down
20 changes: 15 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
PODS:
- CatalogByConvention (2.0.0)
- MaterialMotionCoreAnimationTransitionsPlugin (1.0.0)
- MaterialMotionCoreAnimation (2.0.0):
- MaterialMotionRuntime (~> 6.0)
- MaterialMotionCoreAnimationTransitions (1.0.0):
- MaterialMotionCoreAnimation (~> 2.0)
- MaterialMotionTransitions (~> 1.0)
- MaterialMotionRuntime (6.0.0)
- MaterialMotionTransitions (1.1.0):
- MaterialMotionRuntime (~> 6.0)

DEPENDENCIES:
- CatalogByConvention
- MaterialMotionCoreAnimationTransitionsPlugin (from `./`)
- MaterialMotionCoreAnimationTransitions (from `./`)

EXTERNAL SOURCES:
MaterialMotionCoreAnimationTransitionsPlugin:
MaterialMotionCoreAnimationTransitions:
:path: "./"

SPEC CHECKSUMS:
CatalogByConvention: be55c2263132e4f9f59299ac8a528ee8715b3275
MaterialMotionCoreAnimationTransitionsPlugin: 91a861e84f5f548e95945b27706f83ffdfc61161
MaterialMotionCoreAnimation: fc8f32e641c242a7ff40e78248b238f3954c5e75
MaterialMotionCoreAnimationTransitions: 814ef80700d78a245f04ae8215b7227ff2cdb16d
MaterialMotionRuntime: 89cb395df1ce02134fc67a16b42dc4492b6c514c
MaterialMotionTransitions: b731df47f90a7c8ccc60de1f61446b9f31d08065

PODFILE CHECKSUM: 3551f8326c6828d18744f2ec867d3e470c192561
PODFILE CHECKSUM: dd154e5de50a8ad79a8d5f184a86c6dd98773a88

COCOAPODS: 1.1.1
89 changes: 72 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
# Core Animation Transitions Material Motion Plugin
# Core Animation transitions for Material Motion (Swift)

[![Build Status](https://travis-ci.org/material-motion/coreanimation-transitions-plugin-swift.svg?branch=develop)](https://travis-ci.org/material-motion/coreanimation-transitions-plugin-swift)
[![codecov](https://codecov.io/gh/material-motion/coreanimation-transitions-plugin-swift/branch/develop/graph/badge.svg)](https://codecov.io/gh/material-motion/coreanimation-transitions-plugin-swift)
[![Build Status](https://travis-ci.org/material-motion/coreanimation-transitions-swift.svg?branch=develop)](https://travis-ci.org/material-motion/coreanimation-transitions-swift)
[![codecov](https://codecov.io/gh/material-motion/coreanimation-transitions-swift/branch/develop/graph/badge.svg)](https://codecov.io/gh/material-motion/coreanimation-transitions-swift)

## Supported languages

- Swift 3
- Objective-C

## Features

`TransitionTween` allows you to express a bi-directional tween during a Material Motion transition.

Consider the following example of a simple "fade in" transition director:

```swift
class FadeInTransitionDirector: NSObject, TransitionDirector {
let transition: Transition
required init(transition: Transition) {
self.transition = transition
}

func setUp() {
let fadeIn = TransitionTween("opacity",
transition: transition,
segment: .init(position: 0, length: 1),
back: NSNumber(value: 0),
fore: NSNumber(value: 1))
fadeIn.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.runtime.addPlan(fadeIn, to: transition.foreViewController.view.layer)
}
}
```

In this director we've defined a single TransitionTween that handles both the forward and backward
transition. Going forward, an opacity Tween from 0 to 1 is emitted. Going backward, an opacity Tween
from 1 to 0 is emitted. In both directions the Tween occurs during the transition's entire window of
time.

## Installation

Expand All @@ -14,9 +49,9 @@
>
> gem install cocoapods
Add `MaterialMotionCoreAnimationTransitionsPlugin` to your `Podfile`:
Add `MaterialMotionCoreAnimationTransitions` to your `Podfile`:

pod 'MaterialMotionCoreAnimationTransitionsPlugin'
pod 'MaterialMotionCoreAnimationTransitions'

Then run the following command:

Expand All @@ -26,7 +61,7 @@ Then run the following command:

Import the framework:

@import MaterialMotionCoreAnimationTransitionsPlugin;
@import MaterialMotionCoreAnimationTransitions;

You will now have access to all of the APIs.

Expand All @@ -35,29 +70,49 @@ You will now have access to all of the APIs.
Check out a local copy of the repo to access the Catalog application by running the following
commands:

git clone https://github.com/material-motion/coreanimation-transitions-plugin-swift.git
cd coreanimation-transitions-plugin-swift
git clone https://github.com/material-motion/coreanimation-transitions-swift.git
cd coreanimation-transitions-swift
pod install
open MaterialMotionCoreAnimationTransitionsPlugin.xcworkspace
open MaterialMotionCoreAnimationTransitions.xcworkspace

## Guides

1. [Architecture](#architecture)
2. [How to ...](#how-to-...)
1. [How to animate a CALayer property with a TransitionTween plan](#how-to-animate-a-calayer-property-with-a-transitiontween-plan)

### How to animate a CALayer property with a TransitionTween plan

Code snippets:

***In Objective-C:***

```objc
MDMTween *tween = [[MDMTween alloc] initWithKeyPath:@"<#key path#>"
duration:<#duration#>
values:@[<#values...#>]];
[scheduler addPlan:tween to:<#Object#>];
```
***In Swift:***
### Architecture
```swift
### How to ...
let tween = TransitionTween(<#key path#>,
transition: transition,
segment: .init(position: <#position#>, length: <#length#>),
back: <#back value#>,
fore: <#fore value#>)
transition.scheduler.addPlan(tween, to: <#Layer#>)
```

## Contributing

We welcome contributions!

Check out our [upcoming milestones](https://github.com/material-motion/coreanimation-transitions-plugin-swift/milestones).
Check out our [upcoming milestones](https://github.com/material-motion/coreanimation-transitions-swift/milestones).

Learn more about [our team](https://material-motion.gitbooks.io/material-motion-team/content/),
[our community](https://material-motion.gitbooks.io/material-motion-team/content/community/), and
our [contributor essentials](https://material-motion.gitbooks.io/material-motion-team/content/essentials/).
Learn more about [our team](https://material-motion.github.io/material-motion/team/),
[our community](https://material-motion.github.io/material-motion/team/community/), and
our [contributor essentials](https://material-motion.github.io/material-motion/team/essentials/).

## License

Expand Down
20 changes: 0 additions & 20 deletions examples/ExampleViewController.swift

This file was deleted.

67 changes: 67 additions & 0 deletions examples/FadeInExample.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
Copyright 2016-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 MaterialMotionTransitions
import MaterialMotionCoreAnimationTransitions

class FadeInViewController: UIViewController {
init() {
super.init(nibName: nil, bundle: nil)
title = "Fade in transition"
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = .white

view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTap)))
}

func didTap() {
if presentingViewController == nil {
let viewController = FadeInViewController()
viewController.mdm_transitionController.directorClass = FadeInTransitionDirector.self
present(viewController, animated: true)
viewController.view.backgroundColor = .blue
} else {
dismiss(animated: true)
}
}
}

private class FadeInTransitionDirector: NSObject, TransitionDirector {

let transition: Transition
required init(transition: Transition) {
self.transition = transition
}

func setUp() {
let fadeIn = TransitionTween("opacity",
transition: transition,
segment: .init(position: 0, length: 1),
back: NSNumber(value: 0),
fore: NSNumber(value: 1))
fadeIn.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.runtime.addPlan(fadeIn, to: transition.foreViewController.view.layer)
}
}
Loading

0 comments on commit c4df629

Please sign in to comment.