Skip to content

Commit

Permalink
Updates to README
Browse files Browse the repository at this point in the history
  • Loading branch information
poetmountain committed Jun 6, 2016
1 parent 79be25f commit 48331e2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
4 changes: 3 additions & 1 deletion Guides/MoveableClasses.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
All standard motion classes in MotionMachine conform to the `Moveable` protocol. This protocol defines the minimum ways that a motion class should operate within the MotionMachine ecosystem. For instance, each class has start, stop, pause, and resume methods, and each one must support the ability to reverse the direction of the value's movement. `Motion` and `PhysicsMotion` are the base motion classes; they take in `PropertyData` structs and use these as instructions for how to modify object values. These values are accessed and set by `ValueAssistant` objects.
All standard motion classes in MotionMachine conform to the `Moveable` protocol. This protocol defines the minimum ways that a motion class should operate within the MotionMachine ecosystem. For instance, each class has start, stop, pause, and resume methods, and each one must support the ability to reverse the direction of the value's movement.

`Motion` and `PhysicsMotion` are the base motion classes; they take in `PropertyData` structs and use these as instructions for how to modify object values. Each instance of `PropertyData` provides movement data that is specific to one property or discrete object. These property values are accessed and set by `ValueAssistant` objects. MotionMachine has assistants for several standard Core Graphics and UIKit value types, but you can add your own value assistants to a `Motion` to increase the types it can use.

These value updates are made as the motion moves through time. This movement is done via the `TempoDriven` protocol, which specifies how `Tempo` classes send update "beats" to motion classes. MotionMachine comes with two such `Tempo` classes – `CATempo`, which is driven by a `CADisplayLink` object and provides display-refresh syncing as Core Animation does, and `TimerTempo`, which provides tempo updates via an internal `NSTimer` object. The default `TempoDriven` object assigned to all MotionMachine classes is `CATempo`.

Expand Down
Binary file modified Guides/mmchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 22 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ MotionMachine is a powerful yet elegant animation library for Swift. It offers s

## Introduction

MotionMachine provides a modular, generic platform for manipulating values. Its animation engine was built from the ground up to support not just UIKit values, but property values of any class you want to manipulate. MotionMachine does support most major UIKit types out of the box and provides syntactic sugar to easily manipulate them. For instance, individual values of UIView frames can be directly targeted with a keyPath, such as "frame.size.width". Individual UIColor properties can be animated by specifying a keyPath shorthand for them, such as "red", "hue", or "alpha".
MotionMachine provides a modular, generic platform for manipulating values. Its animation engine was built from the ground up to support not just UIKit values, but property values of any class you want to manipulate. MotionMachine does support most major UIKit types out of the box and provides syntactic sugar to easily manipulate them.

* Motions can be grouped, sequenced, and nested in any arrangement.
* Includes both static and physics-based motion classes, and both support additive animation.
* Powerfully modular – most aspects can be customized or outright replaced to fit your specific needs.
* Provides status callback closures for many types of motion events.

### Example
#### Example
![MotionGroup animation](Guides/group.gif)

This complex animation was created with the code sample below. These `Motion` classes animate the NSLayoutConstraints of the circle views (_the constraints object in the `target` parameter is a dictionary of NSLayoutConstraint references_) as well as one of their `backgroundColor` properties. A `MotionGroup` object is used to synchronize the four `Motion` objects and reverse their movements.
Expand Down Expand Up @@ -47,11 +47,9 @@ let group = MotionGroup()
.start()
```

### How does this all work?
#### How does this work?

The atom of MotionMachine is the `PropertyData` class. Each instance of this class provides movement data that is specific to one property or discrete object. This class is used by `Motion` to animate one or more property values of a single class object. The actual retrieval and updating of values is handled by `ValueAssistant` classes. MotionMachine has assistants for several standard Quartz and UIKit value types, but you can add your own value assistants to a `Motion` to increase the types it can use.

All of the included motion classes in MotionMachine adopt the `Moveable` protocol which enables them to work seamlessly together. By using the `MotionGroup` and `MotionSequence` collection classes to control multiple motion objects – even nesting multiple layers – you can create complex animations with little effort. If you want to use your own custom motion classes within the MotionMachine ecosystem, simply have them adopt the `Moveable` protocol. However, the base `Motion` class offers such modularity that in most cases you can just add to or replace the components you need with your own implementation.
All of the included motion classes in MotionMachine adopt the `Moveable` protocol, which enables them to work seamlessly together. By using the `MotionGroup` and `MotionSequence` collection classes to control multiple motion objects – even nesting multiple layers – you can create complex animations with little effort. If you want to use your own custom motion classes within the MotionMachine ecosystem, simply have them adopt the `Moveable` protocol. However, the base `Motion` class offers such modularity that in most cases you can just add to or replace the components you need with your own implementation.

##### Motion

Expand Down Expand Up @@ -83,49 +81,49 @@ All of the included motion classes in MotionMachine adopt the `Moveable` protoco

## Getting Started

**Get started with the [Moveable Classes guide](Guides/MoveableClasses.md)**, which explains all of the basic motion classes in MotionMachine.

Also see the [Examples project](Examples) to see all the MotionMachine classes in action.
##### Get started with the **[Motion Classes guide](Guides/MoveableClasses.md)** for detailed explanations and examples.

## Caveats
Also check out the [Examples project](Examples) to see all the MotionMachine classes in action.

[] MotionMachine uses Key-Value Coding (KVC) to introspect objects and retrieve and set their property values using keypaths. Because Swift currently offers no native ability in this regard, objects whose properties should be modified by MotionMachine must inherit from `NSObject`. If and when more dynamism is added to Swift (and the author of this library hopes that is the case), MotionMachine will hopefully be able to do away with this restriction.

[] Because native Swift structs cannot inherit from `NSObject`, Swift structs unfortunately cannot be used with MotionMachine at this time.

[] The KVC provided by `NSObject` is not able to evaluate Optional values. Properties you wish to modify with MotionMachine must not be Optionals.

[] Swift on Linux is not currently supported due to the lack of Foundation and Core Graphics frameworks on that platform.


### Installation
## Installation

If you use CocoaPods:

##### Podfile
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

use_frameworks!

pod "MotionMachine", "~> 1.0.0"
target 'target name here' do
pod 'MotionMachine', '~> 1.0.0'
end
```

Or add the Classes directory to your project.

### Compatibility
## Compatibility

MotionMachine currently requires:
* Swift 2.2
* Xcode 7.3
* iOS 8.0 or later, tvOS 9.0 or later

### What's with the "motion" name?
#### Caveats

[] MotionMachine uses Key-Value Coding (KVC) to introspect objects and retrieve and set their property values using keypaths. Because Swift currently offers no native ability in this regard, objects whose properties should be modified by MotionMachine must inherit from `NSObject`. If and when more dynamism is added to Swift (and the author of this library hopes that is the case), MotionMachine will hopefully be able to do away with this restriction.

[] Because native Swift structs cannot inherit from `NSObject`, Swift structs unfortunately cannot be used with MotionMachine at this time.

*Animation* is a term typically associated with the movement of visual elements on-screen. But MotionMachine was designed to animate any kind of values, whether that be view positions, sound properties, 3D model vertices, or most any values you can think of. So the word *motion* is used because this library controls the movement of any type of value from one position to another over a period of time.
[] The KVC provided by `NSObject` is not able to evaluate Optional values. Properties you wish to modify with MotionMachine must not be Optionals.

[] Swift on Linux is not currently supported due to the lack of Foundation and Core Graphics frameworks on that platform.

## Credits

MotionMachine was created by [Brett Walker](https://twitter.com/petsound). It is based on the author's Objective-C library [PMTween](https://github.com/poetmountain/PMTween). The MotionMachine logo design is also by the author.
MotionMachine was created by [Brett Walker](https://twitter.com/petsound). It is based on the author's Objective-C library [PMTween](https://github.com/poetmountain/PMTween).


## License
Expand Down

0 comments on commit 48331e2

Please sign in to comment.