gsdios/SDAutoLayout

One line of code to implement automatic layout. 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。The most easy way for...

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 50 minutes ago
Added to GitGenius on September 11th, 2026
Created on October 17th, 2015
Open Issues & Pull Requests: 168 (+0)
GitHub issues: Enabled
Number of forks: 1,255
Total Stargazers: 5,864 (+0)
Total Subscribers: 223 (+0)

Repository Insights (GitGenius)

Most active contributors

Sign in to see contributor activity.

Related repositories by overlapping contributors

No overlapping-contributor repos identified yet.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 3
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 57 days
Stale 30+ days: 3
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

SDAutoLayout is an Objective-C library that simplifies iOS auto layout through a minimal API requiring only a single line of code to define constraints.

The library addresses the verbosity and complexity of traditional Auto Layout by using runtime introspection to infer layout relationships from simple method calls. Rather than writing multiple constraint statements, developers specify positioning and sizing with chainable methods that the library interprets to generate the necessary underlying constraints. The approach handles common layout scenarios including table view cell height adaptation, label content sizing, and scroll view content fitting.

Developers adopting this tool should know it targets iOS projects using Objective-C and suits teams seeking rapid prototyping or simpler constraint syntax than Apple's standard API. The library is particularly useful for dynamic content scenarios like table views with variable-height cells and labels with text that adapts to available width. It includes built-in caching for table view cell heights to improve scrolling performance and handles content adaptation for both labels with attributed strings and scroll views with horizontal or vertical content.

The project shows sustained maintenance across multiple years with fixes addressing edge cases discovered in production use, including issues with button constraints on older iOS versions, cell height cache management during insertions and deletions, and layout conflicts when constraints are modified after initial setup. Updates have progressively added features like multi-reference view constraints, offset configuration, and support for views created via XIB files. The library maintains active community engagement through documented support channels and includes comprehensive video tutorials covering basic usage, advanced patterns, and implementation principles.