A lightweight Swift library for manual view and layer layout on iOS and tvOS, featuring a smart assign operator and edge-based positioning.
ManualLayout is a Swift library for manually laying out views and layers in iOS and tvOS apps. It provides a set of extensions and helper methods to position and size UI elements directly, avoiding the overhead of Auto Layout constraints. The library solves the need for precise, performance-sensitive layout control in scenarios where Auto Layout may be too heavy or inflexible.
iOS and tvOS developers who prefer manual layout over Auto Layout, need fine-grained control for performance-critical interfaces, or work with AsyncDisplayKit. It's ideal for those building custom UI components or complex view hierarchies.
Developers choose ManualLayout for its simplicity, reduced boilerplate, and explicit control. Its smart assign operator and edge-based properties make layout code more readable and maintainable compared to raw CGRect manipulations, while remaining lightweight and fast.
✂ Easy to use and flexible library for manually laying out views and layers for iOS and tvOS. Supports AsyncDisplayKit.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The smart assign operator `=~` reduces boilerplate code, making layout assignments like `someView.origin =~ (0, 20)` more readable and less verbose.
Provides direct properties like `top`, `right`, and alternate edges (`top2`, `right2`) for precise positioning and resizing, allowing detailed manipulation without moving views.
`inset` and `offset` functions calculate adjusted frames and sizes without modifying original views, aiding in layout logic without side effects.
Adds convenient properties to UIScrollView and UIViewController for accessing content dimensions and viewport offsets, simplifying common layout tasks.
The README notes alternate edge names 'may change in the near future,' indicating potential breaking changes that could affect code maintenance.
Lacks built-in mechanisms for adaptive layouts, requiring developers to manually recalculate frames for different devices or dynamic content, increasing complexity.
Compared to Auto Layout, there are fewer debugging tools, community resources, and third-party integrations, which can hinder troubleshooting and adoption.