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
NSObjectKey-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
SIMDAssistantto support using all currentSIMDtypes asMotionStatestates. Added tests for this class. - Added a new value assistant
CGColorAssistantto support usingCGColoras aMotionStatestate. Added tests for this class. - Added a new value assistant
NumericAssistantwhich 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 eitherBinaryFloatingPointorBinaryInteger, as well asNSNumber. Added tests for this class. - Fixed
velocityDecayLimitnot 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.1or older.