SnapKit: Swift Auto Layout DSL for iOS and macOS
Swift DSL for type-safe programmatic Auto Layout constraints.
Learn more about SnapKit
SnapKit is a Swift library that wraps Apple's Auto Layout system with a declarative DSL. It translates method-chaining syntax into NSLayoutConstraint objects, reducing boilerplate code required for programmatic constraint definition. The library supports constraint relationships like equality, inequality, and multiplier-based sizing across view hierarchies. It is commonly used in iOS and macOS projects where constraints are defined in code rather than Interface Builder.
Fluent Constraint Chaining
Constraints are defined through method-chaining syntax in a single closure, eliminating verbose NSLayoutConstraint boilerplate. The declarative DSL translates chained expressions directly into Auto Layout constraints with improved readability.
Cross-Platform Auto Layout
Identical constraint code runs on iOS 12.0+, macOS 10.13+, and tvOS 10.0+ without platform-specific modifications. Enables shared layout logic across Apple platforms using the same Swift DSL.
Flexible Dependency Integration
Supports CocoaPods, Carthage, Swift Package Manager, and manual installation. Teams can adopt SnapKit using their existing dependency management workflow without tooling changes.
import SnapKit
let box = UIView()
superview.addSubview(box)
box.snp.makeConstraints { make in
make.edges.equalToSuperview().inset(20)
}Top in Mobile & Desktop
Related Repositories
Discover similar tools and frameworks used by developers
Etcher
Cross-platform app for writing OS images to SD cards and USB drives with data verification.
React Native FS
Cross-platform native filesystem operations for React Native applications.
React Native Maps
Cross-platform React Native bridge to native map SDKs.
DDT4All
Python tool for Renault/Dacia vehicle diagnostics, ECU modification, and CAN bus communication.
React Native Apps
Curated collection of open source React Native and Expo apps showcasing implementation patterns and examples.
Related Reading
Guides and comparisons from the Greptile content library
Best Developer Productivity Tools in 2026
The best developer productivity tools in 2026, compared by the workflow problem they solve: code review, autocomplete, AI-native editing, terminal agents, code search, observability, and security.
What is Shift Left Testing? Everything Engineering Leaders Need to Know
The five types of shift-left testing, the benefits and limitations of each, and how the approach changes when agents write and review a growing share of your code.
Best Security-Focused AI Code Review Tools [2026 Guide]
The six best security-focused AI code review tools, compared on SAST, SCA, DAST, and full-repo context, so you can pick the one that fits your codebase and your cycle times.
27 Code Quality Tools that Catch Bugs [2026 Review]
The best code quality tools that catch bugs, security vulnerabilities, and runtime errors, sorted by language, with type, noise level, cost, and who each one is for.