Releases: poetmountain/MotionMachine
3.1.1
- Performance improvements for motion value updates.
Execution times for value updates have been significantly reduced for all value types. Some examples (tests run on Release configuration):
Value type | Speed increase |
---|---|
Double | 17% |
UIColor | 74% |
CGPoint | 62% |
CGRect | 65% |
SIMD64 | 188% |
For instance, all 64 values of a SIMD64<Double>
object in a Motion operation can now be updated on the target object in 52 microseconds (0.0000522 seconds), all properties of a CGRect
can be updated in 6 microseconds, and a single Double
value of an object property can now be updated in 1.2 microseconds.
- Fixed
CIColorAssistant
not respecting the existing colorspace of the original object during animations. - Added performance tests.
ValueAssistant
'supdateProperty(property:, newValue:)
method was changed toupdate(properties:, targetObject:)
to support updating multiple properties at once.
3.1.0
- Added support for watchOS!
- Updates to support Linux and other non-Apple Swift platforms. Replaced code specific to Apple platforms with core Swift classes. MotionMachine should now build on Linux, though it has not been tested on that platform. Please let me know if you test it!
- Note: Because of a current lack of support for Apple's Foundation types on non-Apple platforms, there are a limited number of features available on Linux. You can of course add your own custom motion classes or value assistants as needed. What is available should at least allow you to animate object values using
PropertyData
with all of the normal MotionMachine features like grouping, sequencing, additive animations, and all of the standard easing equations.
Available motion classes on Linux:
Motion
,PhysicsMotion
,MotionGroup
,MotionSequence
Available value assistants on Linux:
NumericAssistant
,SIMDAssistant
- Note: Because of a current lack of support for Apple's Foundation types on non-Apple platforms, there are a limited number of features available on Linux. You can of course add your own custom motion classes or value assistants as needed. What is available should at least allow you to animate object values using
- Improved timing accuracy of
PhysicsMotion
andPathPhysicsMotion
, as well asTimerTempo
. - Added SwiftUI examples project to showcase using MotionMachine features with SwiftUI Views.
Note: MotionMachine 3.0 included several breaking changes. If you have not done so, please also see the 3.0.0 release notes for breaking changes and new features, as well as the 3.0 Migration Guide for more details and a fuller list of changes.
3.0.0
MotionMachine 3.0 is a sizable overhaul of core functionality, replacing its use of NSObject
-based Key-Value Coding to read and write property values with modern Swift KeyPaths, as well as adding macOS support and support for some new Apple platform types. The move to Swift KeyPaths, made possible through recent improvements to Swift generics, provides more type safety and compile-time type checking, eliminates unsafe code, and now allows for the use of Optional properties and structs.
Though most of the API is relatively the same, there are several breaking changes and functional differences to be aware of. Please see the Migration Guide for more details and a fuller list of changes.
Major updates:
- MotionMachine's use of
NSObject
Key-Value Coding paths (i.e. "frame.origin.x") to read and write property values has been replaced with modern Swift KeyPaths (i.e.\UIView.frame.origin.x
). Please see the Motion Classes guide for implementation examples. Tests and examples project have also been updated to reflect these changes. - Added support for macOS! MotionMachine may now be used in AppKit projects in macOS 14.0 or higher.
- Added a new value assistant
SIMDAssistant
to support using all currentSIMD
types asMotionState
states. Added tests for this class. - Added a new value assistant
CGColorAssistant
to support usingCGColor
as aMotionState
state. Added tests for this class. - Added a new value assistant
NumericAssistant
which is now the default assistant for top-level properties on the target object which are numeric values. This supports all of the many numeric types that conform to eitherBinaryFloatingPoint
orBinaryInteger
, as well asNSNumber
. Added tests for this class. - Fixed
velocityDecayLimit
not being settable onPhysicsMotion
. - Improved internal platform availability checks. Theoretically this may allow MotionMachine to now run on non-Apple platforms on which Swift is available, though this has not been tested.
- With this update the minimum supported versions of iOS and tvOS have been increased to 16.0 in order to support KeyPaths in a generic way. If you need to support earlier versions of iOS or tvOS, please continue to use MotionMachine release
2.2.1
. - Support for Swift 5.10 has been dropped due to the adoption of a Swift 6 feature (parameter pack iteration). If you require an older version of Swift, please use MotionMachine release
2.2.1
or older.
2.2.1
- Added support for visionOS
- Fixed some access permission issues
- Added convenience inits for
PathMotion
andPathPhysicsMotion
to remove the need to pass in aPathState
manually - Added
setupPerformanceMode
convenience method toPathMotion
andPathPhysicsMotion
classes (which callPathState
's method internally)
2.2.0
After a long spell of mostly maintenance releases, I'm very excited to present some big, new functionality to MotionMachine that I've been thinking about implementing for a long time. Animating objects along a CGPath
! This opens up a lot of new possibilities for both animating views on-screen, as well as interpolating generic values in more complex ways. And as with all other MotionMachine classes, these new Path classes act in the ways you'd expect -- reverse them, repeat them, nest them in MotionGroup
and MotionSequence
, whatever you'd like!
- Added
PathMotion
class to allow aCGPoint
to be animated along the length of aCGPath
!PathMotion
conforms to theMoveable
protocol and interacts with the MotionMachine ecosystem as you'd expect from the other motion classes, and you can use all of the normal easing equations. Using thestartPosition
andendPosition
parameters you can even specify a portion of the path to animate along. - Added
PathPhysicsMotion
class to allow aCGPoint
to be animated along the length of aCGPath
using the same physics system thatPhysicsMotion
uses! LikePathMotion
, it conforms to theMoveable
protocol and interacts with the MotionMachine ecosystem as you'd expect from the other motion classes. - Added simple collision handling to
PhysicsSystem
, the physics engine that powersPhysicsMotion
andPathPhysicsMotion
. Collision points can be specified using the starting and ending points of a motion, and arestitution
value to control how much velocity is lost during a collision can be set using the newPhysicsConfiguration
object. This collision support givesPhysicsMotion
and the newPathPhysicsMotion
some interesting uses -- I'd love to hear what you come up with!
Please see the updated user guide, documentation, and examples for more information about the new Path classes and physics collision support!
2.1.0
- Support for Swift 6.0 and strict concurrency mode
- Removed many legacy forced unwrappings of Optionals
- Changed
PhysicsMotion
's DispatchSourceTimer to a regular Timer to solve concurrency crash
2.0.2
• Update protocol conformance to AnyObject
2.0.1
- Fixed some retain cycles that were holding on to target objects
- Updated examples project
2.0.0
- Support for Swift 5.0
- Updated syntax in MotionOptions for newer Swift naming conventions
- Updated Swift package file to newest version, requires Xcode 11 to import
- Bumped version to 2.0.0 due to breaking change in MotionOptions (Swift Package Manager requires packages use semantic versioning)
1.3.2
- Fixed bugs which prevented some CGStructs from being updated when using Motion’s statesForProperties convenience initializer
- Added targetsNestedStruct static method to CGStructAssistant, which determines whether a specified keyPath targets a struct of a CGRect
- Added and improved tests
- Improved readability and streamlined some code