A Swift library providing protocol-oriented implementations for common iOS gesture recognizers to simplify UI interactions.
Standard Template Protocols (STP) is a Swift library that provides a set of protocols for implementing common gesture-based interactions in iOS apps. It solves the problem of deep and inflexible subclassing trees by using protocol-oriented programming to add features like dragging, pinching, rotating, and tapping to views with minimal code.
iOS developers building interactive user interfaces who want to avoid complex subclassing hierarchies and prefer a composable, protocol-based approach.
Developers choose STP because it simplifies adding gesture interactions through reusable protocols, reduces boilerplate code, and offers greater flexibility than traditional subclassing, all while leveraging Swift's modern language features.
Protocols for your every day iOS needs
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows mixing protocols like Moveable and Rotatable without subclassing, enabling flexible, additive behavior for complex interactive views as shown in the 'Using Them Together' example.
Leverages Swift's protocol extensions for type-safe, reusable code, reducing boilerplate and aligning with modern iOS development practices.
With CocoaPods integration, adding gestures requires minimal code—just conform to a protocol and call a setup method, such as makeMoveable(), as demonstrated in the examples.
Provides protocol methods like transformWithRotation and animateToPinchedTransform for overriding default behavior, allowing tailored animations and interactions.
Does not support SwiftUI, which is a significant drawback for teams adopting Apple's newer declarative UI framework.
The README references Swift 2.0 and CocoaPods version 0.3.0, suggesting infrequent updates and possible incompatibility with newer Swift versions or iOS features.
Only includes common gestures like pan and pinch, lacking support for advanced interactions such as swipe or custom multi-touch gestures, which may require workarounds.
Requires explicit calls to methods like makeTappable() in initializers, which can lead to errors if omitted and adds boilerplate compared to more automated solutions.